From 44f8e31d58471bcdf57b1e2f7d8fde503a100ff8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 11:39:12 +0000 Subject: [PATCH 1/7] fix(service-knowledge): refuse a source whose adapter search throws without a code An uncoded throw from an adapter's search (an unreachable embedder, a timeout outside the store) is now a refused entry for that source, coded SERVICE_UNAVAILABLE (503) under a platform sentence, instead of reading as zero hits. The operator error line keeps the thrown message. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v --- .../search-uncoded-throw-38728.test.ts | 110 ++++++++++++++++++ .../src/knowledge-service-search.ts | 18 ++- 2 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts diff --git a/packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts b/packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts new file mode 100644 index 00000000000..f6ce37cfa62 --- /dev/null +++ b/packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts @@ -0,0 +1,110 @@ +// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. + +// An adapter whose `search` throws without an ADR-0112 code (an embedder that +// cannot be reached, a timeout outside the store) is refused for that source, +// never answered as zero hits: the caller reads a `refused` entry naming the +// source, coded SERVICE_UNAVAILABLE (503), under a platform sentence; the +// thrown message reaches the operator's `error` line only. + +import { describe, it, expect, vi } from 'vitest'; +import { KnowledgeService, SEARCH_FIRST_ROUND_FACTOR } from '../knowledge-service.js'; +import type { IKnowledgeAdapter } from '@objectstack/spec/contracts'; +import type { KnowledgeHit, KnowledgeSource, ObjectKnowledgeSource } from '@objectstack/spec/ai'; + +const SYSTEM = { positions: [], permissions: [], isSystem: true }; +const INTERNAL = 'embedder down at http://10.0.0.7:11434 (key sk-secret)'; + +function source(name: string, adapter: string): KnowledgeSource { + return { + name, + label: name, + adapter, + source: { kind: 'object', object: 'task', content: ['title'], metadataFields: ['status'] } as ObjectKnowledgeSource, + }; +} + +function hit(sourceId: string, record: string, n = 0, score = 0.9): KnowledgeHit { + return { chunkId: `${sourceId}:${record}#${n}`, documentId: `${sourceId}:${record}`, sourceId, sourceRecordId: record, score, snippet: 'ok' }; +} + +function adapter(id: string, search: IKnowledgeAdapter['search']): IKnowledgeAdapter { + return { id, upsert: vi.fn(async () => undefined), delete: vi.fn(async () => undefined), search: vi.fn(search) }; +} + +function setup(adapters: IKnowledgeAdapter[]) { + const logger = { debug: vi.fn(), warn: vi.fn(), error: vi.fn() }; + const svc = new KnowledgeService({ logger: logger as never }); + for (const a of adapters) { + svc.registerAdapter(a.id, a); + svc.registerSource(source(a.id, a.id)); + } + return { svc, logger }; +} + +describe('knowledge search: an adapter throw without a code is refused for its source, never zero hits', () => { + it('a plain Error from search: one refused entry naming the source, SERVICE_UNAVAILABLE / 503; other sources still served', async () => { + const { svc, logger } = setup([ + adapter('failing', async () => { throw new Error(INTERNAL); }), + adapter('answering', async () => [hit('answering', 'r1')]), + ]); + const report = await svc.searchWithRefusals('q', { executionContext: SYSTEM }); + expect(report.hits.map((h) => h.documentId)).toEqual(['answering:r1']); + expect(report.refused).toHaveLength(1); + expect(report.refused[0]).toMatchObject({ sourceId: 'failing', code: 'SERVICE_UNAVAILABLE', status: 503 }); + // The caller's sentence names the source; the thrown text stays with the operator. + expect(report.refused[0].message).toContain("source 'failing'"); + expect(report.refused[0].message).not.toContain('10.0.0.7'); + expect(report.refused[0].message).not.toContain('sk-secret'); + expect(logger.error.mock.calls.some(([line]) => String(line).includes(INTERNAL))).toBe(true); + }); + + it('the only source throws uncoded: the search is refused whole, SERVICE_UNAVAILABLE / 503, not answered empty', async () => { + const { svc } = setup([adapter('failing', async () => { throw new Error(INTERNAL); })]); + const thrown = await svc.searchWithRefusals('q', { executionContext: SYSTEM }).then( + () => undefined, + (e: unknown) => e as { code?: string; status?: number; message: string; refused?: Array<{ sourceId: string; code: string }> }, + ); + expect(thrown).toMatchObject({ code: 'SERVICE_UNAVAILABLE', status: 503 }); + expect(thrown?.refused).toEqual([expect.objectContaining({ sourceId: 'failing', code: 'SERVICE_UNAVAILABLE', status: 503 })]); + expect(thrown?.message).not.toContain('sk-secret'); + }); + + it('a coded refusal is unchanged: its own code, status and message', async () => { + const { svc } = setup([ + adapter('refusing', async () => { + throw Object.assign(new Error("Knowledge source 'refusing' needs a rebuild."), { code: 'KNOWLEDGE_REBUILD_REQUIRED', status: 409 }); + }), + adapter('answering', async () => [hit('answering', 'r1')]), + ]); + const report = await svc.searchWithRefusals('q', { executionContext: SYSTEM }); + expect(report.hits.map((h) => h.documentId)).toEqual(['answering:r1']); + expect(report.refused).toEqual([ + { sourceId: 'refusing', code: 'KNOWLEDGE_REBUILD_REQUIRED', status: 409, message: "Knowledge source 'refusing' needs a rebuild." }, + ]); + }); + + it('a source that matches nothing answers no hits and no refusal', async () => { + const { svc, logger } = setup([adapter('empty', async () => [])]); + const report = await svc.searchWithRefusals('q', { executionContext: SYSTEM }); + expect(report).toEqual({ hits: [], refused: [] }); + expect(logger.error).not.toHaveBeenCalled(); + }); + + it('a source that answers the first round and throws uncoded on the refill: refused once, its first-round hits dropped', async () => { + const topK = 5; + let calls = 0; + const { svc } = setup([ + // Round one fills its ask with passages of one record, so the record-level search refills it. + adapter('flaky', async () => { + calls += 1; + if (calls > 1) throw new Error(INTERNAL); + return Array.from({ length: topK * SEARCH_FIRST_ROUND_FACTOR }, (_, n) => hit('flaky', 'r0', n, 1 - n / 1000)); + }), + adapter('answering', async () => [hit('answering', 'r9', 0, 0.5)]), + ]); + const report = await svc.searchWithRefusals('q', { granularity: 'record', topK, executionContext: SYSTEM }); + expect(calls).toBe(2); + expect(report.hits.map((h) => h.sourceId)).toEqual(['answering']); + expect(report.refused).toEqual([expect.objectContaining({ sourceId: 'flaky', code: 'SERVICE_UNAVAILABLE', status: 503 })]); + }); +}); diff --git a/packages/services/service-knowledge/src/knowledge-service-search.ts b/packages/services/service-knowledge/src/knowledge-service-search.ts index e2d2e8e440d..9349e84c772 100644 --- a/packages/services/service-knowledge/src/knowledge-service-search.ts +++ b/packages/services/service-knowledge/src/knowledge-service-search.ts @@ -888,8 +888,12 @@ export async function unprovenIndex(plan: IndexPlan): Promise<{ why: string; end * the adapter returned (`answered`, before a hit naming another source or * outside the scope is dropped — what decides whether the adapter may hold * more). A source whose adapter is unknown or throws is absent from the - * answer: a coded refusal (ADR-0112 `code` and `status`) is added to - * `refused`, anything else is logged. + * answer and named in `refused`, never answered as no hits: a coded refusal + * (ADR-0112 `code` and `status`) keeps its code and message; any other throw + * (an embedder that cannot be reached, a timeout outside the store) is + * refused as ADR-0112 `SERVICE_UNAVAILABLE` (503) under a platform sentence + * naming the source, and its own message goes to the operator's `error` line + * only. * * Under a scope, the adapter is handed the source's terms, and every hit it * answers is checked against them ({@link scopeCheck}, fail closed). The first @@ -956,6 +960,16 @@ export async function searchRound( ); continue; } + // Refused like an adapter that cannot serve, never answered as zero + // hits: the caller is told which source was not searched. The thrown + // message can carry hosts, SQL or keys, so the caller reads a platform + // sentence; the operator reads the adapter's own text here. + refused.push({ + sourceId: source.name, + code: 'SERVICE_UNAVAILABLE', + status: 503, + message: `[knowledge] source '${this.label(source)}' could not be searched: its adapter '${adapterId}' failed.`, + }); this.options.logger?.error?.( `[knowledge] adapter '${adapterId}' search failed for source '${this.label(source)}': ${(err as Error).message}`, ); From 43def1f13bea96937baaa3ef2a1330e6778df991 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 11:46:23 +0000 Subject: [PATCH 2/7] test(service-knowledge): pin the uncoded search refusal; flip the zero-hits pins; changeset Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v --- .changeset/38728-uncoded-search-throw.md | 10 ++++++++ .../src/__tests__/knowledge-service.test.ts | 11 ++++++--- .../knowledge-settings-contribution.test.ts | 24 +++++++++++++++---- .../src/__tests__/knowledge-tools.test.ts | 7 ++++-- 4 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 .changeset/38728-uncoded-search-throw.md diff --git a/.changeset/38728-uncoded-search-throw.md b/.changeset/38728-uncoded-search-throw.md new file mode 100644 index 00000000000..7a695a0f1c3 --- /dev/null +++ b/.changeset/38728-uncoded-search-throw.md @@ -0,0 +1,10 @@ +--- +'@objectstack/service-knowledge': patch +--- + +fix(service-knowledge): a source whose adapter's search throws without a code is refused, never answered as no hits + +Clause-②: no +Metadata-protocol: none + +When a knowledge source's adapter throws from `search` with an error that carries no ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store), the search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal; when no searched source answers, the search is refused whole (the first refusal's code and status, with `refused`), as for coded refusals. A source that answers the first round and fails the refill is refused for the whole search, its first-round hits dropped, as a coded refusal of the refill already was. A coded refusal and a source that matches nothing are unchanged. diff --git a/packages/services/service-knowledge/src/__tests__/knowledge-service.test.ts b/packages/services/service-knowledge/src/__tests__/knowledge-service.test.ts index 4179f73877d..7eb1a35142a 100644 --- a/packages/services/service-knowledge/src/__tests__/knowledge-service.test.ts +++ b/packages/services/service-knowledge/src/__tests__/knowledge-service.test.ts @@ -1533,14 +1533,19 @@ describe('KnowledgeService — search refills after the permission filter', () = expect(asked()).toEqual([['s1', 15], ['s2', 15], ['s1', 60]]); }); - it('a refill the adapter fails keeps the source\'s round-one survivors', async () => { + it('a refill the adapter fails without a code refuses the source, as a coded refusal of the refill does', async () => { const { svc, adapter } = setup({ s1: rankedHits('s1', 100) }, ['rec_2']); const first = adapter.searchSpy.getMockImplementation()!; adapter.searchSpy.mockImplementationOnce(first).mockImplementationOnce(async () => { throw new Error('store unavailable'); }); - const out = await svc.search('q', { topK: 5, executionContext: MEMBER }); - expect(out.map((h) => h.sourceRecordId)).toEqual(['rec_2']); + // The only source refused the refill: its round-one survivors are dropped + // and the search is refused whole, never answered with a partial read. + await expect(svc.search('q', { topK: 5, executionContext: MEMBER })).rejects.toMatchObject({ + code: 'SERVICE_UNAVAILABLE', + status: 503, + refused: [expect.objectContaining({ sourceId: 's1', code: 'SERVICE_UNAVAILABLE', status: 503 })], + }); expect(adapter.searchSpy).toHaveBeenCalledTimes(2); }); diff --git a/packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts b/packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts index 1a391754a48..4499ab1c945 100644 --- a/packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts +++ b/packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts @@ -616,11 +616,16 @@ describe('#37094 — the open edition registers EMBEDDER_SERVICE from the ai.emb const named = /No embedder is configured[\s\S]*ai\.embedder_provider[\s\S]*restart/; await expect(indexOne(knowledge, 'hello')).rejects.toThrow(named); - // The adapter's search answers the error; the service's search reports it - // per source and answers no hits. + // The adapter's search answers the error; the service's search refuses + // the source (never no hits), and the only source refused refuses the + // whole search. The embedder's own text stays on the operator's line. await expect(knowledge.getAdapter('vec').search('hello', { source: knowledge.getSource('docs')!, topK: 5 })) .rejects.toThrow(named); - await expect(knowledge.search('hello', { sourceIds: ['docs'], executionContext: SYSTEM })).resolves.toEqual([]); + await expect(knowledge.search('hello', { sourceIds: ['docs'], executionContext: SYSTEM })).rejects.toMatchObject({ + code: 'SERVICE_UNAVAILABLE', + status: 503, + refused: [expect.objectContaining({ sourceId: 'docs', code: 'SERVICE_UNAVAILABLE', status: 503 })], + }); expect(lines.some((l) => l.level === 'error' && named.test(l.line))).toBe(true); // A vector column cannot be sized from it either. expect(() => embedder.dimensions).toThrow(named); @@ -740,7 +745,12 @@ describe('#37094 — the open edition registers EMBEDDER_SERVICE from the ai.emb (err: unknown) => err as Error, ); expect(failure.message).not.toContain(API_KEY); - await rejected.knowledge.search('hello', { sourceIds: ['docs'], executionContext: SYSTEM }); + const searched = await rejected.knowledge.search('hello', { sourceIds: ['docs'], executionContext: SYSTEM }).then( + () => { throw new Error('expected a refusal'); }, + (err: unknown) => err as Error & { code?: string; status?: number }, + ); + expect(searched).toMatchObject({ code: 'SERVICE_UNAVAILABLE', status: 503 }); + expect(searched.message).not.toContain(API_KEY); expect(requests.length).toBeGreaterThan(0); expect(rejected.lines.filter((l) => l.line.includes(API_KEY))).toEqual([]); }); @@ -1061,7 +1071,11 @@ describe('[ADR-0161 K8, note on item 12] a runtime-composed knowledge service is expect(heldLines()).toEqual([]); expect(knowledge.knowledgeTools().definitions.map((d) => d.name)).toEqual(['search_knowledge']); expect(lines.some((l) => l.level === 'info' && l.line.includes('no embedder is configured ('))).toBe(true); - await expect(knowledge.search('granite', { sourceIds: ['docs'], executionContext: SYSTEM })).resolves.toEqual([]); + await expect(knowledge.search('granite', { sourceIds: ['docs'], executionContext: SYSTEM })).rejects.toMatchObject({ + code: 'SERVICE_UNAVAILABLE', + status: 503, + refused: [expect.objectContaining({ sourceId: 'docs', code: 'SERVICE_UNAVAILABLE', status: 503 })], + }); expect(calls).toContain('search'); }); }); diff --git a/packages/services/service-knowledge/src/__tests__/knowledge-tools.test.ts b/packages/services/service-knowledge/src/__tests__/knowledge-tools.test.ts index b027f228861..c0dd5d9bec6 100644 --- a/packages/services/service-knowledge/src/__tests__/knowledge-tools.test.ts +++ b/packages/services/service-knowledge/src/__tests__/knowledge-tools.test.ts @@ -258,11 +258,14 @@ describe('search_knowledge — a refused source (ADR-0161 K7, rule 5)', () => { }); }); - it('control: a failure without a code is logged and skipped as before, and carries no refused list', async () => { + it('a failure without a code refuses its source as SERVICE_UNAVAILABLE, its own text withheld — never no hits', async () => { const answer = await createKnowledgeTools(twoSources(['policy_clauses'], () => new Error('socket hang up'))) .searchKnowledge({ query: 'q' }, caller); expect(answer.hits.map((h) => h.sourceId)).toEqual(['faq']); - expect(answer).not.toHaveProperty('refused'); + expect(answer.refused).toEqual([ + { sourceId: 'policy_clauses', code: 'SERVICE_UNAVAILABLE', message: expect.stringContaining("source 'policy_clauses'") }, + ]); + expect(answer.refused?.[0].message).not.toContain('socket hang up'); }); it('an answer with nothing refused carries no refused list', async () => { From e52b7626ea6471c7653b27195e26bfd61a470b96 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 12:09:37 +0000 Subject: [PATCH 3/7] docs(changeset): state the caller-facing 503 for an uncoded search throw Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v --- .changeset/38728-uncoded-search-throw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/38728-uncoded-search-throw.md b/.changeset/38728-uncoded-search-throw.md index 7a695a0f1c3..8a9c5a77c0c 100644 --- a/.changeset/38728-uncoded-search-throw.md +++ b/.changeset/38728-uncoded-search-throw.md @@ -7,4 +7,4 @@ fix(service-knowledge): a source whose adapter's search throws without a code is Clause-②: no Metadata-protocol: none -When a knowledge source's adapter throws from `search` with an error that carries no ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store), the search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal; when no searched source answers, the search is refused whole (the first refusal's code and status, with `refused`), as for coded refusals. A source that answers the first round and fails the refill is refused for the whole search, its first-round hits dropped, as a coded refusal of the refill already was. A coded refusal and a source that matches nothing are unchanged. +When a knowledge source's adapter throws from `search` with an error that carries no ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store), the search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal; when no searched source answers, the search is refused whole (the first refusal's code and status, with `refused`), as for coded refusals. A source that answers the first round and fails the refill is refused for the whole search, its first-round hits dropped, as a coded refusal of the refill already was. Behaviour change for callers: when the only searched source's adapter throws without a code, the search is now refused (503 `SERVICE_UNAVAILABLE`, its `refused` naming the source) instead of answering no hits; when other sources are searched too, those still answer and the failing one is listed in `refused`. A coded refusal and a source that matches nothing are unchanged. From 6348efa9497d57cd5fadc495ae3b7eb613341748 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 12:21:49 +0000 Subject: [PATCH 4/7] test(knowledge-pgvector): the bench's failed-embed pin reads the uncoded refusal Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v --- .../knowledge-pgvector/bench/instrument.test.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/plugins/knowledge-pgvector/bench/instrument.test.mjs b/packages/plugins/knowledge-pgvector/bench/instrument.test.mjs index 0f75ace6f3c..6ca505d379c 100644 --- a/packages/plugins/knowledge-pgvector/bench/instrument.test.mjs +++ b/packages/plugins/knowledge-pgvector/bench/instrument.test.mjs @@ -196,14 +196,19 @@ describe('bench instrument — segment seams over the real adapter and service', expect(extractRankingWhere('WITH cand AS (SELECT chunk_id, 0 AS distance FROM t WHERE x)', ['a', 1, 5])).toBeUndefined(); }); - it('a failed embed is counted, and the search answers no hit with the service\'s "search failed" line', async () => { + it('a failed embed is counted, and the search is refused SERVICE_UNAVAILABLE naming the source, with the service\'s "search failed" line', async () => { const { search, errors } = setup({ failEmbed: true }); const outcome = await search({ query: 'leave policy', topK: TOP_K }, CALLER); const s = summarizeRecord(outcome); expect(s.embedFailures).toBe(1); expect(s.calls.ranking).toBe(0); - expect(s.ok).toBe(true); - expect(s.hits).toBe(0); + expect(s.ok).toBe(false); + expect(s.errorCode).toBe('SERVICE_UNAVAILABLE'); + expect(outcome.error).toMatchObject({ + code: 'SERVICE_UNAVAILABLE', + status: 503, + refused: [expect.objectContaining({ sourceId: 'clauses', code: 'SERVICE_UNAVAILABLE', status: 503 })], + }); expect(errors.filter((m) => /search failed/.test(m))).toHaveLength(1); }); }); From 4dc17a185864581230c46dfc8f23328fd2b13f71 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 12:58:28 +0000 Subject: [PATCH 5/7] docs(changeset): declare the uncoded-search refusal as a narrowing, with FROM -> TO Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v --- .changeset/38728-uncoded-search-throw.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.changeset/38728-uncoded-search-throw.md b/.changeset/38728-uncoded-search-throw.md index 8a9c5a77c0c..37ad94a1954 100644 --- a/.changeset/38728-uncoded-search-throw.md +++ b/.changeset/38728-uncoded-search-throw.md @@ -2,9 +2,18 @@ '@objectstack/service-knowledge': patch --- -fix(service-knowledge): a source whose adapter's search throws without a code is refused, never answered as no hits +fix(service-knowledge)!: a source whose adapter's search throws without a code is refused, never answered as no hits -Clause-②: no +Clause-②: no (narrowing) Metadata-protocol: none -When a knowledge source's adapter throws from `search` with an error that carries no ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store), the search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal; when no searched source answers, the search is refused whole (the first refusal's code and status, with `refused`), as for coded refusals. A source that answers the first round and fails the refill is refused for the whole search, its first-round hits dropped, as a coded refusal of the refill already was. Behaviour change for callers: when the only searched source's adapter throws without a code, the search is now refused (503 `SERVICE_UNAVAILABLE`, its `refused` naming the source) instead of answering no hits; when other sources are searched too, those still answer and the failing one is listed in `refused`. A coded refusal and a source that matches nothing are unchanged. + + +**BREAKING** for a caller of a knowledge search (the `search_knowledge` tool, its MCP HTTP and stdio faces, and in-process `KnowledgeService.search` / `searchWithRefusals`) when a source's adapter throws from `search` with an error that carries no ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store). The search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal. A coded refusal and a source that matches nothing are unchanged. + +## FROM → TO + +- The only searched source's adapter throws without a code. FROM: the search succeeded with `{ hits: [] }`. TO: the search is rejected `SERVICE_UNAVAILABLE` / 503 with `refused` naming the source (the `search_knowledge` executor rejects, MCP answers an error result with that envelope, in-process `search` rejects). +- A refill fails without a code. FROM: the source's round-one survivors were served. TO: they are dropped and the source is refused for the whole search, as a coded refusal of the refill already was. + +A caller reads `refused` and the 503 instead of treating an empty answer as no match. An operator repairs the adapter or embedder the `error` line names. From a6416d79bd110bbcc059ade5bece7eb5cfc65936 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 13:02:18 +0000 Subject: [PATCH 6/7] fix(spec): register the knowledge-search uncoded-throw refusal in the ADR-0087 ledger Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v --- .changeset/38728-uncoded-search-throw.md | 5 ++- ...ge-search-uncoded-adapter-throw-refused.ts | 38 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts diff --git a/.changeset/38728-uncoded-search-throw.md b/.changeset/38728-uncoded-search-throw.md index 37ad94a1954..f47b0264d1e 100644 --- a/.changeset/38728-uncoded-search-throw.md +++ b/.changeset/38728-uncoded-search-throw.md @@ -1,5 +1,6 @@ --- '@objectstack/service-knowledge': patch +'@objectstack/spec': patch --- fix(service-knowledge)!: a source whose adapter's search throws without a code is refused, never answered as no hits @@ -7,7 +8,7 @@ fix(service-knowledge)!: a source whose adapter's search throws without a code i Clause-②: no (narrowing) Metadata-protocol: none - + **BREAKING** for a caller of a knowledge search (the `search_knowledge` tool, its MCP HTTP and stdio faces, and in-process `KnowledgeService.search` / `searchWithRefusals`) when a source's adapter throws from `search` with an error that carries no ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store). The search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal. A coded refusal and a source that matches nothing are unchanged. @@ -17,3 +18,5 @@ Metadata-protocol: none - A refill fails without a code. FROM: the source's round-one survivors were served. TO: they are dropped and the source is refused for the whole search, as a coded refusal of the refill already was. A caller reads `refused` and the 503 instead of treating an empty answer as no match. An operator repairs the adapter or embedder the `error` line names. + +`@objectstack/spec` adds only the upgrade-guide entry `knowledge-search-uncoded-adapter-throw-refused`. diff --git a/packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts b/packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts new file mode 100644 index 00000000000..db029b948b8 --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts @@ -0,0 +1,38 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// #38728 — a knowledge search (@objectstack/service-knowledge) whose source's +// adapter throws from `search` with an error that carries no ADR-0112 `code` +// and `status` (an embedder that cannot be reached, a timeout outside the +// store) now refuses that source as SERVICE_UNAVAILABLE (503) instead of +// answering it as no hits. It narrows what a search answers with success; no +// metadata key or schema changes, so there is no tombstone and no stored row +// to rewrite. Not converted: what a caller does with a refused source is the +// caller's code, not metadata. +export const entry: SemanticMigration = { + id: 'knowledge-search-uncoded-adapter-throw-refused', + surface: + 'A knowledge search through the search_knowledge tool (its executor, and its MCP HTTP and stdio faces) or the ' + + 'in-process KnowledgeService.search / searchWithRefusals, when a searched source\'s adapter throws from search ' + + 'with an error that carries no ADR-0112 code and status: (a) the only searched source throws, which answered ' + + 'success with no hits; (b) a source that answered the first round throws on the refill, whose first-round ' + + 'survivors were served', + replacement: + 'Read refused and the 503 instead of treating an empty answer as no match: (a) the search is rejected ' + + 'SERVICE_UNAVAILABLE / 503 with refused naming the source (the search_knowledge executor rejects, MCP answers ' + + 'an error result with that envelope, in-process search rejects); with other sources searched too, those still ' + + 'answer and the failing one is listed in refused; (b) the source\'s first-round hits are dropped and it is ' + + 'refused for the whole search, as a coded refusal of the refill already was. An operator repairs the adapter ' + + 'or embedder the service\'s error log line names.', + reason: + 'An adapter that throws did not search its source, so answering it as no hits told the caller that nothing ' + + 'matched when nothing was looked at. A coded refusal was already named in refused; an uncoded throw now is ' + + 'too, under the code this service already answers for an adapter that cannot serve. The caller reads a ' + + 'platform sentence naming the source, never the thrown message, which can carry hosts, SQL or keys; the ' + + 'operator\'s error line keeps it. No stored metadata changes shape and nothing is refused at boot or at save.', + acceptanceCriteria: + 'With every knowledge source\'s adapter and embedder reachable, a search answers as before: hits, and refused ' + + 'empty. A search whose adapter is made to throw answers refused naming that source with code ' + + 'SERVICE_UNAVAILABLE, and, when it is the only source searched, rejects with status 503.', +}; From 5e17df249a7cb8e7f5db96135b8699eedb46ce6b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 14:18:59 +0000 Subject: [PATCH 7/7] docs(service-knowledge): carry the uncoded-throw refusal to the public docblocks and the upgrade entry Contract review S1/S2 and nits N1-N3: the search, searchWithRefusals, KnowledgeSearchRefusal and SearchKnowledgeRefusedSource docblocks state the uncoded-throw outcome; the semantic entry and the changeset word cell (a) as "no searched source answers and at least one threw without a code", naming the all-throw and the mixed cell; the MCP rejection envelope is code, message and status; the searchRound catch uses UNMOUNTED_ADAPTER_CODE. New pins for the all-throw and the mixed cell. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v --- .changeset/38728-uncoded-search-throw.md | 8 ++-- .../search-uncoded-throw-38728.test.ts | 37 +++++++++++++++- .../src/knowledge-service-search.ts | 3 +- .../src/knowledge-service-top-level.ts | 15 +++++-- .../src/knowledge-service.ts | 30 +++++++------ .../service-knowledge/src/knowledge-tools.ts | 8 +++- ...ge-search-uncoded-adapter-throw-refused.ts | 42 +++++++++++-------- 7 files changed, 103 insertions(+), 40 deletions(-) diff --git a/.changeset/38728-uncoded-search-throw.md b/.changeset/38728-uncoded-search-throw.md index f47b0264d1e..304e05112e8 100644 --- a/.changeset/38728-uncoded-search-throw.md +++ b/.changeset/38728-uncoded-search-throw.md @@ -10,13 +10,15 @@ Metadata-protocol: none -**BREAKING** for a caller of a knowledge search (the `search_knowledge` tool, its MCP HTTP and stdio faces, and in-process `KnowledgeService.search` / `searchWithRefusals`) when a source's adapter throws from `search` with an error that carries no ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store). The search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal. A coded refusal and a source that matches nothing are unchanged. +**BREAKING** for a caller of a knowledge search (the `search_knowledge` tool, its MCP HTTP and stdio faces, and in-process `KnowledgeService.search` / `searchWithRefusals`) when a source's adapter throws from `search` with an error that does not carry both an ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout outside the store). The search now names that source in `refused`, coded `SERVICE_UNAVAILABLE` (503), with a platform sentence naming the source; before, the source read as if it had matched nothing. The thrown message is not shown to the caller (it can carry hosts, SQL or keys); the operator's `error` log line keeps it, as before. Sources that answer are still served beside the refusal. A source that matches nothing is unchanged, and so is a coded refusal's own `refused` entry; a whole rejection that also names an uncoded throw may take that throw's top-level code (cell 2 below). ## FROM → TO -- The only searched source's adapter throws without a code. FROM: the search succeeded with `{ hits: [] }`. TO: the search is rejected `SERVICE_UNAVAILABLE` / 503 with `refused` naming the source (the `search_knowledge` executor rejects, MCP answers an error result with that envelope, in-process `search` rejects). +- No searched source answers and at least one threw without a code — two cells: + 1. Every searched source throws without a code (one source, or several failing on the same embedder outage). FROM: the search succeeded with `{ hits: [] }`. TO: the search is rejected `SERVICE_UNAVAILABLE` / 503 with `refused` naming each source (the `search_knowledge` executor and in-process `search` reject with `refused`; MCP answers an error result whose envelope is `code`, `message` and `status`, the sources named in the message). + 2. A source throws without a code beside a source refused with a code, none answering. FROM: rejected with the coded source's `code` / `status` and `refused` naming it alone. TO: `refused` names both, and the rejection's top-level `code` / `status` are the first refusal's in source order, so a 409 `KNOWLEDGE_REBUILD_REQUIRED` rejection may now read 503 `SERVICE_UNAVAILABLE`. - A refill fails without a code. FROM: the source's round-one survivors were served. TO: they are dropped and the source is refused for the whole search, as a coded refusal of the refill already was. -A caller reads `refused` and the 503 instead of treating an empty answer as no match. An operator repairs the adapter or embedder the `error` line names. +A caller reads `refused` (each source's own `code`, not only the top-level one) and the 503 instead of treating an empty answer as no match. An operator repairs the adapter or embedder the `error` line names. `@objectstack/spec` adds only the upgrade-guide entry `knowledge-search-uncoded-adapter-throw-refused`. diff --git a/packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts b/packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts index f6ce37cfa62..fd766f2f8fd 100644 --- a/packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts +++ b/packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts @@ -1,6 +1,6 @@ // Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. -// An adapter whose `search` throws without an ADR-0112 code (an embedder that +// An adapter whose `search` throws without both an ADR-0112 `code` and `status` (an embedder that // cannot be reached, a timeout outside the store) is refused for that source, // never answered as zero hits: the caller reads a `refused` entry naming the // source, coded SERVICE_UNAVAILABLE (503), under a platform sentence; the @@ -69,6 +69,41 @@ describe('knowledge search: an adapter throw without a code is refused for its s expect(thrown?.message).not.toContain('sk-secret'); }); + it('every searched source throws uncoded (an embedder outage): refused whole, 503, refused naming each', async () => { + const { svc } = setup([ + adapter('first', async () => { throw new Error(INTERNAL); }), + adapter('second', async () => { throw new Error(INTERNAL); }), + ]); + const thrown = await svc.searchWithRefusals('q', { executionContext: SYSTEM }).then( + () => undefined, + (e: unknown) => e as { code?: string; status?: number; message: string; refused?: Array<{ sourceId: string; code: string }> }, + ); + expect(thrown).toMatchObject({ code: 'SERVICE_UNAVAILABLE', status: 503 }); + expect(thrown?.refused?.map((r) => [r.sourceId, r.code])).toEqual([ + ['first', 'SERVICE_UNAVAILABLE'], + ['second', 'SERVICE_UNAVAILABLE'], + ]); + expect(thrown?.message).not.toContain('sk-secret'); + }); + + it('an uncoded throw beside a coded refusal, none answering: refused names both, top-level code is the first in source order', async () => { + const { svc } = setup([ + adapter('failing', async () => { throw new Error(INTERNAL); }), + adapter('refusing', async () => { + throw Object.assign(new Error("Knowledge source 'refusing' needs a rebuild."), { code: 'KNOWLEDGE_REBUILD_REQUIRED', status: 409 }); + }), + ]); + const thrown = await svc.searchWithRefusals('q', { executionContext: SYSTEM }).then( + () => undefined, + (e: unknown) => e as { code?: string; status?: number; message: string; refused?: Array<{ sourceId: string; code: string; status: number }> }, + ); + expect(thrown).toMatchObject({ code: 'SERVICE_UNAVAILABLE', status: 503 }); + expect(thrown?.refused?.map((r) => [r.sourceId, r.code, r.status])).toEqual([ + ['failing', 'SERVICE_UNAVAILABLE', 503], + ['refusing', 'KNOWLEDGE_REBUILD_REQUIRED', 409], + ]); + }); + it('a coded refusal is unchanged: its own code, status and message', async () => { const { svc } = setup([ adapter('refusing', async () => { diff --git a/packages/services/service-knowledge/src/knowledge-service-search.ts b/packages/services/service-knowledge/src/knowledge-service-search.ts index 9349e84c772..1419d0cacde 100644 --- a/packages/services/service-knowledge/src/knowledge-service-search.ts +++ b/packages/services/service-knowledge/src/knowledge-service-search.ts @@ -62,6 +62,7 @@ import { SEARCH_FRESHNESS_ROUNDS, SEARCH_REFILL_FACTOR, type SearchTarget, + UNMOUNTED_ADAPTER_CODE, UNPROVEN_CALLER_TEXT, UNPROVEN_OPERATOR_TEXT, type UnprovenEnd, @@ -966,7 +967,7 @@ export async function searchRound( // sentence; the operator reads the adapter's own text here. refused.push({ sourceId: source.name, - code: 'SERVICE_UNAVAILABLE', + code: UNMOUNTED_ADAPTER_CODE, status: 503, message: `[knowledge] source '${this.label(source)}' could not be searched: its adapter '${adapterId}' failed.`, }); diff --git a/packages/services/service-knowledge/src/knowledge-service-top-level.ts b/packages/services/service-knowledge/src/knowledge-service-top-level.ts index 21c8398272a..edf53f007b9 100644 --- a/packages/services/service-knowledge/src/knowledge-service-top-level.ts +++ b/packages/services/service-knowledge/src/knowledge-service-top-level.ts @@ -281,15 +281,22 @@ export function describeName(input: unknown): string { /** * A source that refused a search (ADR-0161 K7, rule 5): its adapter answered * an ADR-0112 coded error — `KNOWLEDGE_REBUILD_REQUIRED` when its index holds - * another fingerprint than the one the search carried. + * another fingerprint than the one the search carried — or threw without both + * an ADR-0112 `code` and `status`. For such an uncoded throw, `code`, `status` + * and `message` are the platform's (`SERVICE_UNAVAILABLE`, 503, a sentence + * naming the source), and the message is deliberately not the adapter's text, + * which goes to the operator's `error` line only. */ export interface KnowledgeSearchRefusal { sourceId: string; - /** The adapter's error code. */ + /** The adapter's error code; `SERVICE_UNAVAILABLE` for an uncoded throw. */ code: string; - /** The adapter's HTTP-shaped status. */ + /** The adapter's HTTP-shaped status; 503 for an uncoded throw. */ status: number; - /** The adapter's message, which says what to do. */ + /** + * The adapter's message, which says what to do; for an uncoded throw, the + * platform's sentence naming the source, never the adapter's text. + */ message: string; } diff --git a/packages/services/service-knowledge/src/knowledge-service.ts b/packages/services/service-knowledge/src/knowledge-service.ts index 1382ceaf226..4e82da421ce 100644 --- a/packages/services/service-knowledge/src/knowledge-service.ts +++ b/packages/services/service-knowledge/src/knowledge-service.ts @@ -978,16 +978,21 @@ export class KnowledgeService implements IKnowledgeService { * Each source is searched under the fingerprint the service expects of its * index ({@link planIndex}). An adapter whose index holds another — the * source needs a rebuild, or is being rebuilt — refuses with an ADR-0112 - * coded error, and so may any adapter for a reason it codes. A coded refusal - * is not logged and dropped like a failure: the sources that can be searched - * answer, and when NONE can, the call is refused whole — this method throws - * a coded error naming each refused source with its code. When some answer, + * coded error, and so may any adapter for a reason it codes. An adapter + * that throws without both an ADR-0112 `code` and `status` (an embedder + * that cannot be reached, a timeout outside the store) is refused too, as + * `SERVICE_UNAVAILABLE` (503) under a platform sentence naming the source; + * its own message goes to the operator's `error` line only. No refused + * source is answered as no hits: the sources that can be searched answer, + * and when NONE can, the call is refused whole — this method throws a coded + * error naming each refused source with its code, its own `code` and + * `status` those of the first refusal in source order. When some answer, * the hits are theirs. A source that answers the first round and refuses the * refill is refused for the whole search, its first-round hits dropped: no - * source is both answered and named as refused. A refused source is named - * with its code and the adapter's one-sentence message; the adapter's - * `remedy`, operator text such as the SQL to run, goes to the `warn` log - * with it and never to the caller. The + * source is both answered and named as refused. A source refused with a + * code is named with that code and the adapter's one-sentence message; the + * adapter's `remedy`, operator text such as the SQL to run, goes to the + * `warn` log with it and never to the caller. The * return type of `IKnowledgeService.search` has no place to name them, so a * caller that must name them to its own caller (the `search_knowledge` tool) * reads {@link searchWithRefusals}. @@ -998,10 +1003,11 @@ export class KnowledgeService implements IKnowledgeService { /** * {@link search}, answering the refused sources beside the hits: each - * source whose adapter refused with an ADR-0112 coded error, with its code. - * Throws a coded error when no source could be searched and at least one - * refused (the call refused whole, ADR-0161 K7, rule 5); the thrown error's - * `refused` lists them all. + * source whose adapter refused with an ADR-0112 coded error, with its code, + * and each whose adapter threw without one, as `SERVICE_UNAVAILABLE` (503) + * under a platform sentence. Throws a coded error when no source could be + * searched and at least one refused (the call refused whole, ADR-0161 K7, + * rule 5); the thrown error's `refused` lists them all. */ searchWithRefusals(query: string, opts?: KnowledgeSearchOptions): Promise { return KnowledgeSearchFacet.searchWithRefusals.call(knowledgeServiceHost.of(this), query, opts); diff --git a/packages/services/service-knowledge/src/knowledge-tools.ts b/packages/services/service-knowledge/src/knowledge-tools.ts index 9cab070bb5a..31315f82e45 100644 --- a/packages/services/service-knowledge/src/knowledge-tools.ts +++ b/packages/services/service-knowledge/src/knowledge-tools.ts @@ -170,14 +170,18 @@ export interface SearchKnowledgeHit { /** * A source that could not be searched for this call (ADR-0161 K7, rule 5): * its index needs a rebuild, or is being rebuilt, or its store refused for - * another coded reason. Its passages are missing from `hits` — not absent + * another coded reason, or its adapter failed without a code (answered as + * `SERVICE_UNAVAILABLE`). Its passages are missing from `hits` — not absent * from the source. */ export interface SearchKnowledgeRefusedSource { sourceId: string; /** The refusal's ADR-0112 code, e.g. `KNOWLEDGE_REBUILD_REQUIRED`. */ code: string; - /** What the store said. */ + /** + * What the store said; for an adapter that failed without a code, the + * platform's sentence naming the source, never the adapter's own text. + */ message: string; } diff --git a/packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts b/packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts index db029b948b8..1af8e3ecd49 100644 --- a/packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts +++ b/packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts @@ -3,28 +3,35 @@ import type { SemanticMigration } from '../../types.js'; // #38728 — a knowledge search (@objectstack/service-knowledge) whose source's -// adapter throws from `search` with an error that carries no ADR-0112 `code` -// and `status` (an embedder that cannot be reached, a timeout outside the -// store) now refuses that source as SERVICE_UNAVAILABLE (503) instead of -// answering it as no hits. It narrows what a search answers with success; no -// metadata key or schema changes, so there is no tombstone and no stored row -// to rewrite. Not converted: what a caller does with a refused source is the -// caller's code, not metadata. +// adapter throws from `search` with an error that does not carry both an +// ADR-0112 `code` and `status` (an embedder that cannot be reached, a timeout +// outside the store) now refuses that source as SERVICE_UNAVAILABLE (503) +// instead of answering it as no hits. It narrows what a search answers with +// success; no metadata key or schema changes, so there is no tombstone and no +// stored row to rewrite. Not converted: what a caller does with a refused +// source is the caller's code, not metadata. export const entry: SemanticMigration = { id: 'knowledge-search-uncoded-adapter-throw-refused', surface: 'A knowledge search through the search_knowledge tool (its executor, and its MCP HTTP and stdio faces) or the ' + 'in-process KnowledgeService.search / searchWithRefusals, when a searched source\'s adapter throws from search ' - + 'with an error that carries no ADR-0112 code and status: (a) the only searched source throws, which answered ' - + 'success with no hits; (b) a source that answered the first round throws on the refill, whose first-round ' - + 'survivors were served', + + 'with an error that does not carry both an ADR-0112 code and status: (a) no searched source answers and at ' + + 'least one threw without a code, in two cells: (a1) every searched source throws without a code (one source, ' + + 'or several failing on the same embedder outage), which answered success with no hits; (a2) a source throws ' + + 'without a code beside a source refused with a code, none answering, which was rejected with the coded ' + + 'source\'s code and status and refused naming it alone; (b) a source that answered the first round throws on ' + + 'the refill, whose first-round survivors were served', replacement: - 'Read refused and the 503 instead of treating an empty answer as no match: (a) the search is rejected ' - + 'SERVICE_UNAVAILABLE / 503 with refused naming the source (the search_knowledge executor rejects, MCP answers ' - + 'an error result with that envelope, in-process search rejects); with other sources searched too, those still ' - + 'answer and the failing one is listed in refused; (b) the source\'s first-round hits are dropped and it is ' - + 'refused for the whole search, as a coded refusal of the refill already was. An operator repairs the adapter ' - + 'or embedder the service\'s error log line names.', + 'Read refused and the 503 instead of treating an empty answer as no match: (a1) the search is rejected ' + + 'SERVICE_UNAVAILABLE / 503 with refused naming each source (the search_knowledge executor and in-process ' + + 'search reject with refused; MCP answers an error result whose envelope is code, message and status, the ' + + 'sources named in the message); (a2) the search is rejected with refused naming both sources, and the ' + + 'rejection\'s own code and status are those of the first refusal in source order, so a 409 ' + + 'KNOWLEDGE_REBUILD_REQUIRED rejection may now read 503 SERVICE_UNAVAILABLE: read each source\'s code in ' + + 'refused, not only the top-level code. When any searched source answers, its hits are still served and the ' + + 'failing one is listed in refused. (b) the source\'s first-round hits are dropped and it is refused for the ' + + 'whole search, as a coded refusal of the refill already was. An operator repairs the adapter or embedder the ' + + 'service\'s error log line names.', reason: 'An adapter that throws did not search its source, so answering it as no hits told the caller that nothing ' + 'matched when nothing was looked at. A coded refusal was already named in refused; an uncoded throw now is ' @@ -34,5 +41,6 @@ export const entry: SemanticMigration = { acceptanceCriteria: 'With every knowledge source\'s adapter and embedder reachable, a search answers as before: hits, and refused ' + 'empty. A search whose adapter is made to throw answers refused naming that source with code ' - + 'SERVICE_UNAVAILABLE, and, when it is the only source searched, rejects with status 503.', + + 'SERVICE_UNAVAILABLE; when no searched source answers and at least one threw without a code, it rejects, with ' + + 'status 503 when every searched source threw without a code, and with refused naming every refused source.', };