Skip to content

service-knowledge searchRound: an adapter throw without a code, such as an embedder failure, reads as zero hits for that source, with no refusal #38728

Description

@objectstack-fleet

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Filed as a finding by seat repo:objectstack#3. The finding comes from the #38718 dev report and was left unfiled in hand-off 7272402015 on topic #38703. That hand-off's correction (7272436685) gives seat 3 the call on whether to file it. Not triaged and not claimed. This is not a phase-3 item of #38703; the maintainer's 「第三期不处理」 stands.

Class: a (the platform does the wrong thing) · Grade: p2 · Reach: every knowledge search whose adapter throws an error that carries no ADR-0112 code, such as an embedder that cannot be reached or a timeout outside the database. The caller is answered as if that source matched nothing.

What

searchRound (packages/services/service-knowledge/src/knowledge-service-search.ts, at origin/main) catches an adapter's throw. A coded refusal (codedRefusalOf(err)) is pushed to refused, so the caller is told which source was not searched and why. Any other throw is logged at error only. The source is then absent from the round's map and from refused alike, so the answer cannot be told from a source that matched nothing. The function's docblock says this ("anything else is logged"). It goes against the topic's ruled direction for #38718 (B2, 「检索出错要报错不要空结果」): #38718 / PR #38726 make the pgvector adapter's own failures coded, but a throw from outside the database, the embedder's first, still lands here uncoded.

Ask

An uncoded throw from an adapter's search is answered to the caller as a refusal for that source, under a code minted for it or an existing one (the dev's call, ADR-0112), not as zero hits. The operator line stays. Pins: an adapter that throws a plain Error gives the caller a refused entry naming the source; a coded refusal is unchanged; a source that matches nothing still answers no hits and no refusal.

Likely lane

domain:server (@objectstack/service-knowledge), area:ai. PR #38726 (#38718) touches no file of service-knowledge; read the overlap at claim.

Re-check

Mount a knowledge source whose adapter's search throws new Error('embedder down'), search it, and read the answer's hits and refused.

Activity

  1. added
    finding
    on Nov 30, 2026
  2. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ

    Triage: lands in packages/services/service-knowledge/src/knowledge-service-search.ts searchRound (an uncoded adapter throw is logged and dropped, so the source reads as zero hits with no refusal) · area:ai · domain:server · Bug · p2 · pm:queue · size S.
    Grade: area:ai · Bug · Impeded (an unreachable embedder or a timeout outside the database answers "nothing matched"; a read shown wrongly, not a stored value) · end users, daily (every knowledge question whose adapter throws uncoded) · read from the code and the #38718 dev report, not reproduced.
    Rationale: the North Star table gives p2 for Impeded at end-user daily reach. It completes #38718's "an error never becomes an empty result" for throws from outside the database, so the seat that holds #38718 should read it next; it touches service-knowledge, which PR #38726 does not. The topic's pause on new knowledge work governs when it is dispatched, not its grade. finding comes off with the grade. Answers knock 7272637954.

  3. added
    area:ai
    domain:server
    pm:queue
    priority:p2
    and removed
    finding
    on Nov 30, 2026
  4. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

    Claim: PM loop round 1
    Session: session_01ADHkmPDtfMCw4FJfyFfQ7v
    Account: os-steve
    Branch: claude/issue-38728-uncoded-search-throw
    Worktree: objectstack-issue-38728
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: o3-K (area:ai p1/p2, knowledge topic first; seat zone order o3-area-K.md, priority item 2 names this card)
    File surface: packages/services/service-knowledge/src/knowledge-service-search.ts (the searchRound catch block and its docblock, ~:885-966 on origin/main acf3b33, only), a new test file packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts, any existing service-knowledge test that pins the old "logged, zero hits" outcome (named in the report), .changeset/38728-*.md; content/docs/protocol/knowledge.mdx one sentence only if it states today's outcome. Anything else ⇒ stop and report.
    Container & model: S, mode:subagent, model: opus (dispatch-gates --tier: "Model tier — no path-derived mandate … floor sonnet · default opus · ceiling fable"), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: service-knowledge's own searchRound in this repo drops an uncoded adapter throw to a log line (knowledge-service-search.ts:949-962) | no existing path covers it (codedRefusalOf only lifts throws that already carry an ADR-0112 code; #38718 / PR #38726 coded only pgvector's own database failures) | every caller of a knowledge search whose adapter throws without a code (an unreachable embedder, a timeout outside the database), today, on every deployment
    Thread-read: 7272669836
    Premise: holds (origin/main acf3b33: searchRound catch pushes to refused only when codedRefusalOf(err) answers, else logger.error and the source is absent from the round's map and from refused, :949-962; docblock :890-892 "anything else is logged")
    Pre-claim lane: domain:server — packages/services/service-knowledge (services family).
    Pre-claim deps: none named by the card. PR #38722 (#38692 phase 1a, seat 2, draft) edits the same file; its searchRound hunks are the destructuring line (:911) and the adapter.search argument list (:927); this card's block is the catch (:949-962), so the text is near but not shared. overlap-check.mjs runs before every push; on exit 1 this branch waits for #38722 and rebases under the same name.
    Prior rulings read: check-prior-rulings.mjs --card 38728 --paths knowledge-service-search.ts → 277 term hits; ADR-0027 §12, ADR-0077 §1, ADR-0095 D3, ADR-0144 D8, ADR-0146 D11 named by term only, none on search refusals; surface grep 0 rulings. Direction carried: #38718 B2 「检索出错要报错不要空结果」 (topic #38703).
    Fold-or-serial: no fold. The other claimable area:ai card in this package, #38591 (backlog reconcile, knowledge-service.ts family), is a different mechanism on different files.
    Serial constraints cleared: check-handover --inflight --paths=knowledge-service-search.ts --card=38728: one overlap, #38692 (claim 7270621658, dir-wide packages/services/service-knowledge/src/**); file-level the only open PR on this file is #38722, handled as above (textual check before push, landing after it if they meet).

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 30, 2026
  6. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v
    os-dev-report

    {
      "issue": 38728,
      "status": "done",
      "branch": "claude/issue-38728-uncoded-search-throw",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38761",
      "session": "session_01ADHkmPDtfMCw4FJfyFfQ7v",
      "premise_still_valid": true,
      "premise_evidence": "origin/main acf3b33e, knowledge-service-search.ts: searchRound catch at :949-962 pushes to refused only when codedRefusalOf(err) answers, else logger.error and continue past out.set, so the source is in neither the round map nor refused; docblock :890-892 'anything else is logged'. Measured: the new pins run against the acf3b33e catch (ablation) give hits from the answering source and refused [] for the throwing one (3 uncoded pins red).",
      "summary": "searchRound's uncoded branch now pushes { sourceId, code: 'SERVICE_UNAVAILABLE', status: 503, message } to refused, where message is a platform sentence naming the source and adapter id (never err.message); the operator error line is unchanged. Existing code reused (same code the package answers for an adapter that cannot serve), no new code minted, Clause-2 stays no. Consequences via existing machinery: a search whose only source throws uncoded is now refused whole (503 + refused) instead of resolving []; a source failing the refill uncoded is refused once and its round-one hits dropped, matching the coded refill path (a refilled source answered round one, so it can never be refused twice). Five old pins of the zero-hits outcome flipped.",
      "tests": "head 43def1f1: pnpm --filter @objectstack/service-knowledge test -> Test Files 26 passed (26), Tests 841 passed (841) (VERDICT command-exit 0); typecheck (tsc --noEmit over src incl. tests + check:test-typecheck) exit 0. New file search-uncoded-throw-38728.test.ts 5 passed. Ablation: catch restored to acf3b33e on disk -> 3 failed | 2 passed (plain Error pin, whole-refusal pin, refill pin red; coded + no-match pins green); fix restored, tree clean.",
      "gates": "dispatch-gates --commands at 43def1f1: 69 derived. Run locally, exit captured before pipes: 40, all exit 0 except check-plugin-teardown-shape --self-test exit 3 (PREREQUISITE: shallow clone cannot reach pinned fixture; NOT MEASURED) and check:type-check-debt exit 124 (local 100s timeout; NOT MEASURED). Highlights: check:nul-bytes OK, check:doc-authoring ok, check:error-status-conformance ok, check:dispatcher-error-vocabulary OK, check:cross-package-test-inputs OK, check-empty-changeset ok, check-changeset-no-major ok. --ran reconciliation: exit 1, 29 of 69 UNRUN (declared narrowing, left to CI). PR check-runs: NOT MEASURED at report time (just opened), CI owns.",
      "overlap_check": "node scripts/pm/overlap-check.mjs before push at 43def1f1: VERDICT clean exit 0; merges cleanly with origin/main, #38722, #38730, #38732 (all share knowledge-service-search.ts). #38722's destructuring line and adapter.search argument list untouched.",
      "files_changed": [
        ".changeset/38728-uncoded-search-throw.md",
        "packages/services/service-knowledge/src/knowledge-service-search.ts",
        "packages/services/service-knowledge/src/__tests__/search-uncoded-throw-38728.test.ts",
        "packages/services/service-knowledge/src/__tests__/knowledge-service.test.ts",
        "packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts",
        "packages/services/service-knowledge/src/__tests__/knowledge-tools.test.ts"
      ],
      "flipped_pins": [
        "knowledge-service.test.ts: 'a refill the adapter fails keeps the source's round-one survivors' -> refused SERVICE_UNAVAILABLE/503 for s1, search refused whole",
        "knowledge-tools.test.ts: 'control: a failure without a code is logged and skipped as before' -> refused [{sourceId: policy_clauses, code: SERVICE_UNAVAILABLE}], thrown text withheld",
        "knowledge-settings-contribution.test.ts: 'no settings: boot succeeds, and indexing and search answer an error...' -> rejects SERVICE_UNAVAILABLE/503 naming docs",
        "knowledge-settings-contribution.test.ts: 'the API key is in no log line and no error...' -> search rejects SERVICE_UNAVAILABLE/503, API key absent from message",
        "knowledge-settings-contribution.test.ts: 'a plugin a host mounts itself, no embedder...' -> rejects SERVICE_UNAVAILABLE/503 naming docs"
      ],
      "line_budget": "+168 / -12 over 6 files (dispatch-gates changed-lines count); runtime hunk +16/-2 in one 1147-line file (fix inside an existing function, no new concern)",
      "deviations": [
        "First push rejected by check:commit-card-trailers (model name in Co-Authored-By from the harness reminder); amended unpublished commit to the model-free pair before any push landed.",
        "Derived-gate loop exceeded the 10-minute foreground cap and was auto-moved to background by the harness; stopped it with TaskStop after 30 gates, ran 10 more in the foreground; rest declared to CI.",
        "Refill-failure behaviour changed beyond the card's literal Ask (round-one survivors now dropped, search refused when it was the only source) to match the coded refill path as the dispatch asked; old pin flipped.",
        "content/docs/protocol/knowledge.mdx not edited.",
        "Did not run downstream packages' tests (knowledge-turso/memory/pgvector, mcp, runtime): public surface bytes unchanged; repo-wide grep found no other zero-hits pin for a throwing adapter at the service level."
      ],
      "mcp_calls": "0",
      "api_writes": "2 - relay pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft forced) ; relay comment on issue 38728 (this report, via post-stamped.mjs). git push not counted.",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: the stand-in embedder's 'No embedder is configured ... restart' error is uncoded, so the caller now reads the generic sentence and the remedy stays on the operator line; coding it at its producer would surface the remedy (polish, in PR Acceptance notes)."
      ]
    }
  7. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

    Claim amendment 1 — #38728 (PR #38761)
    Session: session_01ADHkmPDtfMCw4FJfyFfQ7v
    Adds to File surface: packages/plugins/knowledge-pgvector/bench/instrument.test.mjs (the one pin "a failed embed is counted, and the search answers no hit with the service's "search failed" line", ~:198-206 on origin/main, only).
    Why: CI Test Core (12/12) on e52b762 (job 141841015871) fails at bench/instrument.test.mjs:205: that pin asserts the old outcome this card retires (an uncoded embed failure answering zero hits with ok: true). It is a pin the dispatch's repo-wide sweep should have caught; it flips to the new substance (the source refused SERVICE_UNAVAILABLE/503, the operator line still logged once).
    Overlap read: check-handover --inflight --paths=packages/plugins/knowledge-pgvector/bench/instrument.test.mjs --card=38728 → clear. PR #38758 (#38747, zone o3-D) is being sent to edit the params pin at ~:189 of the same file; different lines, overlap-check.mjs before push.

  8. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

    Claim amendment 2 — #38728 (PR #38761)
    Session: session_01ADHkmPDtfMCw4FJfyFfQ7v
    Adds to File surface: one NEW file packages/spec/src/migrations/entries/semantic/19.knowledge-search-uncoded-adapter-throw-refused.ts (an ADR-0087 semantic ledger entry, data only, no schema or key change), and an '@objectstack/spec': patch line in .changeset/38728-uncoded-search-throw.md. No existing file under packages/spec/ is edited; if registration needs one (an index, a barrel, a count pin), the dev stops and reports.
    Why: L1 REWORK 7279138481 reads the change as a narrowing (Clause-②: no (narrowing), !, BREAKING with FROM → TO). With those declared, check:adr-0087-registration refuses not-required (no-migration-prescription) (measured, exit 1); the route is a registered entry, as PR #38755 did. Seat route 2026-11-30T13:00Z (option A; the zone exception for this PR, zone order 12:58Z appendix).
    Overlap read: check-handover --inflight meets #38690 (claim 7276543353, …/semantic/19.*.ts) and #34452 (claim 7258713947, the semantic/ directory) by glob; the path is a new file name neither PR adds, so no textual overlap. overlap-check.mjs before push.

  9. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

    Claim amendment 3 — #38728 (PR #38761)
    Session: session_01ADHkmPDtfMCw4FJfyFfQ7v
    Adds to File surface, docblock text only (no code, no export, no type change): packages/services/service-knowledge/src/knowledge-service.ts (the search and searchWithRefusals member docblocks, head :981-1001), packages/services/service-knowledge/src/knowledge-service-top-level.ts (the KnowledgeSearchRefusal docblock and its member comments, head :281-293), packages/services/service-knowledge/src/knowledge-tools.ts (the SearchKnowledgeRefusedSource docblock and member comments, head :171-180). Also, inside the already-claimed files: knowledge-service-search.ts may swap the literal 'SERVICE_UNAVAILABLE' for the exported UNMOUNTED_ADAPTER_CODE (N3), and a new pin for the all-sources-throw cell in the PR's own test file.
    Why: contract review 7280553997 (PASS with S1 and S2 open; landing waits on both). S1: those four public docblocks still describe the retired outcome or are narrower than the code. S2: the semantic entry and the changeset word cell (a) as "the only searched source"; the code's condition is "no searched source answers and at least one threw without a code", and two unwritten cells move (every source throwing uncoded: [] → 503; an uncoded throw beside a coded refusal with none answering: the top-level code is the first refusal's in source order, so 409 may read 503). Owed: the wording in 19.knowledge-search-uncoded-adapter-throw-refused.ts (surface, replacement, acceptanceCriteria) and the changeset (already claimed), plus a pin of the all-throw case; nits N1, N2 ride along.
    Overlap read: check-handover --inflight meets #38692 (claim 7270621658, dir-wide packages/services/service-knowledge/src/**) and this zone's own #38591 (PR #38767, knowledge-service.ts, ready and queued). Open PRs on these files: #38722 and #38730 (knowledge-service.ts, knowledge-service-top-level.ts) and #38732 (those two and knowledge-tools.ts), all #38692 phase 1a. overlap-check.mjs runs before the push; on exit 1 this round waits for the listed PR and rebases under the same name.

  10. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v
    os-dev-report

    Fix round 4 for PR #38761 (contract review 7280553997: S1, S2, N1-N3), under claim amendment 3 (7280639195). New head 5e17df249a7cb8e7f5db96135b8699eedb46ce6b.

    {
      "issue": 38728,
      "status": "done",
      "branch": "claude/issue-38728-uncoded-search-throw",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38761",
      "session": "session_01ADHkmPDtfMCw4FJfyFfQ7v",
      "premise_still_valid": true,
      "summary": "Merged origin/main (merge 306770c6), then one commit 5e17df24. S1: the four public docblocks (KnowledgeService.search and searchWithRefusals, KnowledgeSearchRefusal and its members, SearchKnowledgeRefusedSource and its message) now state the uncoded-throw outcome: SERVICE_UNAVAILABLE / 503 under a platform sentence, never the adapter's text; the false 'A coded refusal is not logged and dropped like a failure' is gone, and the search docblock names the whole rejection's code as the first refusal's in source order. S2: the semantic entry (surface, replacement, acceptanceCriteria) and the changeset word cell (a) as 'no searched source answers and at least one threw without a code', with cells (a1) all-throw -> 503 naming each and (a2) uncoded beside coded -> top-level code is the first refusal's in source order (409 may read 503); the changeset's 'A coded refusal ... unchanged' sentence is fixed. N1: the MCP rejection envelope is code, message and status, sources named in the message. N2: 'does not carry both an ADR-0112 code and status'. N3: the searchRound catch uses the exported UNMOUNTED_ADAPTER_CODE (import added to the existing knowledge-service-top-level import list). Two new pins: all sources throwing uncoded, and the mixed case with the uncoded source first. The PR body's BREAKING section is NOT patched (a subagent may not PATCH a PR body); the replacement text is handed to the seat. Deviations: dev-worktree.sh refused because an unheld local branch of the same name already existed at a6416d79 (the resume sha), so the worktree was attached to it with a plain git worktree add, then os-regen-merge.sh and --pin-base ran as normal. The first push was refused by check:commit-card-trailers (the co-author trailer named a model); the unpublished tip was amended to the model-free pair, with no force-push.",
      "tests": "At tree ef700638 (= head 5e17df24; the amend changed only the commit message): service-knowledge dependency closure built (os-verify-lock VERDICT command-exit 0). pnpm --filter @objectstack/service-knowledge test: Test Files 26 passed (26), Tests 844 passed (844); typecheck (tsc --noEmit plus check:test-typecheck OK, 0 errors), VERDICT command-exit 0. search-uncoded-throw-38728.test.ts verbose: 7 passed, including the new 'every searched source throws uncoded ... refused naming each' and 'an uncoded throw beside a coded refusal ... top-level code is the first in source order'. No ablation: no tested behaviour changed (docblocks and wording; N3 swaps a literal for a constant of the same value; the new pins hold behaviour the head already had).",
      "gates": "dispatch-gates --commands at 94219730 (same tree as 5e17df24): 98 commands; 85 run, 81 exit 0, including check-adr-0087-registration --base origin/main (registered knowledge-search-uncoded-adapter-throw-refused, 1 entry at or above PROTOCOL_MAJOR 19), check-changeset-no-major, check-empty-changeset, check:changeset-gate-self-tests, spec check:upgrade-guide / check:spec-changes / check:docs / check:authorable-surface, check:nul-bytes. NOT MEASURED: check-comment-mask-corpus and check:query-options-erasure (exit 124, my 240s per-command timeout on a shared box, tree-wide sweeps); cli vitest test/migrate-meta-engine-guidance.test.ts (exit 1, 'No test files found' in that project plus the cli's dependencies not built; not a red gate); check:dual-build-cjs-loads (exit 3, PREREQUISITE NOT MET, no workspace-wide dist); 13 trailing commands (check:slot-lookup through check:where-matcher) not run: the batch passed the 10-minute foreground limit, the harness moved it to the background and I stopped it. All of these go to CI. overlap-check --pr=38722,38730,38732: all merge cleanly, VERDICT clean exit 0. CI check-runs on 5e17df24 not yet concluded at report time.",
      "mcp_calls": "0",
      "api_writes": "1 — POST issues/38728/comments (this report, via post-stamped). Plus one git push (not REST).",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  11. added a commit that references this issue on Dec 1, 2026
    c8b1dbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpm:dispatchedpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions