Skip to content

armgit / xerj

Public Imported from GitHub
0

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.

fix(hub): route a named language to its corpora (#2104)

xerj-org4c6656913a54
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b48cef3a7..451c42a08 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
+- A bare hub question that names a language or a technology
+ (`xerj "how do I use async let in Swift"`, `xerj "Swift Result type map"`)
+ routes from the catalogue entry — slug, topics, a language word in the
+ description, then the rest of the description — instead of the term sketch.
+ On the 468-corpus hub the sketch's false positives tied swift-book with
+ unrelated corpora (qwik, docker-docs, harper, oss-review-toolkit) and both
+ questions exited 4. One clear winner is searched on its own. Two or three
+ corpora that share the winning name are searched together and named on one
+ `using:` line. Exit 4 stays for a genuine tie and lists at most five
+ candidates, best first.
+
- An MCP tool call that cannot connect to `XERJ_URL` now says that no XERJ
node is listening there, that `xerj mcp` does not start one, and prints
`xerj --insecure --data-dir ~/xerj-data`. A bare connection error was the
diff --git a/docs/CORPUS_HUB_V2_IMPLEMENTATION.md b/docs/CORPUS_HUB_V2_IMPLEMENTATION.md
index 0c8d5eb8c..71a8936a0 100644
--- a/docs/CORPUS_HUB_V2_IMPLEMENTATION.md
+++ b/docs/CORPUS_HUB_V2_IMPLEMENTATION.md
@@ -392,6 +392,12 @@ Order and scoring, exactly:
(or no second). `Ambiguous` if two or more are ≥ 0.3. Else `NoCorpus`.
`--corpus` skips routing. Corpora already cached (`cached`) get +0.05.
+ A question that names a language or a technology is decided before those four
+ steps, from the catalogue entry itself (slug, topics, a language word in
+ `ask_for`, then the rest of `ask_for`). An exact slug the question spells
+ out still wins first. The sketch path above still decides when no distinctive
+ name matches. See `xerj_hub::router`.
+
**Answer flow** (`xerj_hub::ask`):
1. If the question names a symbol (`--def`, or the whole question is one identifier,
diff --git a/engine/crates/xerj-hub/src/ask.rs b/engine/crates/xerj-hub/src/ask.rs
index 8aa956e69..b4f6da5fc 100644
--- a/engine/crates/xerj-hub/src/ask.rs
+++ b/engine/crates/xerj-hub/src/ask.rs
@@ -9,7 +9,10 @@
//! anything else is [`AnswerMode::How`]; `--files` forces
//! [`AnswerMode::Files`] ([`detect_mode`]).
//! 2. **Route** ([`crate::router::route`]). `--corpus` skips routing.
-//! Ambiguous → the candidates are printed and the exit code is **4**;
+//! A question that names a language or technology is answered from that
+//! corpus, or from a tight group of at most three which are searched
+//! together; the answer's first line names them (`using: slug, slug`).
+//! Genuinely ambiguous → a few candidates, best first, and exit code **4**;
//! nothing credible → exit **1** with the llms.txt pointer.
//! 3. **Cached pack** → answer locally ([`AnsweredFrom::LocalPack`]); the
//! network is not touched.
@@ -70,7 +73,7 @@ use xerj_common::xccode::{self, licence, passage, state, CodeParams, XcHttp};
use crate::catalogue::load_catalogue;
use crate::node::{self, HubNode, NodeLauncher, ResolvedNode};
-use crate::router::{route_ranked, HostedSearch, Routing};
+use crate::router::{cap_ambiguous, route_ranked, HostedSearch, Routing};
use crate::{cli, def, lockfile, sketch};
/// Answered with at least one hit.
@@ -556,10 +559,28 @@ pub fn ask(args: &AskArgs, deps: &AskDeps<'_>) -> AskOutcome {
}
};
- // Step 2: route.
- let Some(slug) = select_corpus(args, deps, hosted, symbol.as_deref(), &mut out) else {
+ // Step 2: route. One corpus keeps the single-corpus path. A tight group is
+ // searched together; each member is answered the same way one corpus would
+ // be (local pack, else hosted, else a pull under the auto-pull cap).
+ let Some(slugs) = select_corpus(args, deps, hosted, symbol.as_deref(), &mut out) else {
return out;
};
+ if slugs.len() == 1 {
+ return answer_known_slug(args, deps, hosted, &slugs[0], mode, symbol.as_deref(), out);
+ }
+ answer_group(args, deps, hosted, &slugs, mode, symbol.as_deref(), out)
+}
+
+/// Answer `slug`. `out` already carries notices from resolving the hosted switch.
+fn answer_known_slug(
+ args: &AskArgs,
+ deps: &AskDeps<'_>,
+ hosted: Option<&dyn HostedHub>,
+ slug: &str,
+ mode: AnswerMode,
+ symbol: Option<&str>,
+ mut out: AskOutcome,
+) -> AskOutcome {
let entry = deps.catalogue.corpora.iter().find(|e| e.slug == slug);
// An excluded licence class is never served — not from a pack that happens to
// be on disk (pulled before a reclassification, or copied in by hand), and not
@@ -569,23 +590,23 @@ pub fn ask(args: &AskArgs, deps: &AskDeps<'_>) -> AskOutcome {
if let Some(e) = entry.filter(|e| e.licence_class == LicenceClass::Excluded) {
out.stderr.push(format!(
"'{}' has an excluded licence class ({}) and is never served or pulled",
- printable(&slug),
+ printable(slug),
printable(&e.licence_spdx)
));
out.exit = EXIT_NO_ANSWER;
return out;
}
let req = Request {
- slug: &slug,
+ slug,
question: &args.question,
mode,
- symbol: symbol.as_deref(),
+ symbol,
max_tokens: args.max_tokens,
k: args.k,
};
// Step 3: a pack on this machine answers locally, with no network.
- match deps.backend.local_pack_ready(&slug) {
+ match deps.backend.local_pack_ready(slug) {
Ok(true) => return answer_locally(args, deps, &req, entry, out),
Ok(false) => {}
Err(e) => out.stderr.push(format!("local pack unavailable: {e}")),
@@ -594,13 +615,13 @@ pub fn ask(args: &AskArgs, deps: &AskDeps<'_>) -> AskOutcome {
// Step 4: hosted answers now; the pull happens behind it.
if let Some(h) = hosted {
match h.answer(&req) {
- Ok(answer) => return finish_hosted(args, deps, &slug, entry, answer, out),
+ Ok(answer) => return finish_hosted(args, deps, slug, entry, answer, out),
Err(e) => out.stderr.push(format!("hosted answer failed: {e:#}")),
}
}
// Step 5: neither a pack nor a hosted answer.
- let shown = printable(&slug);
+ let shown = printable(slug);
let Some(entry) = entry else {
out.stderr.push(format!(
"corpus '{shown}' is not in the catalogue, so it cannot be pulled, and no hosted \
@@ -664,6 +685,77 @@ pub fn ask(args: &AskArgs, deps: &AskDeps<'_>) -> AskOutcome {
}
}
+/// Search a tight group and merge what came back. Each member is answered on
+/// its own (a local pack, a hosted call, or a pull under the cap). A member
+/// that cannot be answered is skipped; the `using:` line names the corpora
+/// that produced an answer. The line is the whole of the group contract: one
+/// line, the slugs that were actually searched.
+fn answer_group(
+ args: &AskArgs,
+ deps: &AskDeps<'_>,
+ hosted: Option<&dyn HostedHub>,
+ slugs: &[String],
+ mode: AnswerMode,
+ symbol: Option<&str>,
+ mut out: AskOutcome,
+) -> AskOutcome {
+ let mut answers: Vec<Answer> = Vec::new();
+ let mut last_fail = EXIT_NO_ANSWER;
+ for slug in slugs {
+ let outcome = answer_known_slug(
+ args,
+ deps,
+ hosted,
+ slug,
+ mode,
+ symbol,
+ AskOutcome::default(),
+ );
+ out.stderr.extend(outcome.stderr);
+ if let Some(answer) = outcome.answer {
+ answers.push(answer);
+ } else {
+ last_fail = outcome.exit;
+ }
+ }
+ if answers.is_empty() {
+ out.exit = last_fail;
+ return out;
+ }
+ let names: Vec<String> = answers.iter().map(|a| a.corpus.clone()).collect();
+ let using = format!(
+ "using: {}",
+ names
+ .iter()
+ .map(|s| printable(s))
+ .collect::<Vec<_>>()
+ .join(", ")
+ );
+ let any_hits = answers.iter().any(|a| !a.hits.is_empty());
+ let mut merged = answers[0].clone();
+ for extra in answers.iter().skip(1) {
+ merged.hits.extend(extra.hits.iter().cloned());
+ for warning in &extra.warnings {
+ push_unique(&mut merged.warnings, warning.clone());
+ }
+ }
+ merged.hits.sort_by(|a, b| {
+ b.score
+ .partial_cmp(&a.score)
+ .unwrap_or(std::cmp::Ordering::Equal)
+ });
+ merged.corpus = names.join(",");
+ out.stdout = if args.json {
+ serde_json::to_string(&merged).unwrap_or_else(|e| format!("{{\"error\":\"{e}\"}}"))
+ } else {
+ let body = answers.iter().map(render).collect::<Vec<_>>().join("\n");
+ format!("{using}\n{body}")
+ };
+ out.exit = if any_hits { EXIT_OK } else { EXIT_NO_ANSWER };
+ out.answer = Some(merged);
+ out
+}
+
/// A definition name found in the term sketches of more corpora than this names no
/// one corpus (`main`, `init`, `NULL`): it is not evidence, and listing every
/// corpus that defines it would only be noise.
@@ -709,6 +801,9 @@ fn with_symbol_evidence(routing: Routing, hits: &[String]) -> Routing {
};
match routing {
Routing::Confident(slug) => Routing::Confident(slug),
+ // The identity group already decided. A symbol defined in one of them
+ // must not drop the others, and one defined elsewhere must not widen it.
+ Routing::Group(slugs) => Routing::Group(slugs),
Routing::Ambiguous(slugs) => {
let both: Vec<String> = slugs.iter().filter(|s| hits.contains(s)).cloned().collect();
pick(both).unwrap_or(Routing::Ambiguous(slugs))
@@ -751,17 +846,18 @@ fn printable_slug(s: &str) -> String {
}
/// Step 2. `None` means `out` already holds the verdict (an exit code and its
-/// message / candidate lines).
+/// message / candidate lines). A tight group comes back as two or three slugs,
+/// best first; one confident corpus comes back as a one-element list.
fn select_corpus(
args: &AskArgs,
deps: &AskDeps<'_>,
hosted: Option<&dyn HostedHub>,
symbol: Option<&str>,
out: &mut AskOutcome,
-) -> Option<String> {
+) -> Option<Vec<String>> {
if let Some(c) = &args.corpus {
if deps.catalogue.corpora.iter().any(|e| &e.slug == c) {
- return Some(c.clone());
+ return Some(vec![c.clone()]);
}
out.stderr.push(format!(
"unknown corpus '{}' (catalogue generated {})",
@@ -786,7 +882,7 @@ fn select_corpus(
// the machine.
let (routing, mut ranked) = route_ranked(&args.question, deps.cwd, catalogue, None, &cached);
let mut routing = with_symbol_evidence(routing, &by_symbol);
- if !matches!(routing, Routing::Confident(_)) {
+ if !matches!(routing, Routing::Confident(_) | Routing::Group(_)) {
if let Some(h) = hosted {
let (hosted_routing, hosted_ranked) = route_ranked(
&args.question,
@@ -812,6 +908,14 @@ fn select_corpus(
let known = |s: &String| catalogue.corpora.iter().any(|e| &e.slug == s);
let routing = match routing {
Routing::Confident(slug) if excluded(&slug) => Routing::NoCorpus,
+ Routing::Group(slugs) => {
+ let kept: Vec<String> = slugs.into_iter().filter(|s| !excluded(s)).collect();
+ match kept.len() {
+ 0 => Routing::NoCorpus,
+ 1 => Routing::Confident(kept.into_iter().next().expect("len 1")),
+ _ => Routing::Group(kept),
+ }
+ }
Routing::Ambiguous(slugs) => {
let kept: Vec<String> = slugs.into_iter().filter(|s| !excluded(s)).collect();
// One left is still not a confident pick: the asker decides.
@@ -823,8 +927,10 @@ fn select_corpus(
}
other => other,
};
+ let routing = cap_ambiguous(routing);
match routing {
- Routing::Confident(slug) => Some(slug),
+ Routing::Confident(slug) => Some(vec![slug]),
+ Routing::Group(slugs) => Some(slugs),
Routing::Ambiguous(slugs) => {
let lines: Vec<String> = slugs
.iter()
@@ -1665,9 +1771,11 @@ pub const FIND_MAX_K: usize = 10;
#[derive(Debug, Clone, serde::Serialize)]
pub struct FoundCorpus {
pub slug: String,
- /// The router's merged evidence score (dependency 1.0, sketch ≤ 0.8, +0.05
- /// when cached); 0 for a corpus proposed only because its definitions hold
- /// the exact symbol the question names.
+ /// The router's score for this corpus. Identity matches (a slug, tag, or
+ /// language word) are on their own scale, above the sketch's 0.8 ceiling;
+ /// dependency evidence is 1.0, a sketch is at most 0.8, and a cached pack
+ /// adds 0.05 on the sketch path. 0 for a corpus proposed only because its
+ /// definitions hold the exact symbol the question names.
pub score: f32,
pub cached: bool,
pub ask_for: String,
@@ -1689,10 +1797,11 @@ pub struct FindOutcome {
/// Which corpora could answer `question` — the routing half of [`ask`], with
/// nothing answered and nothing pulled. The evidence is exactly what
-/// [`ask`]'s corpus selection uses before it consults a hosted node: the
-/// project's dependencies (from `cwd`), the catalogue's term sketches, the
-/// exact-symbol evidence for a definition question, and the cached-pack bonus.
-/// An `excluded` corpus is never listed (it is never served either).
+/// [`ask`]'s corpus selection uses before it consults a hosted node: identity
+/// (slug, topics, language, description), the project's dependencies (from
+/// `cwd`), the catalogue's term sketches, the exact-symbol evidence for a
+/// definition question, and the cached-pack bonus. An `excluded` corpus is
+/// never listed (it is never served either).
pub fn find(
question: &str,
k: usize,
@@ -1708,12 +1817,13 @@ pub fn find(
.map(|s| symbol_hits(catalogue, s.trim()))
.unwrap_or_default();
let (routing, ranked) = route_ranked(question, cwd, catalogue, None, &cached);
- let routing = with_symbol_evidence(routing, &by_symbol);
- // The verdict's own order first (a confident pick, or the ambiguous list),
- // then everything else the router ranked, then symbol-only candidates.
+ let routing = cap_ambiguous(with_symbol_evidence(routing, &by_symbol));
+ // The verdict's own order first (a confident pick, the group, or the
+ // ambiguous list), then everything else the router ranked, then
+ // symbol-only candidates.
let mut order: Vec<String> = match &routing {
Routing::Confident(slug) => vec![slug.clone()],
- Routing::Ambiguous(slugs) => slugs.clone(),
+ Routing::Group(slugs) | Routing::Ambiguous(slugs) => slugs.clone(),
Routing::NoCorpus => Vec::new(),
};
for slug in ranked.iter().map(|(s, _)| s).chain(by_symbol.iter()) {
@@ -1748,7 +1858,7 @@ pub fn find(
.collect();
FindOutcome {
routing: match routing {
- Routing::Confident(_) => "confident",
+ Routing::Confident(_) | Routing::Group(_) => "confident",
Routing::Ambiguous(_) => "ambiguous",
Routing::NoCorpus => "no_corpus",
},
@@ -2263,6 +2373,104 @@ mod tests {
assert!(backend.calls().is_empty(), "nothing is answered or pulled");
}
+ /// The two Swift questions that exit 4 on the live hub. Every sketch contains
+ /// every query token, so a sketch tie would list qwik and docker-docs with
+ /// the Swift corpora. Identity searches the Swift pair and says so.
+ #[test]
+ fn a_swift_question_searches_the_swift_corpora_and_names_them() {
+ let rig = Rig::new();
+ let poison = [
+ "how", "use", "async", "let", "swift", "Swift", "result", "Result", "type", "map",
+ ];
+ let rows = [
+ (
+ "swift-book",
+ "An agent writing Swift queries this for The Swift Programming Language book: syntax and semantics of concurrency (async/await, async let, actors), generics, optionals, error handling and the language reference grammar.",
+ ),
+ (
+ "swift-evolution",
+ "An agent writing Swift queries this for the accepted Swift Evolution proposals (SE-NNNN): the motivation, exact semantics and API of language and standard-library features such as Result, async let, typed throws and macros.",
+ ),
+ (
+ "qwik",
+ "An agent minimising client JS queries this for Qwik's resumability model and code-splitting/lazy-loading of event handlers.",
+ ),
+ (
+ "docker-docs",
+ "An agent writing Dockerfiles and compose files queries this for the canonical Docker CLI, build and Compose reference docs.",
+ ),
+ (
+ "harper",
+ "An agent building a fast local grammar/style checker in Rust queries this for its rule engine, lint rules and curated dictionary.",
+ ),
+ (
+ "oss-review-toolkit",
+ "An agent building a dependency license-compliance pipeline queries this for a production OSS Review Toolkit implementation.",
+ ),
+ ];
+ let cat = catalogue(
+ rows.into_iter()
+ .map(|(slug, ask_for)| {
+ let mut terms: Vec<String> = ask_for
+ .split(|c: char| !c.is_ascii_alphanumeric())
+ .filter(|w| w.len() >= 3)
+ .map(|w| w.to_ascii_lowercase())
+ .collect();
+ terms.extend(poison.iter().map(|s| (*s).to_string()));
+ let mut e = entry(slug, 1024, LicenceClass::AdaptWithAttribution, &[]);
+ e.ask_for = ask_for.to_string();
+ e.term_sketch = sketch(&terms.iter().map(String::as_str).collect::<Vec<_>>());
+ e
+ })
+ .collect(),
+ );
+ let backend = FakeBackend::new(true);
+ let out = rig.run(
+ &args("how do I use async let in Swift", None),
+ &cat,
+ None,
+ &backend,
+ );
+ assert_eq!(out.exit, EXIT_OK, "{:?}", out.stderr);
+ assert!(
+ out.stdout
+ .starts_with("using: swift-book, swift-evolution\n"),
+ "{}",
+ out.stdout
+ );
+ assert!(out.stdout.contains("swift-book pin "), "{}", out.stdout);
+ assert!(
+ out.stdout.contains("swift-evolution pin "),
+ "{}",
+ out.stdout
+ );
+ assert!(!out.stdout.contains("qwik pin "), "{}", out.stdout);
+ assert!(!out.stdout.contains("docker-docs pin "), "{}", out.stdout);
+ assert_eq!(
+ backend.calls(),
+ [
+ "ready:swift-book",
+ "answer_local:swift-book",
+ "ready:swift-evolution",
+ "answer_local:swift-evolution",
+ ]
+ );
+
+ let backend = FakeBackend::new(true);
+ let out = rig.run(&args("Swift Result type map", None), &cat, None, &backend);
+ assert_eq!(out.exit, EXIT_OK, "{:?}", out.stderr);
+ assert!(
+ out.stdout
+ .starts_with("using: swift-evolution, swift-book\n"),
+ "{}",
+ out.stdout
+ );
+ assert_eq!(
+ out.answer.as_ref().unwrap().corpus,
+ "swift-evolution,swift-book"
+ );
+ }
+
#[test]
fn no_corpus_exits_1_with_the_llms_txt_pointer() {
let rig = Rig::new();
diff --git a/engine/crates/xerj-hub/src/cli.rs b/engine/crates/xerj-hub/src/cli.rs
index e694288a0..1439f55d3 100644
--- a/engine/crates/xerj-hub/src/cli.rs
+++ b/engine/crates/xerj-hub/src/cli.rs
@@ -1375,7 +1375,8 @@ options:
exit codes: 0 answered; 1 no match or nothing to answer from; 2 usage error or
unknown corpus; 3 a pack failed verification; 4 more than one corpus matches
-(candidates are printed; re-run with --corpus <slug>); 5 this build has no hub
+and none clearly wins (a few candidates are printed, best first; re-run with
+--corpus <slug>); 5 this build has no hub
public key, so no pack can be verified (nothing was downloaded); 6 the hub
catalogue could not be loaded (hub unreachable, no signed catalogue served, or
--offline with none cached): a hub problem, not an answer about any corpus";
diff --git a/engine/crates/xerj-hub/src/router.rs b/engine/crates/xerj-hub/src/router.rs
index 5f9f986f7..ca9d900f3 100644
--- a/engine/crates/xerj-hub/src/router.rs
+++ b/engine/crates/xerj-hub/src/router.rs
@@ -2,13 +2,25 @@
//! step 5, "Router").
//!
//! Given a question, the working directory and the signed [`Catalogue`], decide
-//! which corpus answers it — **before** anything is downloaded. Three kinds of
-//! evidence are gathered, each on its own scale, then merged per slug:
+//! which corpus answers it — **before** anything is downloaded.
//!
-//! 1. **Project dependencies** (score `1.0`). The strongest signal: if the
-//! project the agent is standing in declares a dependency a corpus is built
-//! for, that corpus almost certainly holds the answer. Dependency names are
-//! read from the lockfiles found walking from `cwd` up to the git root
+//! A question that names a language or a technology is decided from the
+//! catalogue entry itself: the slug (its name), topics (its tags), a language
+//! word in the description, and the rest of the description. An explicit name
+//! such as "Swift" outweighs generic words ("use", "type", "map"). When one
+//! corpus or a tight group of at most [`GROUP_MAX`] share that name, they are
+//! the answer ([`Routing::Confident`] or [`Routing::Group`]) and are searched
+//! together. The Bloom sketch is not consulted for that decision: on a large
+//! catalogue its false positives make unrelated corpora tie with the one the
+//! question named.
+//!
+//! Otherwise three other kinds of evidence are gathered, each on its own scale,
+//! then merged per slug:
+//!
+//! 1. **Project dependencies** (score `1.0`). If the project the agent is
+//! standing in declares a dependency a corpus is built for, that corpus
+//! almost certainly holds the answer. Dependency names are read from the
+//! lockfiles found walking from `cwd` up to the git root
//! ([`parse_project_deps`]).
//! 2. **Hosted federated search** (score `0.9 × hit/top`). When the hosted node
//! is consulted, its ranked hits are normalised to the best one so a strong
@@ -22,10 +34,12 @@
//!
//! The merged scores decide: a dominant, high-scoring corpus is
//! [`Routing::Confident`]; a cluster of plausible ones is
-//! [`Routing::Ambiguous`] (best-first, for the caller to disambiguate with
-//! `--corpus`); nothing credible is [`Routing::NoCorpus`]. A corpus already
-//! cached locally gets a small nudge so a tie breaks toward the pack the agent
-//! already has.
+//! [`Routing::Ambiguous`] (best-first; the ask path shows at most
+//! [`AMBIGUOUS_SHOWN`] after symbol evidence, and the caller disambiguates
+//! with `--corpus`); nothing credible is
+//! [`Routing::NoCorpus`]. A corpus already cached locally gets a small nudge so
+//! a tie breaks toward the pack the agent already has. A corpus the question
+//! names by slug still decides outright, ahead of the identity score.
use std::collections::{HashMap, HashSet};
use std::fs;
@@ -60,12 +74,17 @@ pub struct Evidence {
pub source: EvidenceSource,
}
-/// The routing verdict. `Ambiguous` holds the candidate slugs best-first.
+/// The routing verdict. `Ambiguous` and `Group` hold slugs best-first.
#[derive(Debug, Clone, PartialEq)]
pub enum Routing {
/// One corpus clearly wins; answer from it.
Confident(String),
- /// Several corpora are plausible (best-first); the caller must pick one.
+ /// A tight group of two or three corpora that share the question's
+ /// distinctive name (best-first). Search them together.
+ Group(Vec<String>),
+ /// Several corpora are plausible (best-first). The ask path shows at most
+ /// [`AMBIGUOUS_SHOWN`] after symbol evidence has had a chance to narrow
+ /// the list; the caller must pick one.
Ambiguous(Vec<String>),
/// Nothing credible matched.
NoCorpus,
@@ -102,6 +121,26 @@ const NAMED_SCORE: f32 = 1.0;
/// Slugs shorter than this are never matched as a name (too likely to be a
/// stray word or abbreviation).
const NAMED_MIN_LEN: usize = 2;
+/// How many corpora an ambiguous verdict names. The rest stay in the ranked
+/// list a caller can still inspect; the asker is not shown a flat tie of dozens.
+pub const AMBIGUOUS_SHOWN: usize = 5;
+/// A name match (slug or language) is weighted this many times the token's idf.
+const IDENTITY_NAME_WEIGHT: f32 = 4.0;
+/// A topic / tag match.
+const IDENTITY_TAG_WEIGHT: f32 = 3.0;
+/// Any other description word. Generic words stay on this scale, so a name
+/// match dominates them.
+const IDENTITY_DESC_WEIGHT: f32 = 1.0;
+/// At most this many corpora are searched together when they share the winning
+/// name. More than this is a genuine ambiguity: the asker picks.
+const GROUP_MAX: usize = 3;
+/// Identity tokens shorter than this are dropped (`in`, `of`). A two-letter
+/// slug is still matched by [`named_slugs`].
+const IDENTITY_MIN_LEN: usize = 3;
+/// A token seen in more than `max(DISTINCTIVE_FLOOR, ceil(this × N))` corpora
+/// is common vocabulary and cannot by itself pick a corpus.
+const DISTINCTIVE_FRACTION: f32 = 0.02;
+const DISTINCTIVE_FLOOR: usize = 3;
/// Route a question to a corpus.
///
@@ -239,18 +278,283 @@ pub fn route_ranked(
}
let (routing, ranked) = decide(evidence, cached);
+ // A slug the question spells out decides before identity scoring. "lz4 or
+ // zstd?" is the asker choosing, not a group to search together.
match named.len() {
- 0 => (routing, ranked),
- 1 => (Routing::Confident(named[0].clone()), ranked),
- _ => {
+ 1 => return (Routing::Confident(named[0].clone()), ranked),
+ n if n > 1 => {
let in_order: Vec<String> = ranked
.iter()
.filter(|(slug, _)| named.contains(slug))
.map(|(slug, _)| slug.clone())
.collect();
- (Routing::Ambiguous(in_order), ranked)
+ return (Routing::Ambiguous(in_order), ranked);
+ }
+ _ => {}
+ }
+ if let Some(identity) = identity_route(question, cat) {
+ return identity;
+ }
+ (routing, ranked)
+}
+
+/// Shorten an [`Routing::Ambiguous`] list to [`AMBIGUOUS_SHOWN`], best first.
+/// Other verdicts pass through. Applied after symbol evidence, so a definition
+/// that lives in one of the candidates can still narrow the full list.
+pub fn cap_ambiguous(routing: Routing) -> Routing {
+ match routing {
+ Routing::Ambiguous(slugs) if slugs.len() > AMBIGUOUS_SHOWN => {
+ Routing::Ambiguous(slugs.into_iter().take(AMBIGUOUS_SHOWN).collect())
+ }
+ other => other,
+ }
+}
+
+/// One corpus scored against the question's identity terms.
+struct IdentityScore {
+ slug: String,
+ score: f32,
+ /// Distinctive slug, tag, or language tokens, `(token, contribution)`.
+ identity: Vec<(String, f32)>,
+}
+
+/// Route from the catalogue entry itself: slug, topics, language, description.
+///
+/// `None` means no distinctive name matched, and the sketch / dependency /
+/// hosted evidence should decide. A match returns the verdict and every
+/// corpus that scored, best first.
+fn identity_route(question: &str, cat: &Catalogue) -> Option<(Routing, Vec<(String, f32)>)> {
+ let tokens = identity_query_tokens(question);
+ if tokens.is_empty() || cat.corpora.is_empty() {
+ return None;
+ }
+ let n = cat.corpora.len();
+ let profiles: Vec<IdentityProfile> = cat
+ .corpora
+ .iter()
+ .map(IdentityProfile::from_entry)
+ .collect();
+
+ let mut df: HashMap<String, usize> = HashMap::new();
+ for profile in &profiles {
+ let mut seen: HashSet<&str> = HashSet::new();
+ for token in profile
+ .slug
+ .iter()
+ .chain(profile.tags.iter())
+ .chain(profile.desc.iter())
+ {
+ if seen.insert(token.as_str()) {
+ *df.entry(token.clone()).or_default() += 1;
+ }
+ }
+ }
+
+ let mut scored: Vec<IdentityScore> = Vec::new();
+ for (entry, profile) in cat.corpora.iter().zip(&profiles) {
+ let mut score = 0.0;
+ let mut identity: Vec<(String, f32)> = Vec::new();
+ for token in &tokens {
+ let Some(&docs) = df.get(token) else {
+ continue;
+ };
+ let idf = ((n as f32 + 1.0) / (docs as f32 + 1.0)).ln();
+ let (weight, is_name) = if profile.slug.contains(token) {
+ (IDENTITY_NAME_WEIGHT, true)
+ } else if profile.tags.contains(token) {
+ (IDENTITY_TAG_WEIGHT, true)
+ } else if profile.desc.contains(token) && is_language(token) {
+ (IDENTITY_NAME_WEIGHT, true)
+ } else if profile.desc.contains(token) {
+ (IDENTITY_DESC_WEIGHT, false)
+ } else {
+ continue;
+ };
+ let contribution = weight * idf;
+ score += contribution;
+ if is_name && distinctive(docs, n) {
+ identity.push((token.clone(), contribution));
+ }
+ }
+ if score > 0.0 {
+ scored.push(IdentityScore {
+ slug: entry.slug.clone(),
+ score,
+ identity,
+ });
+ }
+ }
+ if scored.is_empty() {
+ return None;
+ }
+ scored.sort_by(|a, b| {
+ b.score
+ .partial_cmp(&a.score)
+ .unwrap_or(std::cmp::Ordering::Equal)
+ .then_with(|| a.slug.cmp(&b.slug))
+ });
+ let ranked: Vec<(String, f32)> = scored.iter().map(|s| (s.slug.clone(), s.score)).collect();
+
+ // The winning term is the strongest distinctive name anywhere, not the
+ // highest total: a rare description word must not outvote "Swift".
+ let mut best_term: Option<(&str, f32)> = None;
+ for row in &scored {
+ for (token, contribution) in &row.identity {
+ let replace = match best_term {
+ None => true,
+ Some((prev, prev_score)) => match contribution.partial_cmp(&prev_score) {
+ Some(std::cmp::Ordering::Greater) => true,
+ Some(std::cmp::Ordering::Equal) => token.as_str() < prev,
+ _ => false,
+ },
+ };
+ if replace {
+ best_term = Some((token.as_str(), *contribution));
+ }
+ }
+ }
+ let (term, _) = best_term?;
+ let term = term.to_string();
+ let peers: Vec<&IdentityScore> = scored
+ .iter()
+ .filter(|row| row.identity.iter().any(|(token, _)| token == &term))
+ .collect();
+ if peers.is_empty() {
+ return None;
+ }
+ if peers.len() > GROUP_MAX {
+ let slugs = peers
+ .into_iter()
+ .take(AMBIGUOUS_SHOWN)
+ .map(|row| row.slug.clone())
+ .collect();
+ return Some((Routing::Ambiguous(slugs), ranked));
+ }
+ if peers.len() == 1 {
+ return Some((Routing::Confident(peers[0].slug.clone()), ranked));
+ }
+ let slugs = peers.into_iter().map(|row| row.slug.clone()).collect();
+ Some((Routing::Group(slugs), ranked))
+}
+
+struct IdentityProfile {
+ slug: HashSet<String>,
+ tags: HashSet<String>,
+ desc: HashSet<String>,
+}
+
+impl IdentityProfile {
+ fn from_entry(entry: &xerj_common::hub::CatalogueEntry) -> Self {
+ let mut slug = HashSet::new();
+ let whole = entry.slug.to_ascii_lowercase();
+ if whole.len() >= IDENTITY_MIN_LEN {
+ slug.insert(whole);
+ }
+ for part in entry.slug.split(|c: char| !c.is_ascii_alphanumeric()) {
+ let part = part.to_ascii_lowercase();
+ if part.len() >= IDENTITY_MIN_LEN {
+ slug.insert(part);
+ }
+ }
+ let mut tags = HashSet::new();
+ for topic in &entry.topics {
+ tags.extend(identity_text_words(topic));
+ }
+ IdentityProfile {
+ slug,
+ tags,
+ desc: identity_text_words(&entry.ask_for),
+ }
+ }
+}
+
+fn identity_text_words(text: &str) -> HashSet<String> {
+ text.split(|c: char| !c.is_ascii_alphanumeric())
+ .filter(|word| word.len() >= IDENTITY_MIN_LEN)
+ .map(|word| word.to_ascii_lowercase())
+ .collect()
+}
+
+fn identity_query_tokens(question: &str) -> Vec<String> {
+ let lower = question.to_ascii_lowercase();
+ let mut out = Vec::new();
+ let mut seen = HashSet::new();
+ for word in lower.split(|c: char| !(c.is_ascii_alphanumeric() || matches!(c, '_' | '-' | '.')))
+ {
+ let word = word.trim_matches(|c| c == '.' || c == '-');
+ if word.len() < IDENTITY_MIN_LEN || is_identity_stopword(word) {
+ continue;
+ }
+ if seen.insert(word.to_string()) {
+ out.push(word.to_string());
}
}
+ out
+}
+
+fn distinctive(docs: usize, corpora: usize) -> bool {
+ let cap = ((DISTINCTIVE_FRACTION * corpora as f32).ceil() as usize).max(DISTINCTIVE_FLOOR);
+ docs > 0 && docs <= cap
+}
+
+fn is_language(word: &str) -> bool {
+ // Sorted. A language named in the description is the corpus's identity,
+ // the same way the slug is: "writing Swift" is not a generic word.
+ const LANGUAGES: &[&str] = &[
+ "bash",
+ "clojure",
+ "cpp",
+ "csharp",
+ "css",
+ "dart",
+ "elixir",
+ "elm",
+ "erlang",
+ "fortran",
+ "fsharp",
+ "golang",
+ "groovy",
+ "haskell",
+ "html",
+ "java",
+ "javascript",
+ "julia",
+ "kotlin",
+ "lisp",
+ "lua",
+ "nim",
+ "ocaml",
+ "perl",
+ "php",
+ "prolog",
+ "python",
+ "ruby",
+ "rust",
+ "scala",
+ "scheme",
+ "solidity",
+ "sql",
+ "swift",
+ "typescript",
+ "wasm",
+ "zig",
+ ];
+ LANGUAGES.binary_search(&word).is_ok()
+}
+
+fn is_identity_stopword(word: &str) -> bool {
+ // Sorted. Function words of a how-to question. Technical words (`async`,
+ // `let`, `map`, `result`, `type`) are not here: idf and the name-channel
+ // weight are what keep them from outvoting "Swift".
+ const STOP: &[&str] = &[
+ "about", "all", "also", "and", "any", "are", "but", "can", "could", "did", "does", "each",
+ "for", "from", "had", "has", "have", "how", "into", "its", "just", "may", "might", "more",
+ "most", "must", "not", "off", "only", "other", "our", "out", "over", "per", "same",
+ "shall", "should", "some", "such", "than", "that", "the", "their", "them", "then", "they",
+ "this", "too", "under", "use", "used", "using", "very", "via", "was", "were", "what",
+ "when", "where", "which", "who", "why", "will", "with", "would", "you", "your",
+ ];
+ STOP.binary_search(&word).is_ok()
}
/// The catalogue slugs `question` names as a whole word, case-insensitively,
@@ -898,4 +1202,109 @@ mod tests {
assert!(!toks.iter().any(|t| t == "a"));
assert!(!toks.iter().any(|t| t == "64"));
}
+
+ /// Every corpus's sketch reports every token of both Swift questions, which
+ /// is the failure mode of a saturated Bloom filter: the sketch ties
+ /// unrelated corpora with swift-book. The slug and the description still
+ /// name Swift, so those two are the group and the others are not.
+ #[test]
+ fn a_language_term_picks_its_corpora_despite_sketch_false_positives() {
+ const POISON: &[&str] = &[
+ "how", "use", "async", "let", "swift", "Swift", "result", "Result", "type", "map",
+ ];
+ let ask = [
+ (
+ "swift-book",
+ "An agent writing Swift queries this for The Swift Programming Language book: syntax and semantics of concurrency (async/await, async let, actors), generics, optionals, error handling and the language reference grammar.",
+ ),
+ (
+ "swift-evolution",
+ "An agent writing Swift queries this for the accepted Swift Evolution proposals (SE-NNNN): the motivation, exact semantics and API of language and standard-library features such as Result, async let, typed throws and macros.",
+ ),
+ (
+ "qwik",
+ "An agent minimising client JS queries this for Qwik's resumability model and code-splitting/lazy-loading of event handlers.",
+ ),
+ (
+ "docker-docs",
+ "An agent writing Dockerfiles and compose files queries this for the canonical Docker CLI, build and Compose reference docs.",
+ ),
+ (
+ "harper",
+ "An agent building a fast local grammar/style checker in Rust queries this for its rule engine, lint rules and curated dictionary (no cloud, no LLM).",
+ ),
+ (
+ "oss-review-toolkit",
+ "An agent building a dependency license-compliance pipeline (SBOM, policy, attribution) queries this for a production OSS Review Toolkit implementation.",
+ ),
+ ];
+ let cat = catalogue(
+ ask.into_iter()
+ .map(|(slug, ask_for)| {
+ let mut terms: Vec<String> = ask_for
+ .split(|c: char| !c.is_ascii_alphanumeric())
+ .filter(|w| w.len() >= 3)
+ .map(|w| w.to_ascii_lowercase())
+ .collect();
+ terms.extend(POISON.iter().map(|s| (*s).to_string()));
+ let mut e = entry(slug, &[], &[]);
+ e.ask_for = ask_for.to_string();
+ e.term_sketch = sketch::build(terms);
+ e
+ })
+ .collect(),
+ );
+ let proj = empty_project();
+ let group = |q| match route(q, proj.path(), &cat, None, &[]) {
+ Routing::Group(slugs) => slugs,
+ other => panic!("{q} expected a group, got {other:?}"),
+ };
+ assert_eq!(
+ group("how do I use async let in Swift"),
+ vec!["swift-book".to_string(), "swift-evolution".to_string()]
+ );
+ assert_eq!(
+ group("Swift Result type map"),
+ vec!["swift-evolution".to_string(), "swift-book".to_string()]
+ );
+
+ // An unrelated dependency must not steal a question that names Swift.
+ fs::write(
+ proj.path().join("Cargo.lock"),
+ "[[package]]\nname = \"zstd\"\nversion = \"1.0\"\n",
+ )
+ .unwrap();
+ let mut with_dep = cat.clone();
+ // The zstd corpus is not in this catalogue; the dependency only matters
+ // when a corpus lists it. Add one whose sketch is equally poisoned.
+ let mut zstd = entry("zstd", &["zstd"], &[]);
+ zstd.ask_for = "an agent tuning compression queries this for frame formats".to_string();
+ zstd.term_sketch = sketch::build(POISON.iter().map(|s| (*s).to_string()));
+ with_dep.corpora.push(zstd);
+ assert_eq!(
+ group_of("how do I use async let in Swift", &with_dep, proj.path()),
+ vec!["swift-book".to_string(), "swift-evolution".to_string()]
+ );
+ }
+
+ fn group_of(q: &str, cat: &Catalogue, cwd: &std::path::Path) -> Vec<String> {
+ match route(q, cwd, cat, None, &[]) {
+ Routing::Group(slugs) => slugs,
+ other => panic!("{q} expected a group, got {other:?}"),
+ }
+ }
+
+ #[test]
+ fn cap_ambiguous_keeps_the_best_few_in_order() {
+ let slugs: Vec<String> = (0..8).map(|i| format!("c{i}")).collect();
+ let capped = cap_ambiguous(Routing::Ambiguous(slugs.clone()));
+ assert_eq!(
+ capped,
+ Routing::Ambiguous(slugs.into_iter().take(AMBIGUOUS_SHOWN).collect())
+ );
+ assert_eq!(
+ cap_ambiguous(Routing::Confident("only".into())),
+ Routing::Confident("only".into())
+ );
+ }
}
diff --git a/engine/crates/xerj-hub/tests/fixtures/hub-catalogue-identity.jsonl b/engine/crates/xerj-hub/tests/fixtures/hub-catalogue-identity.jsonl
new file mode 100644
index 000000000..7e81b0a67
--- /dev/null
+++ b/engine/crates/xerj-hub/tests/fixtures/hub-catalogue-identity.jsonl
@@ -0,0 +1,468 @@
+{"slug":"12-factor-agents","domain":"AI","topics":[],"ask_for":"an agent builder queries this for the reliability and design principles of production LLM agents, the twelve factors","licence_class":"adapt-with-attribution"}
+{"slug":"18f-content-guide","domain":"WRITE","topics":[],"ask_for":"an agent writing plain-language content queries this for active-voice, concise-heading and inclusive-wording rules","licence_class":"adapt-with-attribution"}
+{"slug":"a11y-project-content","domain":"WRITE","topics":[],"ask_for":"An agent writing accessible UI copy and alt text queries this for The A11Y Project's accessibility checklist and plain-language accessibility articles.","licence_class":"adapt-with-attribution"}
+{"slug":"accord-legal-models","domain":"LAW","topics":[],"ask_for":"law","licence_class":"adapt-with-attribution"}
+{"slug":"act","domain":"OPS","topics":[],"ask_for":"An agent debugging or running GitHub Actions locally queries this for workflow-runner emulation and event/context handling.","licence_class":"adapt-with-attribution"}
+{"slug":"ada-2010","domain":"LAW","topics":[],"ask_for":"ADA 2010 Standards for Accessible Design: exact dimensional and technical requirements","licence_class":"adapt-with-attribution"}
+{"slug":"adalflow","domain":"AI","topics":[],"ask_for":"An agent building a trainable LLM pipeline queries this for prompt/parameter optimization and retriever-generator composition.","licence_class":"adapt-with-attribution"}
+{"slug":"adyen-openapi","domain":"API","topics":[],"ask_for":"An agent modeling payment APIs queries this for Adyen's OpenAPI definitions and payment-domain conventions.","licence_class":"adapt-with-attribution"}
+{"slug":"aeron","domain":"NET","topics":[],"ask_for":"an agent working on ultra-low-latency UDP/IPC messaging queries this for its log-buffer transport, flow control, and term-based framing","licence_class":"adapt-with-attribution"}
+{"slug":"age","domain":"CRYPTO","topics":[],"ask_for":"An agent working on a file-encryption tool or the age format queries this for the reference X25519 + ChaCha20-Poly1305 recipient/identity design and stanza format.","licence_class":"adapt-with-attribution"}
+{"slug":"agentbench","domain":"AI","topics":[],"ask_for":"An agent benchmarking agentic abilities queries this for multi-environment agent evaluation tasks.","licence_class":"adapt-with-attribution"}
+{"slug":"agentops","domain":"AI","topics":[],"ask_for":"An agent monitoring multi-step agent runs queries this for session replay, cost tracking, and per-step event instrumentation.","licence_class":"adapt-with-attribution"}
+{"slug":"agentscope","domain":"AI","topics":[],"ask_for":"An agent needing a robust, distributed multi-agent runtime queries this for message-passing and fault-tolerant orchestration.","licence_class":"adapt-with-attribution"}
+{"slug":"agno","domain":"AI","topics":[],"ask_for":"An agent builder wanting fast, model-agnostic agents queries this for multimodal agent plus tool/memory primitives.","licence_class":"adapt-with-attribution"}
+{"slug":"aider","domain":"AI","topics":[],"ask_for":"An agent editing a real git repo queries this for repo-map building, diff-based edits, and commit workflows.","licence_class":"adapt-with-attribution"}
+{"slug":"aiohttp","domain":"NET","topics":[],"ask_for":"an agent working on an async HTTP client/server stack queries this for streaming bodies, websocket upgrades, and connection reuse","licence_class":"adapt-with-attribution"}
+{"slug":"aioquic","domain":"NET","topics":[],"ask_for":"An agent learning QUIC/HTTP3 internals queries this for a readable implementation of packet parsing, the handshake, and QPACK header compression.","licence_class":"adapt-with-attribution"}
+{"slug":"alertmanager","domain":"OPS","topics":[],"ask_for":"An agent routing alerts queries this for Alertmanager grouping, inhibition, silencing and receiver/notification config.","licence_class":"adapt-with-attribution"}
+{"slug":"alex-inclusive-language","domain":"WRITE","topics":[],"ask_for":"An agent checking copy for insensitive or non-inclusive wording queries this for the terms to flag and their neutral replacements.","licence_class":"adapt-with-attribution"}
+{"slug":"ann-benchmarks","domain":"DB","topics":[],"ask_for":"An agent working on measuring ANN recall-vs-latency and comparing vector indexes queries this for ann-benchmarks' datasets, recall methodology and runner harness.","licence_class":"adapt-with-attribution"}
+{"slug":"annoy","domain":"DB","topics":[],"ask_for":"an agent working on read-mostly ANN queries this for the forest-of-trees build and on-disk format","licence_class":"adapt-with-attribution"}
+{"slug":"anthropic-cookbook","domain":"AI","topics":[],"ask_for":"An agent learning effective tool-use and RAG recipes queries this for runnable notebook patterns.","licence_class":"adapt-with-attribution"}
+{"slug":"anything-llm","domain":"AI","topics":[],"ask_for":"An agent packaged as a desktop/server RAG app queries this for workspace, embed, and connector patterns.","licence_class":"adapt-with-attribution"}
+{"slug":"api-blueprint","domain":"API","topics":[],"ask_for":"An agent designing a human-readable API description format queries this for the API Blueprint markdown resource/action grammar and MSON.","licence_class":"adapt-with-attribution"}
+{"slug":"api-common-protos","domain":"API","topics":[],"ask_for":"An agent adding HTTP/gRPC annotations, field_behavior or resource names to protobuf APIs queries this for Google's common API proto types (google.api.*).","licence_class":"adapt-with-attribution"}
+{"slug":"api-linter","domain":"API","topics":[],"ask_for":"An agent enforcing resource-oriented API conventions queries this for how AIP rules are implemented as lint checks over protobuf.","licence_class":"adapt-with-attribution"}
+{"slug":"arazzo-spec","domain":"API","topics":[],"ask_for":"An agent orchestrating multi-call API workflows queries this for the Arazzo Specification, which describes deterministic sequences and dependencies across OpenAPI operations.","licence_class":"adapt-with-attribution"}
+{"slug":"argo-cd","domain":"OPS","topics":[],"ask_for":"An agent building GitOps delivery queries this for declarative continuous deployment, sync waves/hooks and drift detection.","licence_class":"adapt-with-attribution"}
+{"slug":"argo-workflows","domain":"OPS","topics":[],"ask_for":"An agent orchestrating pipelines on Kubernetes queries this for DAG/step workflow specs, artifacts, retries and the workflow controller.","licence_class":"adapt-with-attribution"}
+{"slug":"aria-practices","domain":"WEB","topics":[],"ask_for":"An agent building an accessible widget queries this ARIA Authoring Practices Guide for the canonical keyboard-interaction and ARIA patterns per component.","licence_class":"adapt-with-attribution"}
+{"slug":"arkworks-algebra","domain":"CRYPTO","topics":[],"ask_for":"An agent building ZK proof systems queries this for arkworks' finite-field, elliptic-curve and polynomial arithmetic traits.","licence_class":"adapt-with-attribution"}
+{"slug":"arrow-rs","domain":"DB","topics":[],"ask_for":"an agent working on columnar memory queries this for the Rust arrow arrays, kernels and IPC paths","licence_class":"adapt-with-attribution"}
+{"slug":"arroyo","domain":"DB","topics":[],"ask_for":"an agent working on SQL stream processing with windowing queries this for a Rust engine's state backends and exactly-once checkpoints","licence_class":"adapt-with-attribution"}
+{"slug":"astro","domain":"WEB","topics":[],"ask_for":"An agent building a content/SSG framework queries this for Astro's islands architecture, partial hydration and content collections.","licence_class":"adapt-with-attribution"}
+{"slug":"astro-docs","domain":"WEB","topics":[],"ask_for":"An agent building content-driven sites with islands/SSR queries this for the Astro documentation.","licence_class":"adapt-with-attribution"}
+{"slug":"asyncapi-bindings","domain":"API","topics":[],"ask_for":"An agent describing protocol-specific channel/operation details in AsyncAPI queries this for the per-protocol binding schemas.","licence_class":"adapt-with-attribution"}
+{"slug":"asyncapi-spec","domain":"API","topics":[],"ask_for":"An agent working on event-driven or message-based API definitions queries this for the AsyncAPI specification's document structure, protocol bindings (Kafka/MQTT/AMQP/WebSocket), and message schema semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"asyncapi-spec-json-schemas","domain":"API","topics":[],"ask_for":"An agent machine-validating AsyncAPI documents queries this for the JSON Schema definitions of every AsyncAPI version.","licence_class":"adapt-with-attribution"}
+{"slug":"asyncapi-studio","domain":"API","topics":[],"ask_for":"An agent building a visual editor/validator for AsyncAPI documents queries this for Studio's parsing, validation and example documents.","licence_class":"adapt-with-attribution"}
+{"slug":"atomic-agents","domain":"AI","topics":[],"ask_for":"An agent composed from small reusable blocks queries this for a schema-driven, modular agent architecture.","licence_class":"adapt-with-attribution"}
+{"slug":"attack-flow","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"attack-mappings-explorer","domain":"SEC","topics":[],"ask_for":"An agent correlating controls to adversary behavior queries this for CTID mappings of ATT&CK techniques to NIST 800-53, CIS, Azure/AWS/GCP security controls.","licence_class":"adapt-with-attribution"}
+{"slug":"autogen","domain":"AI","topics":[],"ask_for":"An agent built from conversational multi-agent groups queries this for event-driven agent-to-agent messaging patterns.","licence_class":"adapt-with-attribution"}
+{"slug":"autorag","domain":"AI","topics":[],"ask_for":"An agent tuning a RAG pipeline queries this for automated evaluation/optimization across retriever+generator component combinations.","licence_class":"adapt-with-attribution"}
+{"slug":"avro","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"awesome-ai-system-prompts","domain":"AI","topics":[],"ask_for":"an agent designing a system prompt queries this for how frontier tools (ChatGPT, Claude, Cursor, v0) are actually system-prompted, with annotated patterns","licence_class":"adapt-with-attribution"}
+{"slug":"awesome-llm-apps","domain":"AI","topics":[],"ask_for":"An agent looking for end-to-end example apps queries this for a large catalog of RAG/agent app implementations with code.","licence_class":"adapt-with-attribution"}
+{"slug":"awesome-mcp-servers","domain":"AI","topics":[],"ask_for":"an agent wiring up MCP queries this for which server exists for a capability or integration and where to get it","licence_class":"adapt-with-attribution"}
+{"slug":"awesome-sre","domain":"OPS","topics":[],"ask_for":"An agent researching reliability tooling and practice queries this curated index for pointers to SRE, observability, and production-engineering resources.","licence_class":"adapt-with-attribution"}
+{"slug":"axe-core","domain":"WEB","topics":[],"ask_for":"An agent writing automated accessibility checks queries this for axe's rule set and how each WCAG/ARIA violation is actually detected in the DOM.","licence_class":"adapt-with-attribution"}
+{"slug":"axolotl","domain":"AI","topics":[],"ask_for":"An agent fine-tuning open LLMs queries this for YAML-config SFT/LoRA/QLoRA training recipes.","licence_class":"adapt-with-attribution"}
+{"slug":"badger","domain":"DB","topics":[],"ask_for":"an agent working on pure-Go KV stores queries this for its LSM-with-value-log design and transaction implementation","licence_class":"adapt-with-attribution"}
+{"slug":"bandit-plugins","domain":"SEC","topics":[],"ask_for":"An agent writing a Python SAST or secure-coding linter queries this for Bandit's plugin checks (AST patterns for injection, weak crypto, insecure deserialization, hardcoded secrets).","licence_class":"adapt-with-attribution"}
+{"slug":"bebop","domain":"NET","topics":[],"ask_for":"an agent working on a schema-based binary wire format queries this for compiled encoders/decoders and compact record layout","licence_class":"adapt-with-attribution"}
+{"slug":"biome","domain":"WEB","topics":[],"ask_for":"A Rust agent building a formatter/linter queries this for Biome's Rust lossless syntax tree (Rowan-style), formatter IR and lint-rule engine.","licence_class":"adapt-with-attribution"}
+{"slug":"blake2","domain":"CRYPTO","topics":[],"ask_for":"an agent working on a BLAKE2b/2s/2x hash or keyed MAC queries this for the reference and SSE/AVX-optimized implementations","licence_class":"adapt-with-attribution"}
+{"slug":"blake3","domain":"CRYPTO","topics":[],"ask_for":"An agent implementing fast cryptographic hashing or content-addressed digests queries this for the BLAKE3 tree-hash construction, SIMD lanes, and keyed/derive-key modes.","licence_class":"adapt-with-attribution"}
+{"slug":"bleve","domain":"DB","topics":[],"ask_for":"An agent working on an embeddable full-text index with pluggable storage queries this for Bleve's analysis pipeline, index mapping and scorch segment format in Go.","licence_class":"adapt-with-attribution"}
+{"slug":"blst","domain":"CRYPTO","topics":[],"ask_for":"An agent implementing BLS12-381 signatures queries this for supranational's assembly-optimised pairings and signature aggregation.","licence_class":"adapt-with-attribution"}
+{"slug":"bluge","domain":"DB","topics":[],"ask_for":"An agent working on a segment-based full-text library decoupled from document storage queries this for Bluge's reader/writer and segment design.","licence_class":"adapt-with-attribution"}
+{"slug":"bookkeeper","domain":"DB","topics":[],"ask_for":"An agent working on a replicated write-ahead log / ledger storage layer queries this for BookKeeper's ledger, ensemble and journal/entry-log design.","licence_class":"adapt-with-attribution"}
+{"slug":"boringtun","domain":"CRYPTO","topics":[],"ask_for":"an agent implementing a VPN data plane queries this for the wireguard protocol implementation and its async runtime use","licence_class":"adapt-with-attribution"}
+{"slug":"borsh-rs","domain":"NET","topics":[],"ask_for":"An agent needing deterministic binary serialization queries this for a canonical, spec-defined byte layout suited to hashing and consensus.","licence_class":"adapt-with-attribution"}
+{"slug":"botan","domain":"CRYPTO","topics":[],"ask_for":"An agent needing a broad C++ crypto toolkit queries this for Botan's cipher/public-key/TLS implementations and constant-time utilities.","licence_class":"adapt-with-attribution"}
+{"slug":"boulder","domain":"CRYPTO","topics":[],"ask_for":"an agent working on an ACME certificate authority queries this for Let's Encrypt's issuance pipeline, validation and rate-limit design","licence_class":"adapt-with-attribution"}
+{"slug":"box-openapi","domain":"API","topics":[],"ask_for":"An agent modelling a content/file-management REST API with explicit API versioning queries this for Box's versioned OpenAPI 3.0 definition.","licence_class":"adapt-with-attribution"}
+{"slug":"brex-prompt-engineering","domain":"AI","topics":[],"ask_for":"An agent writing or refining LLM prompts queries this for Brex's battle-tested prompt-engineering patterns, anti-patterns, and reasoning techniques in plain prose.","licence_class":"adapt-with-attribution"}
+{"slug":"brotli","domain":"NET","topics":[],"ask_for":"an agent working on web content encoding queries this for the static dictionary and transform handling","licence_class":"adapt-with-attribution"}
+{"slug":"brpc","domain":"NET","topics":[],"ask_for":"an agent working on an industrial C++ RPC framework queries this for multi-protocol server design, load balancing, and bthread concurrency","licence_class":"adapt-with-attribution"}
+{"slug":"bson-rust","domain":"NET","topics":[],"ask_for":"An agent implementing BSON queries this for document encoding, type markers, and the length-prefixed field layout.","licence_class":"adapt-with-attribution"}
+{"slug":"btrblocks","domain":"DB","topics":[],"ask_for":"an agent working on columnar compression schemes queries this for the BtrBlocks cascading-encoding research implementation","licence_class":"adapt-with-attribution"}
+{"slug":"buf","domain":"API","topics":[],"ask_for":"An agent managing protobuf schemas (lint, breaking-change detection, build, deps) queries this for Buf's module model and rule sets.","licence_class":"adapt-with-attribution"}
+{"slug":"buildpacks-pack","domain":"OPS","topics":[],"ask_for":"An agent building images without Dockerfiles queries this for the Cloud Native Buildpacks lifecycle and the pack CLI.","licence_class":"adapt-with-attribution"}
+{"slug":"bulletproofs","domain":"CRYPTO","topics":[],"ask_for":"An agent implementing range proofs or inner-product arguments queries this for the dalek Bulletproofs implementation.","licence_class":"adapt-with-attribution"}
+{"slug":"c-ares","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"caddy","domain":"NET","topics":[],"ask_for":"an agent building a TLS-serving reverse proxy queries this for cert automation and config-reload design","licence_class":"adapt-with-attribution"}
+{"slug":"calcite","domain":"DB","topics":[],"ask_for":"An agent working on SQL parsing, relational algebra and cost-based optimization queries this for Calcite's RelNode algebra, planner rules and optimizer framework.","licence_class":"adapt-with-attribution"}
+{"slug":"caldera","domain":"SEC","topics":[],"ask_for":"an agent automating red-team operations queries this for MITRE Caldera ability definitions, adversary profiles and planners.","licence_class":"adapt-with-attribution"}
+{"slug":"caldera-stockpile","domain":"SEC","topics":[],"ask_for":"An agent modeling automated adversary behavior queries this for MITRE CALDERA abilities, adversary profiles and planners (ATT&CK-mapped command definitions).","licence_class":"adapt-with-attribution"}
+{"slug":"caliber-ehr-phenotypes","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"camel","domain":"AI","topics":[],"ask_for":"An agent studying role-playing multi-agent societies queries this for cooperative agent communication patterns.","licence_class":"adapt-with-attribution"}
+{"slug":"candle","domain":"AI","topics":[],"ask_for":"A Rust engine adding embeddings/model inference queries this for a minimalist Rust tensor/ML framework and model implementations.","licence_class":"adapt-with-attribution"}
+{"slug":"caniuse","domain":"WEB","topics":[],"ask_for":"an agent targeting cross-browser features queries this for per-feature browser-version support data, notes, and known bugs.","licence_class":"adapt-with-attribution"}
+{"slug":"cap-examples","domain":"LAW","topics":[],"ask_for":"An agent working with U.S. case-law bulk data queries this for worked examples (bulk extract, full-text search, ngrams) of using the Harvard Caselaw Access Project dataset.","licence_class":"adapt-with-attribution"}
+{"slug":"capa-rules","domain":"SEC","topics":[],"ask_for":"an agent triaging a binary queries this for capa's rules mapping code features to malware capabilities and ATT&CK techniques.","licence_class":"adapt-with-attribution"}
+{"slug":"capnproto","domain":"NET","topics":[],"ask_for":"an agent doing capability RPC queries this for the serialisation layout, promise pipelining and the security hardening history","licence_class":"adapt-with-attribution"}
+{"slug":"carbon","domain":"WEB","topics":[],"ask_for":"An agent building against IBM's design system queries this for Carbon component APIs, design tokens and accessibility/content guidance.","licence_class":"adapt-with-attribution"}
+{"slug":"cassandra","domain":"DB","topics":[],"ask_for":"An agent working on LSM wide-column storage, SSTables and compaction strategies queries this for Cassandra's storage-engine and gossip distribution model.","licence_class":"adapt-with-attribution"}
+{"slug":"catala-law-lang","domain":"LAW","topics":[],"ask_for":"An agent translating statutes/tax law into executable, auditable code queries this for a law-oriented DSL and worked legislative examples.","licence_class":"adapt-with-attribution"}
+{"slug":"cdc-clinical","domain":"HEALTH","topics":[],"ask_for":"a clinician or medical writer queries this for the current CDC-recommended STI regimen and dose, and measles clinical signs","licence_class":"adapt-with-attribution"}
+{"slug":"cdk8s","domain":"OPS","topics":[],"ask_for":"An agent generating Kubernetes manifests from code queries this for construct/synthesis patterns and typed-API usage.","licence_class":"adapt-with-attribution"}
+{"slug":"cel-spec","domain":"API","topics":[],"ask_for":"An agent adding an expression language for API policy/validation queries this for the Common Expression Language grammar and semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"cell-ontology","domain":"HEALTH","topics":[],"ask_for":"An agent labeling cell types in pathology/histology/immunology pipelines queries this for the Cell Ontology (CL) of in-vivo cell types.","licence_class":"adapt-with-attribution"}
+{"slug":"cereal","domain":"NET","topics":[],"ask_for":"an agent working on a header-only C++ serialization library queries this for archive abstractions over binary/JSON/XML","licence_class":"adapt-with-attribution"}
+{"slug":"cert-manager","domain":"CRYPTO","topics":[],"ask_for":"An agent automating certificates in Kubernetes queries this for cert-manager's issuer/certificate CRDs and ACME controller.","licence_class":"adapt-with-attribution"}
+{"slug":"certmagic","domain":"CRYPTO","topics":[],"ask_for":"an agent working on automatic HTTPS in a Go service queries this for CertMagic's on-demand issuance, renewal and storage abstraction","licence_class":"adapt-with-attribution"}
+{"slug":"certstrap","domain":"CRYPTO","topics":[],"ask_for":"An agent bootstrapping a simple internal CA queries this for Square's certstrap CA/certificate generation CLI.","licence_class":"adapt-with-attribution"}
+{"slug":"cfn-nag","domain":"SEC","topics":[],"ask_for":"an agent reviewing CloudFormation templates queries this for cfn_nag's Ruby rule definitions that flag insecure AWS resource configuration.","licence_class":"adapt-with-attribution"}
+{"slug":"cfssl","domain":"CRYPTO","topics":[],"ask_for":"An agent building a PKI/CA service queries this for Cloudflare's CFSSL certificate signing, bundling and OCSP tooling.","licence_class":"adapt-with-attribution"}
+{"slug":"chamber","domain":"CRYPTO","topics":[],"ask_for":"An agent managing secrets via AWS SSM Parameter Store queries this for Chamber's parameter-store-backed CLI.","licence_class":"adapt-with-attribution"}
+{"slug":"chaos-mesh","domain":"OPS","topics":[],"ask_for":"An agent doing chaos engineering on Kubernetes queries this for Chaos Mesh fault-injection CRDs (pod/network/IO/time faults).","licence_class":"adapt-with-attribution"}
+{"slug":"chaostoolkit-docs","domain":"OPS","topics":[],"ask_for":"An agent designing chaos-engineering experiments queries this for the experiment format, probe/action API, and reliability-testing workflow.","licence_class":"adapt-with-attribution"}
+{"slug":"chatdoctor","domain":"HEALTH","topics":[],"ask_for":"An agent building a patient-facing medical chat assistant queries this for 100k+ real doctor-patient dialogues (HealthCareMagic/iCliniq) and the fine-tuning recipe.","licence_class":"adapt-with-attribution"}
+{"slug":"chdb","domain":"DB","topics":[],"ask_for":"An agent working on embedding an OLAP engine in-process with no server queries this for chDB's approach to embedding ClickHouse as a library.","licence_class":"adapt-with-attribution"}
+{"slug":"checkov","domain":"SEC","topics":[],"ask_for":"an agent scanning infrastructure-as-code queries this for Checkov's Python/YAML policy checks across Terraform, CloudFormation and Kubernetes.","licence_class":"adapt-with-attribution"}
+{"slug":"choosealicense-data","domain":"LAW","topics":[],"ask_for":"An agent building a license picker or classifying a project's license queries this for structured per-license metadata (permissions/conditions/limitations) and the chooser decision rules behind choosealicense.com.","licence_class":"adapt-with-attribution"}
+{"slug":"chroma","domain":"DB","topics":[],"ask_for":"DB","licence_class":"adapt-with-attribution"}
+{"slug":"chronicle-detection-rules","domain":"SEC","topics":[],"ask_for":"an agent building Google SecOps content queries this for community YARA-L detection rules and dashboard templates.","licence_class":"adapt-with-attribution"}
+{"slug":"cicero-contract-templates","domain":"LAW","topics":[],"ask_for":"law","licence_class":"adapt-with-attribution"}
+{"slug":"circl","domain":"CRYPTO","topics":[],"ask_for":"An agent working on modern or post-quantum crypto queries this for Cloudflare CIRCL's Go implementations of X25519/X448, hash-to-curve, BLS, Kyber/Dilithium and HPKE.","licence_class":"adapt-with-attribution"}
+{"slug":"cisa","domain":"SEC","topics":[],"ask_for":"One CISA corpus: advisories and the Known Exploited Vulnerabilities catalog together. An agent answering 'is this CVE exploited in the wild, and what do the mitigations say' queries one index.","licence_class":"adapt-with-attribution"}
+{"slug":"clipboard-apis","domain":"WEB","topics":[],"ask_for":"An agent implementing copy/paste queries this for the Clipboard API's read/write model, formats and permission/transient-activation gating.","licence_class":"adapt-with-attribution"}
+{"slug":"cloud-custodian","domain":"SEC","topics":[],"ask_for":"an agent codifying cloud guardrails queries this for Cloud Custodian's YAML policy filters/actions across AWS, Azure and GCP.","licence_class":"adapt-with-attribution"}
+{"slug":"cloudevents-spec","domain":"API","topics":[],"ask_for":"An agent working on event interchange between services queries this for the CloudEvents envelope format and its HTTP, Kafka, AMQP, and MQTT protocol bindings.","licence_class":"adapt-with-attribution"}
+{"slug":"cloudnative-pg","domain":"OPS","topics":[],"ask_for":"An agent running PostgreSQL on Kubernetes queries this for the operator's failover, backup, and rolling-update logic.","licence_class":"adapt-with-attribution"}
+{"slug":"cluster-api","domain":"OPS","topics":[],"ask_for":"An agent provisioning clusters declaratively queries this for the Cluster API machine/infrastructure provider model and lifecycle controllers.","licence_class":"adapt-with-attribution"}
+{"slug":"cognita","domain":"AI","topics":[],"ask_for":"An agent productionising modular RAG queries this for a config-driven framework with pluggable components.","licence_class":"adapt-with-attribution"}
+{"slug":"commonaccord-legal-docs","domain":"LAW","topics":[],"ask_for":"law","licence_class":"adapt-with-attribution"}
+{"slug":"commonpaper-contracts","domain":"LAW","topics":[],"ask_for":"law","licence_class":"adapt-with-attribution"}
+{"slug":"complianceascode-content","domain":"LAW","topics":[],"ask_for":"An agent mapping security controls to regulations (STIG/CIS/800-53) queries this for machine-readable hardening content and regulatory crosswalks.","licence_class":"adapt-with-attribution"}
+{"slug":"compose-spec","domain":"OPS","topics":[],"ask_for":"An agent parsing or generating Compose files queries this for the authoritative Compose file schema and semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"congress-legislators","domain":"LAW","topics":[],"ask_for":"An agent resolving U.S. lawmakers, committees, or bill sponsors queries this for the CC0 dataset of current and historical members of Congress with cross-walk IDs and terms.","licence_class":"adapt-with-attribution"}
+{"slug":"connect-go","domain":"NET","topics":[],"ask_for":"An agent building an RPC protocol queries this for the Connect/gRPC/gRPC-Web wire semantics and unary/streaming handler design.","licence_class":"adapt-with-attribution"}
+{"slug":"connect-protocol","domain":"API","topics":[],"ask_for":"An agent implementing a protobuf RPC protocol over HTTP/1.1 and HTTP/2 with gRPC compatibility queries this for the Connect protocol specification and docs.","licence_class":"adapt-with-attribution"}
+{"slug":"containerd","domain":"OPS","topics":[],"ask_for":"An agent operating a container runtime queries this for containerd's image/snapshot/task management and CRI implementation.","licence_class":"adapt-with-attribution"}
+{"slug":"controlflow","domain":"AI","topics":[],"ask_for":"An agent embedding LLM steps inside deterministic workflows queries this for task-centric orchestration built on Prefect.","licence_class":"adapt-with-attribution"}
+{"slug":"conventional-commits","domain":"WRITE","topics":[],"ask_for":"An agent writing or validating commit messages queries this for the Conventional Commits specification (types, scopes, breaking-change wording) in many languages.","licence_class":"adapt-with-attribution"}
+{"slug":"coredns","domain":"NET","topics":[],"ask_for":"an agent working on a plugin-based DNS server queries this for the middleware chain and zone/record handling","licence_class":"adapt-with-attribution"}
+{"slug":"coroot","domain":"OPS","topics":[],"ask_for":"An agent building zero-instrumentation observability queries this for eBPF-based metric/trace capture and SLO/health inference.","licence_class":"adapt-with-attribution"}
+{"slug":"courts-db","domain":"LAW","topics":[],"ask_for":"An agent resolving or disambiguating U.S. court names queries this for the structured database of courts, jurisdictions, date ranges, and name variants.","licence_class":"adapt-with-attribution"}
+{"slug":"covid-qa","domain":"HEALTH","topics":[],"ask_for":"An agent building COVID-19 scientific-document QA queries this for ~2k SQuAD-style question-answer pairs annotated over CORD-19 articles.","licence_class":"adapt-with-attribution"}
+{"slug":"cozo","domain":"DB","topics":[],"ask_for":"an agent working on an embeddable multi-model store queries this for relational-plus-graph-plus-vector (Datalog) query evaluation in Rust","licence_class":"adapt-with-attribution"}
+{"slug":"cri-o","domain":"OPS","topics":[],"ask_for":"An agent running a Kubernetes-dedicated container runtime queries this for CRI-O's CRI implementation and OCI integration.","licence_class":"adapt-with-attribution"}
+{"slug":"crossplane","domain":"OPS","topics":[],"ask_for":"An agent building control-plane IaC queries this for Crossplane compositions, provider resources and reconciliation.","licence_class":"adapt-with-attribution"}
+{"slug":"csp","domain":"WEB","topics":[],"ask_for":"An agent hardening a web surface queries this for Content Security Policy directive grammar, source-list matching and nonce/hash enforcement.","licence_class":"adapt-with-attribution"}
+{"slug":"css-tree","domain":"WEB","topics":[],"ask_for":"An agent parsing/validating CSS queries this for csstree's fast CSS tokenizer, AST, selector parsing and value-syntax matching.","licence_class":"adapt-with-attribution"}
+{"slug":"ctakes","domain":"HEALTH","topics":[],"ask_for":"An agent extracting concepts from clinical notes queries this for Apache cTAKES pipelines: section detection, negation/context, and UMLS dictionary lookup.","licence_class":"adapt-with-attribution"}
+{"slug":"cue","domain":"OPS","topics":[],"ask_for":"An agent validating or generating configuration queries this for CUE's type/constraint model and schema unification.","licence_class":"adapt-with-attribution"}
+{"slug":"curl-src","domain":"NET","topics":[],"ask_for":"an agent writing an HTTP client queries this for protocol handling, auth negotiation and the protocol-selection seams","licence_class":"adapt-with-attribution"}
+{"slug":"curve25519-dalek","domain":"CRYPTO","topics":[],"ask_for":"An agent working on elliptic-curve or signature crypto in Rust queries this for the dalek curve25519/ed25519/x25519 field-arithmetic and group-operation code.","licence_class":"adapt-with-attribution"}
+{"slug":"cyclonedx-spec","domain":"SEC","topics":[],"ask_for":"an agent producing SBOMs queries this for the CycloneDX JSON/XML schema and field semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"dagger","domain":"OPS","topics":[],"ask_for":"An agent writing portable CI pipelines queries this for Dagger's programmable container-based pipeline engine and caching.","licence_class":"adapt-with-attribution"}
+{"slug":"dailymed","domain":"HEALTH","topics":[],"ask_for":"an agent answering medication questions queries this for what the FDA-approved label actually says — indications, do-not-crush/dose-form rules, epidural-timing windows before/after anticoagulants, nitrate co-administration intervals, intraoperative floppy iris warnings (demand: patient-safety medication questions; 28k records over the current SPL set)","licence_class":"adapt-with-attribution"}
+{"slug":"datafusion","domain":"DB","topics":[],"ask_for":"DB","licence_class":"adapt-with-attribution"}
+{"slug":"datasketches-cpp","domain":"DB","topics":[],"ask_for":"An agent working on approximate aggregations (distinct-count, quantiles, frequent-items) queries this for DataSketches' HLL, CPC, KLL and Theta sketch algorithms.","licence_class":"adapt-with-attribution"}
+{"slug":"deepeval","domain":"AI","topics":[],"ask_for":"An agent unit-testing LLM outputs queries this for pytest-style LLM metrics and assertions.","licence_class":"adapt-with-attribution"}
+{"slug":"delta-rs","domain":"DB","topics":[],"ask_for":"An agent working on a transactional table format (ACID over object storage) queries this for delta-rs's transaction log, snapshot isolation and parquet-file management in Rust.","licence_class":"adapt-with-attribution"}
+{"slug":"density","domain":"NET","topics":[],"ask_for":"An agent implementing a very fast byte-oriented compressor queries this for the Chameleon/Cheetah/Lion kernels and streaming API design.","licence_class":"adapt-with-attribution"}
+{"slug":"dgraph","domain":"DB","topics":[],"ask_for":"An agent working on a distributed graph database with a sharded posting-list store queries this for Dgraph's predicate-sharded storage and query execution in Go.","licence_class":"adapt-with-attribution"}
+{"slug":"digitalocean-openapi","domain":"API","topics":[],"ask_for":"An agent modelling a cloud-provider control-plane REST API queries this for DigitalOcean's OpenAPI structure, $refs and bundling setup.","licence_class":"adapt-with-attribution"}
+{"slug":"diskann","domain":"DB","topics":[],"ask_for":"An agent working on disk-resident billion-scale ANN queries this for DiskANN's Vamana graph build, PQ compression and SSD-aware search.","licence_class":"adapt-with-attribution"}
+{"slug":"dispatch","domain":"OPS","topics":[],"ask_for":"An agent building incident-response tooling queries this for Netflix Dispatch's incident workflow, roles and integrations.","licence_class":"adapt-with-attribution"}
+{"slug":"distilabel","domain":"AI","topics":[],"ask_for":"An agent building synthetic training data queries this for pipeline-based data generation and AI-feedback labeling.","licence_class":"adapt-with-attribution"}
+{"slug":"dnscrypt-proxy","domain":"NET","topics":[],"ask_for":"an agent working on encrypted DNS (DNSCrypt/DoH) queries this for protocol framing and resolver forwarding","licence_class":"adapt-with-attribution"}
+{"slug":"docassemble","domain":"LAW","topics":[],"ask_for":"An agent building guided legal interviews and automated document assembly queries this for a mature open-source document-automation platform.","licence_class":"adapt-with-attribution"}
+{"slug":"docker-docs","domain":"OPS","topics":[],"ask_for":"An agent writing Dockerfiles and compose files queries this for the canonical Docker CLI, build and Compose reference docs.","licence_class":"adapt-with-attribution"}
+{"slug":"dragonboat","domain":"DB","topics":[],"ask_for":"an agent implementing multi-raft queries this for the sharded log and snapshot plumbing","licence_class":"adapt-with-attribution"}
+{"slug":"drpc","domain":"NET","topics":[],"ask_for":"An agent designing a lightweight RPC transport queries this for a minimal stream-multiplexed protocol and codegen that avoids HTTP/2.","licence_class":"adapt-with-attribution"}
+{"slug":"dspy","domain":"AI","topics":[],"ask_for":"An agent building a prompt-optimization or declarative LLM-program pipeline queries this for DSPy's signatures, modules, and optimizers (compile-prompts-from-metrics).","licence_class":"adapt-with-attribution"}
+{"slug":"duckdb","domain":"DB","topics":[],"ask_for":"an agent working on query execution queries this for how a real embeddable OLAP engine does join ordering, expression rewrites and memory-aware operators","licence_class":"adapt-with-attribution"}
+{"slug":"dwyl-english-words","domain":"WRITE","topics":[],"ask_for":"An agent needing a plain English word corpus (validation, vocabulary, autocomplete) queries this for ~470k English words as text/JSON.","licence_class":"adapt-with-attribution"}
+{"slug":"ecfr-title-12","domain":"LAW","topics":[],"ask_for":"an agent answering consumer-credit or mortgage questions queries this for what Regulation Z / TILA actually says — higher-priced APR triggers, ability-to-repay/QM, rescission windows, card late-fee safe harbors (demand: consumer-finance Ask-HN volume 71)","licence_class":"adapt-with-attribution"}
+{"slug":"ecfr-title-14","domain":"LAW","topics":[],"ask_for":"a pilot or mechanic queries this for the current FAR text — visibility minimums, transponder airspace, inspection intervals, right-of-way","licence_class":"adapt-with-attribution"}
+{"slug":"ecfr-title-26","domain":"LAW","topics":[],"ask_for":"an agent answering federal tax questions queries this for what the Treasury regulations actually say — de minimis safe harbor, estimated-tax safe harbor, home-office exclusive use (demand: tax Ask-HN volume 40)","licence_class":"adapt-with-attribution"}
+{"slug":"ecfr-title-29","domain":"LAW","topics":[],"ask_for":"an agent answering workplace/employment questions queries this for what 29 CFR actually says — OSHA guardrail height, FMLA 12-month/1250-hour eligibility, FLSA overtime, youth-employment hours (demand: employment-HR Ask-HN volume 57)","licence_class":"adapt-with-attribution"}
+{"slug":"ecma262","domain":"WEB","topics":[],"ask_for":"an agent building a JS-adjacent tool queries this for the spec's abstract operations and completion-record semantics","licence_class":"adapt-with-attribution"}
+{"slug":"edliz-zimbabwe-treatment-guidelines","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"approach-only"}
+{"slug":"ell","domain":"AI","topics":[],"ask_for":"An agent treating prompts as versioned functions queries this for the language-model-programs model with autosave/versioning and visualization.","licence_class":"adapt-with-attribution"}
+{"slug":"emp-tool","domain":"CRYPTO","topics":[],"ask_for":"An agent building secure two-party/MPC computation queries this for the EMP-toolkit garbled-circuit and oblivious-transfer primitives.","licence_class":"adapt-with-attribution"}
+{"slug":"enet","domain":"NET","topics":[],"ask_for":"an agent working on reliable UDP for games queries this for packet sequencing, channels, and connection management","licence_class":"adapt-with-attribution"}
+{"slug":"envoy","domain":"NET","topics":[],"ask_for":"an agent building a data plane queries this for filter-chain, xDS and overload-manager internals","licence_class":"adapt-with-attribution"}
+{"slug":"errata-ai-readability-vale","domain":"WRITE","topics":[],"ask_for":"An agent building prose-linting or readability features queries this Vale style for how to encode Flesch-Kincaid/Gunning-Fog/SMOG metrics as lint rules.","licence_class":"adapt-with-attribution"}
+{"slug":"esbuild","domain":"WEB","topics":[],"ask_for":"An agent building a fast JS/TS bundler queries this for esbuild's parser, scope/linker design and tree-shaking - a reference for speed-oriented bundling.","licence_class":"adapt-with-attribution"}
+{"slug":"eset-malware-ioc","domain":"SEC","topics":[],"ask_for":"An agent operationalizing threat-research output queries this for ESET investigation IOCs — YARA (.yar), Snort (.rules) and sample-hash lists tied to named campaigns.","licence_class":"adapt-with-attribution"}
+{"slug":"etcd-docs","domain":"OPS","topics":[],"ask_for":"an agent operating a distributed system queries this for etcd's failure/restore/compaction semantics and tuning guides","licence_class":"adapt-with-attribution"}
+{"slug":"etcd-src","domain":"DB","topics":[],"ask_for":"an agent working on coordination stores queries this for raft integration, watch semantics and backend compaction","licence_class":"adapt-with-attribution"}
+{"slug":"etherparse","domain":"NET","topics":[],"ask_for":"an agent working on packet classification queries this for zero-copy Ethernet/IPv4/IPv6/TCP/UDP header parsing and construction","licence_class":"adapt-with-attribution"}
+{"slug":"eurlex-core","domain":"LAW","topics":[],"ask_for":"GDPR / AI Act / DSA / DMA / NIS2 article and recital text","licence_class":"adapt-with-attribution"}
+{"slug":"external-secrets","domain":"CRYPTO","topics":[],"ask_for":"An agent syncing secrets from cloud vaults into Kubernetes queries this for the External Secrets Operator's provider abstraction.","licence_class":"adapt-with-attribution"}
+{"slug":"eyecite","domain":"LAW","topics":[],"ask_for":"An agent extracting legal citations from judicial text queries this for a battle-tested citation-recognition/resolution implementation run across millions of opinions.","licence_class":"adapt-with-attribution"}
+{"slug":"fabric","domain":"AI","topics":[],"ask_for":"An agent building a reusable prompt library queries this for battle-tested, task-specific prompt patterns and their markdown structure.","licence_class":"adapt-with-attribution"}
+{"slug":"faiss","domain":"DB","topics":[],"ask_for":"an agent working on ANN queries this for index construction, IVF/HNSW composition and GPU paths in the reference implementation","licence_class":"adapt-with-attribution"}
+{"slug":"falco-rules","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"fastchat","domain":"AI","topics":[],"ask_for":"An agent serving and judging chat models queries this for serving, MT-Bench, and LLM-as-judge/Arena patterns.","licence_class":"adapt-with-attribution"}
+{"slug":"fastcrypto","domain":"CRYPTO","topics":[],"ask_for":"an agent working on a performance-critical crypto layer for a blockchain/database queries this for Mysten's vetted wrappers over signatures, hashing and VRFs","licence_class":"adapt-with-attribution"}
+{"slug":"fastmcp","domain":"AI","topics":[],"ask_for":"An agent standing up an MCP server in Python queries this for a high-level MCP server/client framework.","licence_class":"adapt-with-attribution"}
+{"slug":"fastrag","domain":"AI","topics":[],"ask_for":"An agent optimising RAG for efficiency queries this for retrieval acceleration and context-compression techniques.","licence_class":"adapt-with-attribution"}
+{"slug":"fda-food-code","domain":"HEALTH","topics":[],"ask_for":"FDA Food Code 2022 provisions: cooking/holding temperatures, sanitizer tables, reporting rules","licence_class":"adapt-with-attribution"}
+{"slug":"fhir-test-cases","domain":"HEALTH","topics":[],"ask_for":"An agent implementing a FHIR server or validator queries this for canonical example resources and conformance test cases across FHIR R3/R4/R5.","licence_class":"adapt-with-attribution"}
+{"slug":"flagembedding","domain":"AI","topics":[],"ask_for":"An agent choosing or fine-tuning retrieval models queries this for BGE embedding and reranker training/usage.","licence_class":"adapt-with-attribution"}
+{"slug":"flatbuffers","domain":"NET","topics":[],"ask_for":"an agent designing zero-copy serialisation queries this for the vtable layout and verifier approach","licence_class":"adapt-with-attribution"}
+{"slug":"flexrag","domain":"AI","topics":[],"ask_for":"An agent reproducing/evaluating RAG systems queries this for a flexible research framework spanning text, multimodal, and web-accessible RAG.","licence_class":"adapt-with-attribution"}
+{"slug":"fluentd","domain":"OPS","topics":[],"ask_for":"An agent building log pipelines queries this for Fluentd input/filter/output plugin routing and buffering.","licence_class":"adapt-with-attribution"}
+{"slug":"flux2","domain":"OPS","topics":[],"ask_for":"An agent building pull-based GitOps queries this for Flux source/kustomize/helm controllers and reconciliation semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"fluxcd-website","domain":"OPS","topics":[],"ask_for":"An agent adopting Flux queries this for GitOps setup guides, controller reference and migration docs.","licence_class":"adapt-with-attribution"}
+{"slug":"foodon","domain":"HEALTH","topics":[],"ask_for":"An agent working on normalizing food and ingredient names queries this for a controlled vocabulary of foods, food products, and source/processing relationships for diet and food-safety tasks.","licence_class":"adapt-with-attribution"}
+{"slug":"fortio","domain":"OPS","topics":[],"ask_for":"An agent benchmarking HTTP/gRPC services queries this for load generation, latency histograms, and percentile reporting.","licence_class":"adapt-with-attribution"}
+{"slug":"fory","domain":"NET","topics":[],"ask_for":"an agent working on fast cross-language serialization queries this for reference tracking, schema evolution, and JIT-accelerated codecs","licence_class":"adapt-with-attribution"}
+{"slug":"garak","domain":"AI","topics":[],"ask_for":"An agent red-teaming an LLM queries this for probe/detector implementations for jailbreaks and prompt injection.","licence_class":"adapt-with-attribution"}
+{"slug":"gatekeeper-library","domain":"SEC","topics":[],"ask_for":"an agent writing Kubernetes admission policy queries this for OPA Gatekeeper constraint templates (Rego) and their test cases.","licence_class":"adapt-with-attribution"}
+{"slug":"gateway-api","domain":"OPS","topics":[],"ask_for":"An agent implementing ingress/gateway routing queries this for the Gateway API spec, conformance semantics, and resource model.","licence_class":"adapt-with-attribution"}
+{"slug":"gatling","domain":"OPS","topics":[],"ask_for":"An agent building performance test suites queries this for Gatling's DSL scenarios, injection profiles and assertions.","licence_class":"adapt-with-attribution"}
+{"slug":"gdpr-commonaccord","domain":"LAW","topics":[],"ask_for":"law","licence_class":"adapt-with-attribution"}
+{"slug":"gemini-cookbook","domain":"AI","topics":[],"ask_for":"An agent building on Gemini queries this for recipes on long context, multimodal input, and structured output.","licence_class":"adapt-with-attribution"}
+{"slug":"getrandom","domain":"CRYPTO","topics":[],"ask_for":"An agent sourcing OS randomness portably queries this for getrandom's per-platform syscall backends.","licence_class":"adapt-with-attribution"}
+{"slug":"giskard","domain":"AI","topics":[],"ask_for":"An agent scanning an LLM app for vulnerabilities queries this for automated test/red-team scan implementations.","licence_class":"adapt-with-attribution"}
+{"slug":"github-opensource-guide","domain":"WRITE","topics":[],"ask_for":"An agent writing open-source project docs, CONTRIBUTING guides and maintainer communications queries this for editorial best practices and templates.","licence_class":"adapt-with-attribution"}
+{"slug":"github-site-policy","domain":"LAW","topics":[],"ask_for":"An agent drafting SaaS terms of service, acceptable-use, or privacy text queries this for GitHub's full suite of legal site policies in Markdown with version history.","licence_class":"adapt-with-attribution"}
+{"slug":"gitlab-runbooks","domain":"OPS","topics":[],"ask_for":"an agent on call for a SaaS queries this for real alert definitions, escalations and mitigation playbooks from a large production fleet","licence_class":"adapt-with-attribution"}
+{"slug":"glasskube","domain":"OPS","topics":[],"ask_for":"An agent building a Kubernetes package manager queries this for dependency-aware install/update and GitOps package distribution.","licence_class":"adapt-with-attribution"}
+{"slug":"gnark","domain":"CRYPTO","topics":[],"ask_for":"An agent building ZK circuits in Go queries this for gnark's R1CS/PLONK frontends and backends.","licence_class":"adapt-with-attribution"}
+{"slug":"gnostic","domain":"API","topics":[],"ask_for":"An agent converting OpenAPI/Discovery docs into protobuf models queries this for gnostic's spec parsing and plugin pipeline.","licence_class":"adapt-with-attribution"}
+{"slug":"go-jose","domain":"CRYPTO","topics":[],"ask_for":"An agent implementing JWS/JWE/JWK queries this for go-jose's JOSE object serialization and algorithm support.","licence_class":"adapt-with-attribution"}
+{"slug":"go-stomp","domain":"NET","topics":[],"ask_for":"an agent working on a STOMP messaging client queries this for the text frame grammar and subscription/ack semantics","licence_class":"adapt-with-attribution"}
+{"slug":"go-tpm","domain":"CRYPTO","topics":[],"ask_for":"An agent driving a TPM from Go queries this for go-tpm's TPM 1.2/2.0 command marshalling and session handling.","licence_class":"adapt-with-attribution"}
+{"slug":"go-vulndb","domain":"SEC","topics":[],"ask_for":"an agent reviewing Go modules queries this for Go-team-curated advisories with symbols and fixed versions","licence_class":"adapt-with-attribution"}
+{"slug":"golang-jwt","domain":"CRYPTO","topics":[],"ask_for":"An agent issuing/validating JWTs in Go queries this for golang-jwt's signing methods and claims validation.","licence_class":"adapt-with-attribution"}
+{"slug":"golang-x-crypto","domain":"CRYPTO","topics":[],"ask_for":"an agent working on crypto primitives in Go queries this for x/crypto's argon2/scrypt/chacha20poly1305/ssh/ocsp/acme implementations","licence_class":"adapt-with-attribution"}
+{"slug":"good-docs-templates","domain":"WRITE","topics":[],"ask_for":"an agent structuring a document queries this for how-to, tutorial, reference and explanation templates with embedded writing guidance","licence_class":"adapt-with-attribution"}
+{"slug":"google-aip","domain":"API","topics":[],"ask_for":"An agent designing a resource-oriented REST or gRPC API queries this for Google's API Improvement Proposals on naming, pagination, field masks, errors, and long-running operations.","licence_class":"adapt-with-attribution"}
+{"slug":"google-devdocs-vale","domain":"WRITE","topics":[],"ask_for":"an agent writing developer docs queries this for Google dev-doc style rules: voice, tense, second person, word choice","licence_class":"adapt-with-attribution"}
+{"slug":"google-eng-practices","domain":"API","topics":[],"ask_for":"an agent reviewing code queries this for the review standard's concrete what-to-look-for and clangers","licence_class":"adapt-with-attribution"}
+{"slug":"google-fuzzing","domain":"SEC","topics":[],"ask_for":"an agent setting up fuzzing queries this for fuzzer dictionaries, tutorials and best-practice documentation (libFuzzer/AFL).","licence_class":"adapt-with-attribution"}
+{"slug":"google-licenseclassifier","domain":"LAW","topics":[],"ask_for":"An agent building fuzzy license identification queries this for a Go classifier plus its embedded corpus of known license and header texts.","licence_class":"adapt-with-attribution"}
+{"slug":"googleapis","domain":"API","topics":[],"ask_for":"An agent designing resource-oriented gRPC/REST APIs the Google way queries this for canonical service .proto definitions and the common google.api protos.","licence_class":"adapt-with-attribution"}
+{"slug":"gopass","domain":"CRYPTO","topics":[],"ask_for":"An agent building a team password store queries this for gopass' pass-compatible, GPG/age-backed secret store.","licence_class":"adapt-with-attribution"}
+{"slug":"goreleaser","domain":"OPS","topics":[],"ask_for":"An agent automating release builds queries this for cross-compilation, packaging, signing and changelog/release publishing config.","licence_class":"adapt-with-attribution"}
+{"slug":"gorilla","domain":"AI","topics":[],"ask_for":"An agent designing function/tool calling queries this for API-invocation training and the function-calling leaderboard.","licence_class":"adapt-with-attribution"}
+{"slug":"gosec-rules","domain":"SEC","topics":[],"ask_for":"An agent writing Go SAST or secure-coding checks queries this for gosec's rule implementations (AST/SSA patterns for SQLi, command injection, weak RNG, TLS misconfig, file traversal).","licence_class":"adapt-with-attribution"}
+{"slug":"goss","domain":"OPS","topics":[],"ask_for":"An agent validating server and infrastructure state queries this for Goss/gossfile declarative health and readiness checks.","licence_class":"adapt-with-attribution"}
+{"slug":"got","domain":"NET","topics":[],"ask_for":"An agent implementing an HTTP client with retries and redirects queries this for retry/backoff policy, redirect handling, and streaming response semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"govuk-design-system","domain":"WEB","topics":[],"ask_for":"an agent building accessible UI queries this for the component's exact accessibility criteria and edge cases","licence_class":"adapt-with-attribution"}
+{"slug":"gpt-engineer","domain":"AI","topics":[],"ask_for":"An agent scaffolding a project from a spec queries this for spec-to-codebase generation loops.","licence_class":"adapt-with-attribution"}
+{"slug":"grafana-alloy","domain":"OPS","topics":[],"ask_for":"An agent deploying a vendor-neutral telemetry collector queries this for OTel/Prometheus pipeline components and configuration.","licence_class":"adapt-with-attribution"}
+{"slug":"graphql-composite-schemas-spec","domain":"API","topics":[],"ask_for":"An agent federating multiple GraphQL services into one supergraph queries this for the Composite Schemas spec (keys, lookups, schema composition).","licence_class":"adapt-with-attribution"}
+{"slug":"graphql-over-http","domain":"API","topics":[],"ask_for":"An agent serving GraphQL over HTTP queries this for request/response media types, status-code and transport conventions.","licence_class":"adapt-with-attribution"}
+{"slug":"graphql-spec","domain":"API","topics":[],"ask_for":"an agent building a GraphQL server queries this for execution, defer/stream and introspection semantics","licence_class":"adapt-with-attribution"}
+{"slug":"graphrag","domain":"AI","topics":[],"ask_for":"An agent doing knowledge-graph-grounded RAG queries this for entity/community extraction and graph-based retrieval.","licence_class":"adapt-with-attribution"}
+{"slug":"griptape","domain":"AI","topics":[],"ask_for":"An agent building modular pipelines queries this for structures (agents/pipelines/workflows), tasks, and tool/driver abstractions.","licence_class":"adapt-with-attribution"}
+{"slug":"grpc-gateway","domain":"API","topics":[],"ask_for":"An agent exposing gRPC services as REST/JSON queries this for the google.api.http annotation mapping and reverse-proxy generation.","licence_class":"adapt-with-attribution"}
+{"slug":"grpc-go","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"grpc-proposals","domain":"API","topics":[],"ask_for":"An agent working on gRPC protocol or framework behaviour queries this for the gRFC design proposals that define wire format, naming, retries, and cross-language API semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"guardrails","domain":"AI","topics":[],"ask_for":"An agent validating and correcting LLM output queries this for RAIL schemas and output validators/reask loops.","licence_class":"adapt-with-attribution"}
+{"slug":"guidance","domain":"AI","topics":[],"ask_for":"An agent constraining LLM output to a grammar, template, or control flow queries this for guidance's constrained-generation primitives and token-healing.","licence_class":"adapt-with-attribution"}
+{"slug":"h2","domain":"NET","topics":[],"ask_for":"an agent working on an HTTP/2 protocol core queries this for stream multiplexing, flow control, and HPACK framing","licence_class":"adapt-with-attribution"}
+{"slug":"h2o","domain":"NET","topics":[],"ask_for":"An agent implementing a high-performance HTTP/1-2 server queries this for event-loop request handling, HTTP/2 prioritization, and header processing in C.","licence_class":"adapt-with-attribution"}
+{"slug":"hacl-star","domain":"CRYPTO","topics":[],"ask_for":"An agent needing formally-verified crypto queries this for HACL*/EverCrypt's verified C implementations and agile API.","licence_class":"adapt-with-attribution"}
+{"slug":"harbor","domain":"OPS","topics":[],"ask_for":"An agent running a private registry queries this for Harbor image storage, replication, scanning and RBAC.","licence_class":"adapt-with-attribution"}
+{"slug":"harper","domain":"WRITE","topics":[],"ask_for":"An agent building a fast local grammar/style checker in Rust queries this for its rule engine, lint rules and curated dictionary (no cloud, no LLM).","licence_class":"adapt-with-attribution"}
+{"slug":"haystack","domain":"AI","topics":[],"ask_for":"An agent building a production RAG/NLP pipeline queries this for composable retriever/reader/generator components.","licence_class":"adapt-with-attribution"}
+{"slug":"head-qa","domain":"HEALTH","topics":[],"ask_for":"An agent building healthcare professional-exam QA queries this for HEAD-QA: Spanish Ministry of Health specialization-exam questions (medicine, nursing, pharmacy, psychology, biology, chemistry), English translations available.","licence_class":"adapt-with-attribution"}
+{"slug":"helm","domain":"OPS","topics":[],"ask_for":"An agent packaging Kubernetes apps queries this for chart templating, release lifecycle and rollback, and dependency/values resolution.","licence_class":"adapt-with-attribution"}
+{"slug":"hivemq-mqtt-client","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"how-they-sre","domain":"OPS","topics":[],"ask_for":"An agent studying real-world SRE queries this for curated summaries of how many named organizations run reliability engineering.","licence_class":"adapt-with-attribution"}
+{"slug":"httparse","domain":"NET","topics":[],"ask_for":"an agent working on a zero-copy HTTP/1.x request/response parser queries this for push-parser state machines and header handling","licence_class":"adapt-with-attribution"}
+{"slug":"httpx","domain":"NET","topics":[],"ask_for":"An agent designing an HTTP client queries this for sync/async client design, connection pooling, and HTTP/2 transport behavior.","licence_class":"adapt-with-attribution"}
+{"slug":"huggingface-hub-docs","domain":"AI","topics":[],"ask_for":"An agent writing model/dataset cards queries this for the Hugging Face model-card spec and metadata conventions.","licence_class":"adapt-with-attribution"}
+{"slug":"hyper","domain":"NET","topics":[],"ask_for":"An agent building an async HTTP/1 and HTTP/2 stack in Rust queries this for connection handling, request/response encoding, and the client/server state machines.","licence_class":"adapt-with-attribution"}
+{"slug":"ibm-openapi-validator","domain":"API","topics":[],"ask_for":"An agent validating OpenAPI documents against configurable governance rules queries this for IBM's validator rule set and scoring model.","licence_class":"adapt-with-attribution"}
+{"slug":"icd10-who","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"icd10cm-codes","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"icd9-icd10-hierarchy","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"iceberg","domain":"DB","topics":[],"ask_for":"an agent building lakehouse tables queries this for spec semantics and the reference metadata/manifest handling","licence_class":"adapt-with-attribution"}
+{"slug":"in-solidarity-bot","domain":"WRITE","topics":[],"ask_for":"An agent enforcing inclusive language in a repo queries this for its default term->replacement rules and configuration model.","licence_class":"adapt-with-attribution"}
+{"slug":"influxdb","domain":"DB","topics":[],"ask_for":"an agent working on time series queries this for TSM/flux paths and downsampling semantics","licence_class":"adapt-with-attribution"}
+{"slug":"infracost","domain":"OPS","topics":[],"ask_for":"An agent estimating cloud cost in CI queries this for Infracost's Terraform cost-diff pricing and policy checks.","licence_class":"adapt-with-attribution"}
+{"slug":"inspect-ai","domain":"AI","topics":[],"ask_for":"An agent building rigorous model evaluations queries this for a task/solver/scorer evaluation framework.","licence_class":"adapt-with-attribution"}
+{"slug":"instructor","domain":"AI","topics":[],"ask_for":"An agent extracting typed/structured data from LLM calls queries this for instructor's Pydantic response-model patterns, retries, and validation hooks.","licence_class":"adapt-with-attribution"}
+{"slug":"jaeger-docs","domain":"OPS","topics":[],"ask_for":"An agent instrumenting or operating distributed tracing queries this for Jaeger deployment, sampling configuration, and trace analysis.","licence_class":"adapt-with-attribution"}
+{"slug":"joblint","domain":"WRITE","topics":[],"ask_for":"An agent writing or auditing job descriptions queries this for rules that flag sexist, elitist or exclusionary wording with suggested replacements.","licence_class":"adapt-with-attribution"}
+{"slug":"jose-js","domain":"CRYPTO","topics":[],"ask_for":"An agent implementing JOSE in JS/TS queries this for panva/jose's JWS/JWE/JWK handling and runtime-agnostic crypto.","licence_class":"adapt-with-attribution"}
+{"slug":"jsdom","domain":"WEB","topics":[],"ask_for":"An agent implementing DOM/HTML semantics outside a browser queries this for a JS implementation of DOM, HTML elements, events and the WHATWG algorithms.","licence_class":"adapt-with-attribution"}
+{"slug":"json-api-spec","domain":"API","topics":[],"ask_for":"An agent building a JSON REST API queries this for the JSON:API specification's document structure, resource relationships, includes, and query-parameter conventions.","licence_class":"adapt-with-attribution"}
+{"slug":"json-schema-spec","domain":"API","topics":[],"ask_for":"an agent writing validators queries this for the dialect's exact keyword semantics (2019-09 vs 2020-12 differences bite)","licence_class":"adapt-with-attribution"}
+{"slug":"json-schema-test-suite","domain":"API","topics":[],"ask_for":"An agent implementing a JSON Schema validator queries this for the canonical cross-draft conformance test cases (draft-04 through 2020-12).","licence_class":"adapt-with-attribution"}
+{"slug":"jsonformer","domain":"AI","topics":[],"ask_for":"An agent forcing valid JSON from a local model queries this for token-level structured decoding over a schema.","licence_class":"adapt-with-attribution"}
+{"slug":"jsonwebtoken-rust","domain":"CRYPTO","topics":[],"ask_for":"An agent issuing/validating JWTs in Rust queries this for Keats/jsonwebtoken's encode/decode and algorithm handling.","licence_class":"adapt-with-attribution"}
+{"slug":"jwx","domain":"CRYPTO","topics":[],"ask_for":"an agent working on a complete JWx stack in Go queries this for JWK set handling, JWS/JWE and JWT validation flows","licence_class":"adapt-with-attribution"}
+{"slug":"kafka-protocol","domain":"DB","topics":[],"ask_for":"an agent implementing a Kafka client queries this for the protocol guide's exact request/response schemas and error codes","licence_class":"adapt-with-attribution"}
+{"slug":"kafka-src","domain":"DB","topics":[],"ask_for":"an agent working on log systems queries this for the log-cleaner, controller and replication protocol internals","licence_class":"adapt-with-attribution"}
+{"slug":"karma","domain":"OPS","topics":[],"ask_for":"An agent building an alert dashboard queries this for Alertmanager aggregation, grouping, and silence-management UI patterns.","licence_class":"adapt-with-attribution"}
+{"slug":"karpenter","domain":"OPS","topics":[],"ask_for":"An agent tuning Kubernetes node autoscaling and bin-packing queries this for NodePool/provisioner logic, consolidation, and instance-selection heuristics.","licence_class":"adapt-with-attribution"}
+{"slug":"keda","domain":"OPS","topics":[],"ask_for":"An agent configuring event-driven autoscaling queries this for KEDA scalers, ScaledObjects and the HPA/external-metrics bridge.","licence_class":"adapt-with-attribution"}
+{"slug":"keep-a-changelog","domain":"WRITE","topics":[],"ask_for":"An agent writing or standardizing CHANGELOG files queries this for the Keep a Changelog convention (sections, versioning, wording).","licence_class":"adapt-with-attribution"}
+{"slug":"keywhiz","domain":"CRYPTO","topics":[],"ask_for":"An agent designing a centralized secrets-distribution service queries this for Square's Keywhiz server and FUSE-based secret delivery.","licence_class":"adapt-with-attribution"}
+{"slug":"kics","domain":"SEC","topics":[],"ask_for":"an agent finding IaC misconfigurations queries this for KICS query definitions (Rego-style) plus their vulnerable/expected test fixtures.","licence_class":"adapt-with-attribution"}
+{"slug":"knox","domain":"CRYPTO","topics":[],"ask_for":"An agent building key management and rotation queries this for Pinterest Knox's key store, ACLs and rotation model.","licence_class":"adapt-with-attribution"}
+{"slug":"kotaemon","domain":"AI","topics":[],"ask_for":"An agent shipping a document-QA UI queries this for a clean RAG app architecture with reasoning pipelines and citations.","licence_class":"adapt-with-attribution"}
+{"slug":"kratix","domain":"OPS","topics":[],"ask_for":"An agent building platform-as-a-product queries this for the Promise abstraction and request/fulfilment pipeline model.","licence_class":"adapt-with-attribution"}
+{"slug":"kryptology","domain":"CRYPTO","topics":[],"ask_for":"an agent working on threshold signatures/MPC or advanced primitives queries this for Coinbase's VSS, threshold ECDSA, BLS and accumulators","licence_class":"adapt-with-attribution"}
+{"slug":"kube-bench","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"kube-hunter","domain":"SEC","topics":[],"ask_for":"an agent probing a cluster queries this for kube-hunter's Kubernetes attack knowledge base (KB IDs) and test definitions.","licence_class":"adapt-with-attribution"}
+{"slug":"kubernetes-community","domain":"API","topics":[],"ask_for":"An agent designing declarative resource APIs (spec/status, list/watch, server-side apply, versioned groups) queries this for the Kubernetes API conventions and SIG-architecture design docs.","licence_class":"adapt-with-attribution"}
+{"slug":"kubescape-regolibrary","domain":"SEC","topics":[],"ask_for":"an agent assessing Kubernetes compliance queries this for Kubescape's Rego controls and their framework mappings (NSA, MITRE, CIS).","licence_class":"adapt-with-attribution"}
+{"slug":"kyverno-policies","domain":"SEC","topics":[],"ask_for":"an agent securing Kubernetes queries this for Kyverno's YAML policy library (pod security, best practices) and test resources.","licence_class":"adapt-with-attribution"}
+{"slug":"lambdaworks","domain":"CRYPTO","topics":[],"ask_for":"an agent working on STARK/SNARK proving math queries this for a from-scratch, well-documented Rust library of fields, FFTs and provers","licence_class":"adapt-with-attribution"}
+{"slug":"ldnoobw-bad-words","domain":"WRITE","topics":[],"ask_for":"An agent building profanity filters or content-safety checks queries this for obscene/offensive word lists across dozens of languages.","licence_class":"adapt-with-attribution"}
+{"slug":"lego","domain":"CRYPTO","topics":[],"ask_for":"An agent automating ACME certificate issuance queries this for lego's ACME v2 client and DNS-01/HTTP-01/TLS-ALPN challenge providers.","licence_class":"adapt-with-attribution"}
+{"slug":"leveldb","domain":"DB","topics":[],"ask_for":"an agent learning LSM internals queries this for the original clean implementation (memtable/sstable/manifest split)","licence_class":"adapt-with-attribution"}
+{"slug":"lexbuild","domain":"LAW","topics":[],"ask_for":"An agent converting official legislative XML (USLM) into LLM-friendly structured Markdown queries this for a reference CLI and its transformation/metadata pipeline.","licence_class":"adapt-with-attribution"}
+{"slug":"libcbor","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"libhydrogen","domain":"CRYPTO","topics":[],"ask_for":"An agent working on crypto for constrained/embedded targets queries this for libhydrogen's small, hard-to-misuse C API covering hashing, AEAD, signatures and key exchange.","licence_class":"adapt-with-attribution"}
+{"slug":"libopenapi","domain":"API","topics":[],"ask_for":"An agent parsing and mutating OpenAPI 2/3 documents with full $ref resolution and a rolling index queries this for libopenapi's low/high model.","licence_class":"adapt-with-attribution"}
+{"slug":"libsodium","domain":"CRYPTO","topics":[],"ask_for":"An agent working on a modern crypto library (AEAD, X25519, Ed25519, secretstream, password hashing) queries this for libsodium's battle-tested constant-time C implementations and misuse-resistant API.","licence_class":"adapt-with-attribution"}
+{"slug":"libuv","domain":"NET","topics":[],"ask_for":"an agent building an event loop queries this for the polling primitives and async threading patterns","licence_class":"adapt-with-attribution"}
+{"slug":"licensee","domain":"LAW","topics":[],"ask_for":"An agent auto-detecting a repo's license from its LICENSE file queries this for the reference detection algorithm and the normalized license corpus GitHub itself uses.","licence_class":"adapt-with-attribution"}
+{"slug":"lightningcss","domain":"WEB","topics":[],"ask_for":"A Rust agent parsing/transforming CSS queries this for Lightning CSS's Rust CSS parser, minifier and vendor-prefixing/transpilation design.","licence_class":"adapt-with-attribution"}
+{"slug":"lit","domain":"WEB","topics":[],"ask_for":"An agent building web components queries this for Lit's reactive-element lifecycle, declarative template directives and efficient DOM updates.","licence_class":"adapt-with-attribution"}
+{"slug":"llhttp","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"llm-course","domain":"AI","topics":[],"ask_for":"an agent building with LLMs queries this for the fine-tune, quantize, RAG and deployment path and the concept behind each step","licence_class":"adapt-with-attribution"}
+{"slug":"lmdb","domain":"DB","topics":[],"ask_for":"an agent working on memory-mapped B+trees queries this for LMDB's page/cursor/COW mechanics","licence_class":"adapt-with-attribution"}
+{"slug":"lol-html","domain":"WEB","topics":[],"ask_for":"A Rust agent rewriting HTML in a stream queries this for Cloudflare's low-latency streaming HTML rewriter and CSS-selector-driven rewriting.","licence_class":"adapt-with-attribution"}
+{"slug":"loldrivers","domain":"SEC","topics":[],"ask_for":"an agent detecting BYOVD attacks queries this for LOLDrivers' known vulnerable/malicious driver metadata, hashes and YARA rules.","licence_class":"adapt-with-attribution"}
+{"slug":"lz4","domain":"NET","topics":[],"ask_for":"an agent needing fast block compression queries this for the block format and decoder loop","licence_class":"approach-only"}
+{"slug":"markdownlint","domain":"WRITE","topics":[],"ask_for":"An agent authoring Markdown docs queries this for the consensus rule set on heading, list, spacing and formatting style (rules + rationale).","licence_class":"adapt-with-attribution"}
+{"slug":"mashqa","domain":"HEALTH","topics":[],"ask_for":"An agent building long-document consumer-health QA with multiple non-contiguous answer spans queries this for MASH-QA.","licence_class":"adapt-with-attribution"}
+{"slug":"material-components-web","domain":"WEB","topics":[],"ask_for":"An agent implementing Material Design queries this for MDC component behaviour, ripple/elevation mechanics and the Sass theming system.","licence_class":"adapt-with-attribution"}
+{"slug":"material-web","domain":"WEB","topics":[],"ask_for":"An agent building Material 3 web components queries this for Google's MWC element implementations, theming, and ripple/motion behaviour.","licence_class":"adapt-with-attribution"}
+{"slug":"mbedtls","domain":"CRYPTO","topics":[],"ask_for":"An agent working on embedding or implementing a TLS stack queries this for mbed-TLS's portable C TLS 1.2/1.3 handshake, X.509 and crypto modules.","licence_class":"adapt-with-attribution"}
+{"slug":"mdn-browser-compat-data","domain":"WEB","topics":[],"ask_for":"an agent checking API/CSS/HTML/JS availability queries this for machine-readable per-feature browser-version compatibility records.","licence_class":"adapt-with-attribution"}
+{"slug":"mdn-data","domain":"WEB","topics":[],"ask_for":"An agent needing structured CSS/JS metadata (properties, at-rules, selectors, syntaxes, API inventory) queries this for MDN's machine-readable data.","licence_class":"adapt-with-attribution"}
+{"slug":"medical-abbreviations","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"medmcqa","domain":"HEALTH","topics":[],"ask_for":"An agent building medical multiple-choice/exam QA queries this for ~194k Indian medical-entrance (AIIMS/NEET-PG) questions with explanations across 21 subjects.","licence_class":"adapt-with-attribution"}
+{"slug":"medqa-usmle","domain":"HEALTH","topics":[],"ask_for":"An agent building USMLE-style medical board QA queries this for MedQA multiple-choice questions (US/Mainland/Taiwan) plus the textbook passages used as context.","licence_class":"adapt-with-attribution"}
+{"slug":"medquad","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"medspacy","domain":"HEALTH","topics":[],"ask_for":"An agent building clinical-note NLP (sections, ConText negation/assertion, rule-based targets) queries this for medspaCy's clinical pipeline components.","licence_class":"adapt-with-attribution"}
+{"slug":"microsoft-seal","domain":"CRYPTO","topics":[],"ask_for":"an agent working on homomorphic encryption queries this for Microsoft SEAL's BFV/BGV/CKKS schemes and parameter selection","licence_class":"adapt-with-attribution"}
+{"slug":"microsoft-style-vale","domain":"WRITE","topics":[],"ask_for":"an agent writing UI or docs copy queries this for Microsoft Writing Style Guide rules: terminology, tone, inclusive language, capitalization","licence_class":"adapt-with-attribution"}
+{"slug":"miekg-dns","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"milvus","domain":"DB","topics":[],"ask_for":"DB","licence_class":"adapt-with-attribution"}
+{"slug":"minify","domain":"WEB","topics":[],"ask_for":"An agent minifying web assets server-side queries this for tdewolff's HTML/CSS/JS/SVG/JSON minifiers and their tokenizers.","licence_class":"adapt-with-attribution"}
+{"slug":"minisign","domain":"CRYPTO","topics":[],"ask_for":"an agent working on simple Ed25519 file signing/verification queries this for minisign's compact signature format and trusted-comment scheme","licence_class":"adapt-with-attribution"}
+{"slug":"misp-galaxy","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"mitre-attck","domain":"SEC","topics":[],"ask_for":"an agent writing or reviewing detections queries this for technique ids, tactics, detection data-sources and procedure examples","licence_class":"adapt-with-attribution"}
+{"slug":"mitre-capec","domain":"SEC","topics":[],"ask_for":"an agent reasoning about attack surface queries this for attack-pattern enumerations with prerequisites and mitigations","licence_class":"adapt-with-attribution"}
+{"slug":"mitre-cwe","domain":"SEC","topics":[],"ask_for":"an agent classifying a finding queries this for the CWE definition, its parents/children and detection notes","licence_class":"adapt-with-attribution"}
+{"slug":"mkcert","domain":"CRYPTO","topics":[],"ask_for":"An agent working on locally-trusted development TLS certificates queries this for mkcert's local-CA creation and system/browser trust-store installation logic.","licence_class":"adapt-with-attribution"}
+{"slug":"mls-rs","domain":"CRYPTO","topics":[],"ask_for":"An agent implementing MLS in Rust queries this for AWS Labs' mls-rs, an alternative RFC 9420 implementation with pluggable crypto providers.","licence_class":"adapt-with-attribution"}
+{"slug":"monocypher","domain":"CRYPTO","topics":[],"ask_for":"An agent working on a tiny auditable crypto library queries this for Monocypher's single-file C implementations of X25519, EdDSA, ChaCha20, BLAKE2 and Argon2.","licence_class":"adapt-with-attribution"}
+{"slug":"mozilla-diversity","domain":"LAW","topics":[],"ask_for":"An agent drafting community participation guidelines or a code of conduct with an enforcement process queries this for Mozilla's CPG and CoC templates.","licence_class":"adapt-with-attribution"}
+{"slug":"mozilla-l10n-docs","domain":"WRITE","topics":[],"ask_for":"An agent writing localization/translation style guidance queries this for Mozilla's localizer documentation and per-locale translation style conventions.","licence_class":"adapt-with-attribution"}
+{"slug":"mozilla-l10n-styleguides","domain":"WRITE","topics":[],"ask_for":"An agent localising software queries this for Mozilla's per-locale tone, punctuation and terminology style guides.","licence_class":"adapt-with-attribution"}
+{"slug":"mozilla-ssl-configs","domain":"CRYPTO","topics":[],"ask_for":"an agent configuring TLS termination queries this for the recommended cipher/protocol sets per server and their security/cost tradeoffs","licence_class":"adapt-with-attribution"}
+{"slug":"moztw-styleguides","domain":"WRITE","topics":[],"ask_for":"An agent translating software UI/content queries this for community translation style guides (tone, terminology, formatting) across locales.","licence_class":"adapt-with-attribution"}
+{"slug":"msft-api-guidelines","domain":"API","topics":[],"ask_for":"an agent designing a REST surface queries this for the naming/paging/versioning/error rules with examples","licence_class":"adapt-with-attribution"}
+{"slug":"msgpack-c","domain":"NET","topics":[],"ask_for":"an agent implementing msgpack queries this for the format handling and unpack edge cases","licence_class":"adapt-with-attribution"}
+{"slug":"mts-dialog-clinical-notes","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"mutcd","domain":"LAW","topics":[],"ask_for":"the current MUTCD: sign and signal warrants, markings, work-zone typical applications","licence_class":"adapt-with-attribution"}
+{"slug":"nats-protocol","domain":"DB","topics":[],"ask_for":"an agent implementing a NATS client queries this for the wire protocol, verbs and semantics text","licence_class":"adapt-with-attribution"}
+{"slug":"nats-server","domain":"DB","topics":[],"ask_for":"an agent working on pub/sub queries this for subject-tree routing, jetstream and clustering internals in readable Go","licence_class":"adapt-with-attribution"}
+{"slug":"navrules","domain":"LAW","topics":[],"ask_for":"a mariner, boater, or agent writing navigation software queries this for the actual text of Rule 7 risk of collision, Rule 9 narrow channels, lights, sound signals","licence_class":"adapt-with-attribution"}
+{"slug":"nghttp2","domain":"NET","topics":[],"ask_for":"an agent working with HTTP/2 queries this for flow control, HPACK and priority internals in the reference C library","licence_class":"adapt-with-attribution"}
+{"slug":"nginx","domain":"NET","topics":[],"ask_for":"an agent working on web servers queries this for the event-driven request cycle and module seams (note: very large)","licence_class":"adapt-with-attribution"}
+{"slug":"nigeria-standard-treatment-guidelines","domain":"HEALTH","topics":[],"ask_for":"health","licence_class":"adapt-with-attribution"}
+{"slug":"oasdiff","domain":"API","topics":[],"ask_for":"An agent detecting breaking changes between OpenAPI versions queries this for oasdiff's diff algorithm and breaking-change classification.","licence_class":"adapt-with-attribution"}
+{"slug":"openapi-moonwalk","domain":"API","topics":[],"ask_for":"An agent anticipating the next-generation OpenAPI data model queries this for the Moonwalk SIG proposals and design discussions.","licence_class":"adapt-with-attribution"}
+{"slug":"openapi-overlay-spec","domain":"API","topics":[],"ask_for":"An agent programmatically patching/transforming OpenAPI documents queries this for the Overlay actions (target/update/remove) format.","licence_class":"adapt-with-attribution"}
+{"slug":"openapi-spec","domain":"API","topics":[],"ask_for":"an agent generating or validating an API description queries this for the OpenAPI schema's exact keywords and resolution rules","licence_class":"adapt-with-attribution"}
+{"slug":"openbao","domain":"CRYPTO","topics":[],"ask_for":"an agent working on secret stores queries this for the barrier, seal and lease internals of the open vault fork","licence_class":"adapt-with-attribution"}
+{"slug":"openbsd-faq","domain":"OPS","topics":[],"ask_for":"an agent hardening an OpenBSD host queries this for the pf FAQ's rule grammar, upgrade procedures and faq-page hardening steps","licence_class":"adapt-with-attribution"}
+{"slug":"openfda","domain":"HEALTH","topics":[],"ask_for":"An agent working on drug- and device-safety questions queries this for FDA adverse-event (FAERS), recall/enforcement, NDC, and device data field schemas and harmonization tables.","licence_class":"adapt-with-attribution"}
+{"slug":"openlegaldata-oldp","domain":"LAW","topics":[],"ask_for":"An agent building a platform that ingests and serves court decisions and laws queries this for the Open Legal Data Platform (Django) data model and legal-reference-extraction logic.","licence_class":"adapt-with-attribution"}
+{"slug":"opennyai-legal-nlp","domain":"LAW","topics":[],"ask_for":"An agent building Indian legal NLP (judgment structuring, legal NER, rhetorical-role tagging) queries this for a spaCy pipeline trained on Indian court text.","licence_class":"adapt-with-attribution"}
+{"slug":"opensanctions","domain":"LAW","topics":[],"ask_for":"An agent building sanctions/PEP screening and KYC compliance queries this for consolidated sanctions-list data models and ETL across OFAC/EU/UN sources.","licence_class":"adapt-with-attribution"}
+{"slug":"openssl","domain":"CRYPTO","topics":[],"ask_for":"an agent debugging TLS/ASN.1 queries this for the reference provider's handshake, BIO and provider internals","licence_class":"adapt-with-attribution"}
+{"slug":"osquery-config-examples","domain":"SEC","topics":[],"ask_for":"an agent writing host detections queries this for battle-tested osquery SQL by objective (suid diffs, persistence paths, launch items)","licence_class":"adapt-with-attribution"}
+{"slug":"oss-attribution-builder","domain":"LAW","topics":[],"ask_for":"An agent generating third-party attribution/notice documents queries this for the workflow and license-text templates that assemble an OSS attribution document.","licence_class":"adapt-with-attribution"}
+{"slug":"oss-license-texts","domain":"LAW","topics":[],"ask_for":"law","licence_class":"adapt-with-attribution"}
+{"slug":"oss-review-toolkit","domain":"LAW","topics":[],"ask_for":"An agent building a dependency license-compliance pipeline (SBOM, policy, attribution) queries this for a production OSS Review Toolkit implementation.","licence_class":"adapt-with-attribution"}
+{"slug":"otel-proto","domain":"OPS","topics":[],"ask_for":"an agent wiring telemetry queries this for the exact semantic conventions and proto field semantics","licence_class":"adapt-with-attribution"}
+{"slug":"owasp-cheatsheets","domain":"SEC","topics":[],"ask_for":"an agent implementing an auth/upload/crypto feature queries this for the concrete cheatsheet: header lists, code shapes, test ideas","licence_class":"adapt-with-attribution"}
+{"slug":"owasp-wstg","domain":"SEC","topics":[],"ask_for":"an agent planning a web test pass queries this for test categories, procedures and expected results","licence_class":"adapt-with-attribution"}
+{"slug":"oxc","domain":"WEB","topics":[],"ask_for":"A Rust agent building fast JS tooling queries this for Oxc's Rust parser, linter and resolver - a modern, performance-focused reference.","licence_class":"adapt-with-attribution"}
+{"slug":"pagerduty-incident-response","domain":"OPS","topics":[],"ask_for":"An agent writing on-call runbooks or incident-response automation queries this for severity levels, responder roles, and postmortem process.","licence_class":"adapt-with-attribution"}
+{"slug":"parquet-format","domain":"DB","topics":[],"ask_for":"an agent reading/writing parquet queries this for encodings, logical types and the thrift metadata spec","licence_class":"adapt-with-attribution"}
+{"slug":"parse5","domain":"WEB","topics":[],"ask_for":"An agent parsing real-world HTML queries this for a spec-compliant HTML5 tree construction/tokenizer in JS, including error recovery.","licence_class":"adapt-with-attribution"}
+{"slug":"payloadsallthethings","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"pebble","domain":"DB","topics":[],"ask_for":"an agent working on LSM stores queries this for a modern Go LSM with delete/RangeLock semantics","licence_class":"adapt-with-attribution"}
+{"slug":"plain-language-guidelines","domain":"WRITE","topics":[],"ask_for":"An agent rewriting bureaucratic or legalese text into plain language queries this for the U.S. Federal Plain Language Guidelines and their before/after examples.","licence_class":"adapt-with-attribution"}
+{"slug":"polars","domain":"DB","topics":[],"ask_for":"DB","licence_class":"adapt-with-attribution"}
+{"slug":"postcss","domain":"WEB","topics":[],"ask_for":"An agent transforming CSS queries this for PostCSS's CSS parser, node/AST model and visitor/plugin pipeline.","licence_class":"adapt-with-attribution"}
+{"slug":"postgres-src","domain":"DB","topics":[],"ask_for":"an agent working on planners queries this for the real cost model, join ordering and executor nodes","licence_class":"adapt-with-attribution"}
+{"slug":"postman-collection","domain":"API","topics":[],"ask_for":"An agent reading/writing Postman Collection v2 documents queries this SDK for the collection/request/variable object model.","licence_class":"adapt-with-attribution"}
+{"slug":"preact","domain":"WEB","topics":[],"ask_for":"An agent wanting a compact React-compatible VDOM queries this for Preact's small diff/reconciler and hooks implementation.","licence_class":"adapt-with-attribution"}
+{"slug":"prism","domain":"API","topics":[],"ask_for":"An agent building an HTTP mock/validation proxy from an OpenAPI document queries this for Prism's request validation and example/dynamic response generation.","licence_class":"adapt-with-attribution"}
+{"slug":"prometheus-src","domain":"DB","topics":[],"ask_for":"an agent working on TSDB queries this for the head-block/WAL/head-compaction paths and PromQL evaluation","licence_class":"adapt-with-attribution"}
+{"slug":"prompt-engineering-guide","domain":"AI","topics":[],"ask_for":"an agent applying a prompting technique queries this for CoT, ReAct, few-shot and RAG-prompting definitions and worked examples","licence_class":"adapt-with-attribution"}
+{"slug":"promptify","domain":"AI","topics":[],"ask_for":"An agent doing prompt-based NLP (NER, classification, QA) without fine-tuning queries this for Promptify's task-prompt templates and output parsers.","licence_class":"adapt-with-attribution"}
+{"slug":"proselint","domain":"WRITE","topics":[],"ask_for":"an agent reviewing prose queries this for sourced style checks: redundancy, jargon, hedging, misused phrases, each with a citation","licence_class":"adapt-with-attribution"}
+{"slug":"protobuf","domain":"NET","topics":[],"ask_for":"an agent generating or debugging protobuf code queries this for wire format, descriptor handling and the conformance suite","licence_class":"adapt-with-attribution"}
+{"slug":"protovalidate","domain":"API","topics":[],"ask_for":"An agent expressing field/message validation constraints on protobuf APIs queries this for protovalidate's CEL-based constraint annotations.","licence_class":"adapt-with-attribution"}
+{"slug":"pubhealth-fact-checking","domain":"HEALTH","topics":[],"ask_for":"An agent building public-health claim verification queries this for the PUBHEALTH dataset: 11.8k claims with veracity labels and journalist-written gold explanations.","licence_class":"adapt-with-attribution"}
+{"slug":"pubmedqa","domain":"HEALTH","topics":[],"ask_for":"An agent building biomedical research yes/no/maybe question answering queries this for expert-labeled PubMed-abstract QA pairs plus unlabeled and generated splits.","licence_class":"adapt-with-attribution"}
+{"slug":"pysec","domain":"SEC","topics":[],"ask_for":"an agent reviewing Python dependency trees queries this for PYSEC advisory records with fixed versions","licence_class":"adapt-with-attribution"}
+{"slug":"quiche","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"quinn","domain":"NET","topics":[],"ask_for":"an agent implementing QUIC queries this for congestion control, stream state and 0-RTT handling in idiomatic Rust","licence_class":"adapt-with-attribution"}
+{"slug":"qwik","domain":"WEB","topics":[],"ask_for":"An agent minimising client JS queries this for Qwik's resumability model and code-splitting/lazy-loading of event handlers.","licence_class":"adapt-with-attribution"}
+{"slug":"rabbitmq","domain":"DB","topics":[],"ask_for":"an agent working on message brokers queries this for queue/exchange routing and mirrored-queue semantics","licence_class":"adapt-with-attribution"}
+{"slug":"raft-rs","domain":"DB","topics":[],"ask_for":"an agent implementing raft queries this for the log/ready/progress state machine the tikv fleet runs on","licence_class":"adapt-with-attribution"}
+{"slug":"react-spectrum","domain":"WEB","topics":[],"ask_for":"An agent building accessible React components queries this for React Aria/React Stately implementations of ARIA design patterns, focus management, and i18n.","licence_class":"adapt-with-attribution"}
+{"slug":"redhat-vale-style","domain":"WRITE","topics":[],"ask_for":"An agent applying an enterprise technical-writing style queries this for Red Hat's supplementary Vale rules and word-usage guidance.","licence_class":"adapt-with-attribution"}
+{"slug":"redoc","domain":"API","topics":[],"ask_for":"An agent rendering OpenAPI as reference documentation queries this for how Redoc resolves/normalises specs and lays out three-panel docs.","licence_class":"adapt-with-attribution"}
+{"slug":"redocly-cli","domain":"API","topics":[],"ask_for":"An agent bundling, splitting and linting OpenAPI definitions queries this for Redocly CLI's config, built-in rules and bundling logic.","licence_class":"adapt-with-attribution"}
+{"slug":"reporters-db","domain":"LAW","topics":[],"ask_for":"An agent parsing or validating U.S. legal citations queries this for the structured database of court reporter abbreviations, editions, and variations.","licence_class":"adapt-with-attribution"}
+{"slug":"retext-equality","domain":"WRITE","topics":[],"ask_for":"An agent correcting gendered, ableist, or polarising language queries this for the exact term-to-suggestion rule data (equality.yml) that powers alex.","licence_class":"adapt-with-attribution"}
+{"slug":"retext-indefinite-article","domain":"WRITE","topics":[],"ask_for":"An agent copy-editing English queries this for a/an indefinite-article correctness rules including exceptions like 'an hour' and 'a user'.","licence_class":"adapt-with-attribution"}
+{"slug":"retext-intensify","domain":"WRITE","topics":[],"ask_for":"An agent tightening prose queries this for weak filler intensifiers and hedges to flag (e.g. 'very', 'really', 'quite').","licence_class":"adapt-with-attribution"}
+{"slug":"retext-quotes","domain":"WRITE","topics":[],"ask_for":"An agent normalizing typography in prose queries this for straight-vs-curly quote and apostrophe rules.","licence_class":"adapt-with-attribution"}
+{"slug":"retext-readability","domain":"WRITE","topics":[],"ask_for":"An agent assessing text difficulty queries this for how Dale-Chall/ARI/Coleman-Liau/Flesch/Gunning-Fog/SMOG/Spache are combined to flag hard sentences.","licence_class":"adapt-with-attribution"}
+{"slug":"retext-redundant-acronyms","domain":"WRITE","topics":[],"ask_for":"An agent editing technical copy queries this for the list of redundant acronym expansions ('ATM machine','PIN number').","licence_class":"adapt-with-attribution"}
+{"slug":"retext-repeated-words","domain":"WRITE","topics":[],"ask_for":"An agent proofreading queries this for the rule that catches accidental repeated words ('the the').","licence_class":"adapt-with-attribution"}
+{"slug":"retext-simplify","domain":"WRITE","topics":[],"ask_for":"An agent writing plain-language prose queries this for the list of complex/wordy phrases and their simpler replacements.","licence_class":"adapt-with-attribution"}
+{"slug":"rocksdb","domain":"DB","topics":[],"ask_for":"an agent working on LSM stores queries this for compaction, WAL and recovery internals at production scale","licence_class":"adapt-with-attribution"}
+{"slug":"rolldown","domain":"WEB","topics":[],"ask_for":"A Rust agent building a bundler queries this for Rolldown's Rust module graph and Rollup-compatible bundling design.","licence_class":"adapt-with-attribution"}
+{"slug":"rousseau","domain":"WRITE","topics":[],"ask_for":"An agent proofreading English prose queries this for lightweight checks: weasel words, passive voice, cliches, readability and lexical illusions.","licence_class":"adapt-with-attribution"}
+{"slug":"rspack","domain":"WEB","topics":[],"ask_for":"An agent building a high-performance bundler queries this for a Rust reimplementation of webpack's module/loader/plugin/HMR pipeline.","licence_class":"adapt-with-attribution"}
+{"slug":"rust-api-guidelines","domain":"API","topics":[],"ask_for":"an agent designing a Rust library API queries this for the naming/convertibility/error conventions with their reasoning","licence_class":"adapt-with-attribution"}
+{"slug":"rust-cssparser","domain":"WEB","topics":[],"ask_for":"A Rust agent tokenising CSS queries this for Servo's low-level CSS tokenizer and parser-combinator design.","licence_class":"adapt-with-attribution"}
+{"slug":"rust-url","domain":"WEB","topics":[],"ask_for":"A Rust agent parsing/normalising URLs queries this for the `url` crate - a Rust implementation of the WHATWG URL Standard (parsing, IDNA, origin).","licence_class":"adapt-with-attribution"}
+{"slug":"rustcrypto-hashes","domain":"CRYPTO","topics":[],"ask_for":"An agent working on hash-function implementations queries this for RustCrypto's pure-Rust SHA-2/SHA-3/BLAKE2/Keccak code and the shared digest-trait design.","licence_class":"adapt-with-attribution"}
+{"slug":"rustls","domain":"CRYPTO","topics":[],"ask_for":"an agent implementing TLS in Rust queries this for the state machine, cipher dispatch and certificate verification","licence_class":"adapt-with-attribution"}
+{"slug":"s2n-tls","domain":"CRYPTO","topics":[],"ask_for":"an agent hardening TLS queries this for the defensively-structured C state machine and its testing approach","licence_class":"adapt-with-attribution"}
+{"slug":"sass-spec","domain":"WEB","topics":[],"ask_for":"An agent implementing a CSS preprocessor queries this for the Sass language specification, module system, and evaluation semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"scap-security-guide","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"school-of-sre","domain":"OPS","topics":[],"ask_for":"an agent stepping into an SRE task queries this for the curriculum's concrete replication/signals/messaging/git/networking fundamentals (no incident-response or caching chapters exist — do not query for them)","licence_class":"adapt-with-attribution"}
+{"slug":"scispacy","domain":"HEALTH","topics":[],"ask_for":"An agent doing scientific/biomedical text processing in spaCy queries this for scispaCy's tokenization, abbreviation detection, NER and entity-linking code.","licence_class":"adapt-with-attribution"}
+{"slug":"season-of-docs","domain":"WRITE","topics":[],"ask_for":"An agent planning a technical-writing project queries this for Google Season of Docs guidance on scoping, producing and measuring docs.","licence_class":"adapt-with-attribution"}
+{"slug":"serverless-workflow-spec","domain":"API","topics":[],"ask_for":"An agent designing declarative workflow/orchestration APIs (states, events, retries, function refs) queries this for the CNCF Serverless Workflow DSL.","licence_class":"adapt-with-attribution"}
+{"slug":"simonw-llm","domain":"AI","topics":[],"ask_for":"An agent building an LLM CLI, logging model calls, or writing a model plugin queries this for the `llm` tool's architecture and its extensive, well-written docs.","licence_class":"adapt-with-attribution"}
+{"slug":"siren-hypermedia","domain":"API","topics":[],"ask_for":"An agent designing a hypermedia JSON format with entities, actions and links queries this for the Siren specification.","licence_class":"adapt-with-attribution"}
+{"slug":"smallstep-certificates","domain":"CRYPTO","topics":[],"ask_for":"An agent working on a private CA, ACME server or certificate-automation workflow queries this for step-ca's X.509/SSH issuance, provisioners and ACME implementation.","licence_class":"adapt-with-attribution"}
+{"slug":"smithy","domain":"API","topics":[],"ask_for":"An agent modelling protocol-agnostic service APIs (shapes, traits, protocol bindings) queries this for the AWS Smithy IDL and model semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"snappy","domain":"NET","topics":[],"ask_for":"an agent needing cheap compression queries this for the format and the reference encoder decisions","licence_class":"adapt-with-attribution"}
+{"slug":"solid","domain":"WEB","topics":[],"ask_for":"An agent building fine-grained reactivity queries this for SolidJS's signal/effect graph and compile-time JSX reactivity.","licence_class":"adapt-with-attribution"}
+{"slug":"sourcegraph-handbook","domain":"WRITE","topics":[],"ask_for":"An agent writing an open company handbook queries this for a large real-world example of handbook information architecture and plainspoken internal-doc writing.","licence_class":"adapt-with-attribution"}
+{"slug":"spdx-spec","domain":"LAW","topics":[],"ask_for":"An agent implementing SBOM generation or license declaration queries this for the SPDX specification prose (document structure, relationships, license-expression grammar).","licence_class":"adapt-with-attribution"}
+{"slug":"spectral","domain":"API","topics":[],"ask_for":"An agent linting OpenAPI/AsyncAPI documents queries this for Spectral's rule/function engine and the built-in OAS style rulesets.","licence_class":"adapt-with-attribution"}
+{"slug":"spectrum-web-components","domain":"WEB","topics":[],"ask_for":"An agent building against Adobe's Spectrum queries this for Spectrum web-component APIs, theming and token usage.","licence_class":"adapt-with-attribution"}
+{"slug":"splunk-security-content","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"sqlite-src","domain":"DB","topics":[],"ask_for":"an agent working on embedded DB internals queries this for the btree module, pager and the famously commented test harness","licence_class":"adapt-with-attribution"}
+{"slug":"standard-readme","domain":"WRITE","topics":[],"ask_for":"An agent writing README files queries this for the Standard Readme specification (required sections, ordering, wording) and generator.","licence_class":"adapt-with-attribution"}
+{"slug":"standard-webhooks","domain":"API","topics":[],"ask_for":"An agent implementing or consuming webhooks queries this for the Standard Webhooks spec covering payload signing, signature verification, idempotency, and delivery semantics.","licence_class":"adapt-with-attribution"}
+{"slug":"stratus-red-team","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"stripe-openapi","domain":"API","topics":[],"ask_for":"An agent designing a large versioned payments/REST API queries this for how a production provider models resources, object expansion, cursor pagination and idempotency in OpenAPI.","licence_class":"adapt-with-attribution"}
+{"slug":"style-dictionary","domain":"WEB","topics":[],"ask_for":"An agent transforming design tokens into platform outputs (CSS/iOS/Android) queries this for Style Dictionary's parse/transform/format pipeline.","licence_class":"adapt-with-attribution"}
+{"slug":"svelte","domain":"WEB","topics":[],"ask_for":"An agent building a reactive compiler/framework queries this for Svelte's compile-time reactivity model, runes and template compilation.","licence_class":"adapt-with-attribution"}
+{"slug":"swagger-ui","domain":"API","topics":[],"ask_for":"An agent building an interactive API console queries this for Swagger UI's OpenAPI parsing and try-it-out request model.","licence_class":"adapt-with-attribution"}
+{"slug":"swift-book","domain":"API","topics":[],"ask_for":"An agent writing Swift queries this for The Swift Programming Language book: syntax and semantics of concurrency (async/await, async let, actors), generics, optionals, error handling and the language reference grammar.","licence_class":"adapt-with-attribution"}
+{"slug":"swift-evolution","domain":"API","topics":[],"ask_for":"An agent writing Swift queries this for the accepted Swift Evolution proposals (SE-NNNN): the motivation, exact semantics and API of language and standard-library features such as Result, async let, typed throws and macros.","licence_class":"adapt-with-attribution"}
+{"slug":"symptom-ontology","domain":"HEALTH","topics":[],"ask_for":"An agent working on triaging or normalizing patient-reported complaints queries this for a controlled vocabulary of disease symptoms with definitions and synonyms.","licence_class":"adapt-with-attribution"}
+{"slug":"synthea","domain":"HEALTH","topics":[],"ask_for":"An agent building or testing EHR/FHIR pipelines queries this for Synthea's synthetic-patient generator: disease-progression modules, clinical logic and FHIR/C-CDA/CSV exporters.","licence_class":"adapt-with-attribution"}
+{"slug":"textlint","domain":"WRITE","topics":[],"ask_for":"An agent building a pluggable natural-language linter queries this for the engine design (rules, fixers, AST over Markdown/text) used across English and Japanese.","licence_class":"adapt-with-attribution"}
+{"slug":"textlint-ja-technical-writing","domain":"WRITE","topics":[],"ask_for":"An agent writing or linting Japanese technical documentation queries this preset for Japanese technical-writing rules (sentence length, doubled particles, max-ten).","licence_class":"adapt-with-attribution"}
+{"slug":"textlint-rule-preset-ai-writing","domain":"WRITE","topics":[],"ask_for":"An agent reviewing machine-generated text queries this for patterns characteristic of AI-written prose (formulaic hedging, list tics) to flag and correct.","licence_class":"adapt-with-attribution"}
+{"slug":"textlint-rule-preset-jtf-style","domain":"WRITE","topics":[],"ask_for":"An agent writing or localising Japanese content queries this for the JTF (Japan Translation Federation) standard style rules (full/half-width, punctuation, numerals).","licence_class":"adapt-with-attribution"}
+{"slug":"textlint-rule-stop-words","domain":"WRITE","topics":[],"ask_for":"An agent tightening prose queries this for a curated list of weasel/filler 'stop words' to remove.","licence_class":"adapt-with-attribution"}
+{"slug":"textlint-rule-terminology","domain":"WRITE","topics":[],"ask_for":"An agent enforcing house terminology queries this for the canonical spelling and capitalisation of hundreds of tech and product terms (JavaScript, GitHub, npm...).","licence_class":"adapt-with-attribution"}
+{"slug":"textstat","domain":"WRITE","topics":[],"ask_for":"An agent computing reading-level or readability scores queries this for implementations of Flesch, Flesch-Kincaid, Gunning-Fog, SMOG, Coleman-Liau, ARI and Dale-Chall (multi-language).","licence_class":"adapt-with-attribution"}
+{"slug":"thrift","domain":"NET","topics":[],"ask_for":"NET","licence_class":"adapt-with-attribution"}
+{"slug":"tikv","domain":"DB","topics":[],"ask_for":"DB","licence_class":"adapt-with-attribution"}
+{"slug":"tldr-pages","domain":"OPS","topics":[],"ask_for":"an agent scripting an unfamiliar long-tail tool queries this for its example invocations (popular tools are memorised — G3 value is the tail only)","licence_class":"adapt-with-attribution"}
+{"slug":"trivy-checks","domain":"SEC","topics":[],"ask_for":"security","licence_class":"adapt-with-attribution"}
+{"slug":"twelve-factor","domain":"OPS","topics":[],"ask_for":"an agent containerising or configuring an app queries this for the factor's exact statement and rationale (G3 borderline: well-known prose — keep only if G7 shows retrieval value)","licence_class":"adapt-with-attribution"}
+{"slug":"uk-building-regs","domain":"LAW","topics":[],"ask_for":"current UK Building Regulations 2010 text: what work must comply with, materials, loading, exemptions, notices","licence_class":"adapt-with-attribution"}
+{"slug":"uk-legislation","domain":"LAW","topics":[],"ask_for":"an agent answering UK-law questions queries this for what the current statute actually says — Consumer Rights Act remedies, GDPR-adjacent DPA 2018 duties, Building Safety Act duties (demand: legal-courts Ask-HN volume 46; source chosen for best-in-class versioned OGL XML)","licence_class":"adapt-with-attribution"}
+{"slug":"unicode-cldr","domain":"WEB","topics":[],"ask_for":"an agent formatting dates/numbers/names queries this for locale-specific CLDR rules and plural/data tables no model recalls","licence_class":"adapt-with-attribution"}
+{"slug":"unitedstates-citation","domain":"LAW","topics":[],"ask_for":"An agent parsing references to US law (USC/CFR/public laws) queries this for a public-domain legal citation parser and grammar.","licence_class":"adapt-with-attribution"}
+{"slug":"zstd","domain":"NET","topics":[],"ask_for":"an agent tuning compression queries this for frame/block formats, window and level internals","licence_class":"approach-only"}
diff --git a/engine/crates/xerj-hub/tests/identity_routing.rs b/engine/crates/xerj-hub/tests/identity_routing.rs
new file mode 100644
index 000000000..ec2c8862a
--- /dev/null
+++ b/engine/crates/xerj-hub/tests/identity_routing.rs
@@ -0,0 +1,159 @@
+//! Regression for zero-config routing against a catalogue the shape of the live
+//! hub (468 corpora on 2026-10-21, `https://hub.xerj.org/api/v1/catalogue.json`).
+//!
+//! The fixture keeps each corpus's slug, topics, description and licence class.
+//! Sketches are rebuilt here so that every corpus reports every token of the
+//! two Swift questions: that is the saturated-Bloom failure, where `qwik` and
+//! `docker-docs` tie with `swift-book`. Routing has to ignore that and follow
+//! the name.
+
+use std::fs;
+use std::path::Path;
+
+use xerj_hub::router::{route, Routing};
+use xerj_hub::{Catalogue, CatalogueEntry, LicenceClass};
+
+/// Tokens both failing questions tokenize to. Inserted into every sketch.
+const POISON: &[&str] = &[
+ "how", "use", "async", "let", "swift", "Swift", "result", "Result", "type", "map",
+];
+
+fn licence(class: &str) -> LicenceClass {
+ match class {
+ "approach-only" => LicenceClass::ApproachOnly,
+ "excluded" => LicenceClass::Excluded,
+ _ => LicenceClass::AdaptWithAttribution,
+ }
+}
+
+fn catalogue() -> Catalogue {
+ let path =
+ Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/hub-catalogue-identity.jsonl");
+ let text = fs::read_to_string(&path).unwrap_or_else(|e| panic!("read {}: {e}", path.display()));
+ let corpora = text
+ .lines()
+ .filter(|line| !line.trim().is_empty())
+ .map(|line| {
+ let row: serde_json::Value = serde_json::from_str(line).expect("fixture row");
+ let ask_for = row["ask_for"].as_str().unwrap_or("").to_string();
+ let mut terms: Vec<String> = ask_for
+ .split(|c: char| !c.is_ascii_alphanumeric())
+ .filter(|w| w.len() >= 3)
+ .map(|w| w.to_ascii_lowercase())
+ .collect();
+ terms.extend(POISON.iter().map(|s| (*s).to_string()));
+ let topics = row["topics"]
+ .as_array()
+ .map(|a| {
+ a.iter()
+ .filter_map(|v| v.as_str().map(str::to_string))
+ .collect()
+ })
+ .unwrap_or_default();
+ CatalogueEntry {
+ slug: row["slug"].as_str().unwrap_or("").to_string(),
+ domain: row["domain"].as_str().unwrap_or("").to_string(),
+ topics,
+ ask_for,
+ pin_sha: "0".repeat(40),
+ pin_date: "2026-10-21".to_string(),
+ refresh_cadence_days: 7,
+ licence_spdx: "Apache-2.0".to_string(),
+ licence_class: licence(row["licence_class"].as_str().unwrap_or("")),
+ pack_bytes: 0,
+ pack_url: String::new(),
+ pack_sha256: String::new(),
+ sig_url: String::new(),
+ dependency_names: Vec::new(),
+ quality_grade: None,
+ term_sketch: xerj_hub::sketch::build(terms),
+ }
+ })
+ .collect();
+ Catalogue {
+ format_version: 1,
+ generated_at: "2026-10-21T16:40:13Z".to_string(),
+ corpora,
+ }
+}
+
+fn picked(routing: &Routing) -> Vec<String> {
+ match routing {
+ Routing::Confident(slug) => vec![slug.clone()],
+ Routing::Group(slugs) | Routing::Ambiguous(slugs) => slugs.clone(),
+ Routing::NoCorpus => Vec::new(),
+ }
+}
+
+fn route_q(cat: &Catalogue, q: &str) -> Routing {
+ let dir = tempfile::tempdir().unwrap();
+ fs::create_dir(dir.path().join(".git")).unwrap();
+ route(q, dir.path(), cat, None, &[])
+}
+
+#[test]
+fn swift_questions_route_to_the_swift_corpora_on_the_live_catalogue_shape() {
+ let cat = catalogue();
+ assert!(
+ cat.corpora.len() >= 400,
+ "fixture should mirror the live hub, got {} corpora",
+ cat.corpora.len()
+ );
+
+ let async_let = route_q(&cat, "how do I use async let in Swift");
+ assert_eq!(
+ picked(&async_let),
+ vec!["swift-book".to_string(), "swift-evolution".to_string()],
+ "async let: {async_let:?}"
+ );
+ assert!(
+ matches!(async_let, Routing::Group(_)),
+ "a tie between the two Swift corpora is a group, not exit 4: {async_let:?}"
+ );
+
+ let result_map = route_q(&cat, "Swift Result type map");
+ assert_eq!(
+ picked(&result_map),
+ vec!["swift-evolution".to_string(), "swift-book".to_string()],
+ "Result map: {result_map:?}"
+ );
+ for unrelated in ["qwik", "docker-docs", "harper", "oss-review-toolkit"] {
+ assert!(
+ !picked(&async_let).iter().any(|s| s == unrelated),
+ "{unrelated} tied with swift-book"
+ );
+ assert!(
+ !picked(&result_map).iter().any(|s| s == unrelated),
+ "{unrelated} tied on the Result query"
+ );
+ }
+}
+
+#[test]
+fn a_broad_language_with_many_corpora_stays_ambiguous_and_short() {
+ let cat = catalogue();
+ let routing = route_q(&cat, "python");
+ match routing {
+ Routing::Ambiguous(slugs) => {
+ assert!(
+ (2..=5).contains(&slugs.len()),
+ "a few ranked candidates, not the whole catalogue: {slugs:?}"
+ );
+ for slug in &slugs {
+ let entry = cat
+ .corpora
+ .iter()
+ .find(|e| &e.slug == slug)
+ .unwrap_or_else(|| panic!("missing {slug}"));
+ let blob = format!("{} {}", entry.slug, entry.ask_for).to_ascii_lowercase();
+ assert!(
+ blob.split(|c: char| !c.is_ascii_alphanumeric())
+ .any(|w| w == "python"),
+ "{slug} is not a Python corpus: {}",
+ entry.ask_for
+ );
+ }
+ }
+ other => panic!("expected Ambiguous, got {other:?}"),
+ }
+}
diff --git a/engine/crates/xerj-hub/tests/routing.rs b/engine/crates/xerj-hub/tests/routing.rs
index 2fa204cff..ce1e54ec3 100644
--- a/engine/crates/xerj-hub/tests/routing.rs
+++ b/engine/crates/xerj-hub/tests/routing.rs
@@ -253,7 +253,10 @@ fn project_dir(deps: &[String]) -> tempfile::TempDir {
fn top1_ok(routing: &Routing, expected: &str) -> bool {
match routing {
Routing::Confident(slug) => slug == expected,
- Routing::Ambiguous(slugs) => slugs.first().map(|s| s == expected).unwrap_or(false),
+ // A tight group counts when the expected corpus is the one it leads with.
+ Routing::Group(slugs) | Routing::Ambiguous(slugs) => {
+ slugs.first().map(|s| s == expected).unwrap_or(false)
+ }
Routing::NoCorpus => false,
}
}