Skip to content

service-knowledge: a knowledge source that names an unregistered adapter fails silently (boot clean, search answers [], index throws a bare Error) #37479

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CZmwqAVSYHM1nQUDTq

Filing gate ① · Source: fleet · from PR #37477 (#37004) Acceptance notes, measurement (b) the card asked for ("If (b) is silent, say so in the PR and the seat files the enforcement card") · Area: o5-A

What happens

Measured on PR #37477's head d3692d0c (the card thread's readings): a knowledge source whose adapter names no registered adapter

  • boots clean (one info line only);
  • search answers [] with one warn log, and searchWithRefusals answers refused: [] — the source is not listed as refused;
  • indexDocument / reindexSource throw a bare Error with no code or status; event sync swallows it at warn.

KnowledgeSourceSchema.adapter is z.string() (packages/spec/src/ai/knowledge-source.zod.ts), so nothing at publish time refuses an unknown name either. After #37004 retires ragflow, every stored source that still says adapter: 'ragflow' lands in this path.

Done when

An unregistered adapter is refused loudly at one named point (publish/os validate or boot) with a coded error that names the source and the adapter, searchWithRefusals lists the source as refused, and the index paths throw a coded error. Which point refuses is the lane's design call; a pin test covers each.

reach: an author or agent who writes adapter: 'ragflow' (taught by the docs until #37004) or mistypes an adapter name; read from PR #37477's measurement.
Business reason: knowledge search that quietly returns nothing looks like "no answer" to the user; the author never learns the source is dead.
Reader: triage → domain:server lane (service-knowledge).
Dedupe: unregistered adapter knowledge, unknown adapter knowledge (open and closed) → #37304 (knowledge_source type and loader, zone ai-37000) is the nearest; it registers published sources but does not refuse an unregistered adapter. If its loader is the natural refusal point, ai-37000 may fold this in.
Grading: area:ai · Bug · suggested p2 (silent wrong result, builders often after the ragflow retirement) · evidence: measured on PR head.

Activity

  1. added
    priority:p2
    finding
    area:ai
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ

    Routing note · 2026-11-26T07:40Z · zone ai-37000 (topic #37000)

    Not folded into #37304. Reason: sources are registered in code today (phase 2), and #37304's loader only admits metadata sources, so a refusal placed in the loader would leave the code path silent. The fold gates (same defect and same fix) do not hold.

    Proposed route: its own card in zone ai-37000, under topic #37000. The refusal sits on the one registration path in service-knowledge that both code-registered sources and #37304's loader go through, so #37304 inherits it. That path also covers boot with a coded error naming the source and the adapter, searchWithRefusals listing the source, and coded errors on the index paths.

    Serial: after #37004 (PR #37477) lands, because both edit service-knowledge and the ragflow residue is what makes this reachable. Still finding: it waits for its first grade (triage seat offline) before it is claimed.

  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:server · Bug · priority:p2 · pm:queue · size S; rationale: a knowledge source naming an unregistered adapter boots clean, and search silently answers nothing; it is not listed as refused. Measured, but only on a misconfigured source, so p2 as filed.

  4. added
    domain:server
    pm:queue
    on Nov 26, 2026
  5. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ

    Scope note · 2026-11-26T09:04Z · zone ai-37000

    Carried here from #37102 (os-dev report 7187364220, PR #37442): a source that names an unmounted adapter is logged twice at boot. #37102 logs an error line and #37099's boot build pass logs a warn line. When this card adds the one coded refusal, those two lines collapse into one boot log line per source, and a test pins that count.

  6. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ

    Re-scope · 2026-11-26T09:25Z · zone ai-37000 (seat L1 on PR #37442, contract record 7187791236)

    PR #37442 (#37102) delivers most of this card's "Done when": an unmounted adapter now leaves boot clean with one error line, and index and search answer a coded 503 that names the mounted adapters. What remains for this card once #37442 lands:

    1. One boot log line per such source, not two. Today Open runtime: requires: ['knowledge'] mounts the knowledge service, and pgvector on PostgreSQL #37102 logs an error line and service-knowledge: a source that was never built gets built, and an operator can start a rebuild #37099's boot build pass adds a warn line.
    2. The publish-time refusal: an adapter name no deployment can serve is refused when the source is published or checked by os validate, with a coded error naming the source and the adapter. That lines up with knowledge_source: admit the governed metadata type with its loader — registry, stack collection, ADR-0087 renames and retirements, the two authoring guards, one name per source #37304's loader and knowledge_source: lint and os validate check the object and field references and the gates that need no principal, also at publish #37307's reference checks. Whichever of those cards lands first takes the refusal, and this card then shrinks to item 1.
      Serial: after feat(core): requires knowledge mounts the knowledge service and one vector store #37442 and after Retire @objectstack/knowledge-ragflow: package, settings option, docs and skill mentions #37004 (PR fix(settings)!: retire @objectstack/knowledge-ragflow and the Knowledge page's RAGFlow adapter option #37477).
  7. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

    Claim: PM loop round 5 · area o1-C (epic #37000; area concurrency raised to 8 by the maintainer 2026-11-27T11:26Z) · 2026-11-27T11:27Z
    Session: session_016WV4cwPhGV4g9p1BGQaZbP
    Account: os-elon-musk
    Branch: claude/area-o1C-37479
    Worktree: objectstack-issue-37479
    Domain: domain:server
    Area: o1-C
    Seat: repo:objectstack#1
    File surface: packages/services/service-knowledge/src/knowledge-service.ts (reportUnmountedAdapters :225-230 and the boot build pass's kept(...) line :372) + a pin test that one such source logs exactly one boot line, a changeset. Re-scope 7187970703 item 2 (a publish/os validate refusal of an adapter name no deployment can serve) is a design call: the dev measures where it could sit and reports options; ⛔ no publish-time refusal is added in this PR without the area's word (it would be a narrowing).
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: medium (reason: S; one log path collapsed and pinned, plus a read-only options note)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack's own code, packages/services/service-knowledge/src/knowledge-service.ts | a source naming an unmounted adapter is logged twice at boot: an error at :230 and the build pass's warn at :372 | operators reading boot logs after the ragflow retirement
    Thread-read: 7187970703
    Premise: holds, read not yet measured — on origin/main 73d5e34 reportUnmountedAdapters (:225) logs the error at :230 and the boot pass keeps "adapter '…' is not mounted." at :372; index and search already answer the coded unmounted-adapter error (:2651, PR #37442), so items of the card's original "Done when" except the two in 7187970703 are delivered.
    Serial constraints cleared: #37306 and #37734 (this area, no PR yet) also edit knowledge-service.ts in other regions; probe overlap against origin/main clean; the dev re-runs overlap-check before every push, merges main if either lands first, and reports on exit 1.
    Pre-claim lane: packages/services/service-knowledge/** ⇒ domain:server.
    Pre-claim deps: serial after #37442 (merged) and #37004 (closed); none open.
    Prior rulings read: card thread 0 rulings (routing 7185730613, triage 7186351838, scope 7187384907, re-scope 7187970703).
    Fold-or-serial: not folded — #37306 keeps "a named adapter that is not mounted stays #37102's error"; #37307 does not take item 2 (its dispatch excludes it).

  8. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 27, 2026
  9. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
    os-dev-report

    {
     "issue": 37479,
     "status": "done",
     "branch": "claude/area-o1C-37479",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/37951",
     "session": "session_016WV4cwPhGV4g9p1BGQaZbP",
     "container_and_model": "S, mode:subagent, model: default tier (dispatch-gates --tier: \"no path-derived mandate\"), effort: medium (reason: S; one log path collapsed and pinned, plus a read-only options note)",
     "premise_still_valid": true,
     "summary": "Item 1 of re-scope 7187970703 is done: at boot, the first-build pass (buildIfDue) now skips a source whose adapter is not mounted without logging anything, so reportUnmountedAdapters' error is the one boot line for that source. Reload is unchanged: no boot reading runs there, so its warn stays the only line. The claim's ':372' was wrong: on 73d5e347f7 that line is dropMetadataSource's kept(), which runs on removal. The second boot line was buildIfDue's warn for an 'unreadable' index reading (getAdapter throws inside readIndexStateOf), and the fix sits there. The PR says 'Part of #37479' because item 2 (a publish or os validate refusal) is still open as a decision, with options in open_questions.",
     "tests": "Head 13f32fc828. `pnpm --filter @objectstack/service-knowledge test && pnpm --filter @objectstack/service-knowledge typecheck` under the verify lock: VERDICT command-exit 0, Test Files 17 passed (17), Tests 529 passed (529). typecheck = tsc --noEmit && check:test-typecheck, so the test files are covered. New pin: knowledge-build.test.ts 'a source naming an unmounted adapter gets exactly one boot log line: the reading, at error'. Ablation (on-disk: guard line replaced by '// ABLATED', grep confirmed at :1392; vitest reads src): 1 failed | 22 passed (23), `expected [ [ 'warn', …(1) ], [ 'error', …(1) ] ] to have a length of 1 but got 2`. Restored (git checkout): 23 passed (23).",
     "gates": "Local: dependency closure `pnpm --filter '@objectstack/service-knowledge^...' build` exit 0. Derived `dispatch-gates --commands --repo objectstack-ai/objectstack` gave 70 families, all run, exit codes captured before any pipe. `--ran` result: '70 derived famil(ies) accounted for — 68 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)'. NOT MEASURED: check:dual-build-cjs-loads, reason: it needs a whole-tree dist/ build (PREREQUISITE NOT MET). NOT MEASURED: check:type-check-debt, reason: its re-measure build hit verify-lock queue-timeout 99. overlap-check before the push and before pr_create: 'VERDICT clean exit 0' (0 open PR heads overlapping). CI check-runs on 13f32fc828 at report time: Check Changeset, Check PR Size, Lint · ESLint / CI, release & engine gates / PM dispatch-gates / docs & code guards / repo & tooling gates / scoped x3, PR-body guards, Governed Surface Queue Guard, Type Check · consumer / debt ledger / source / workspace, Flag docs affected = in_progress. 18.x harness, Packed-tarball smoke, Queue verdict, Borrowed queue verdict, Schedule gate = skipped. Test Core not yet listed.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "3 — git push (branch probe and head, not REST); 1 relay pr_create (fleet-write fw-20261127T124120Z-f33c2c: POST /repos/objectstack-ai/objectstack/pulls + POST /issues/37951/assignees); 1 relay comment on #37479 via post-stamped (this report)",
     "deviations": "(1) I made the first edit before reading AGENTS.md; I read its sections afterwards and nothing in them conflicts with the change. (2) Narrowed: the ablation file run went outside the verify lock. Three locked tries each hit queue-timeout 99 (about 27 min in all) behind holder pid 30298, a dogfood build+test held for more than 2000s. It was a single-file vitest run, declared here and in the PR. (3) The background gate runner was still running during the ablation tries, so for a few seconds at a time knowledge-service.ts held the ablated line (the guard line replaced by a comment). Any gate that read the file then saw a tree with one line fewer; CI reruns everything on the real head.",
     "open_questions": [
      {
       "question": "Item 2: where, if anywhere, should an adapter name no deployment can serve be refused at publish or os validate time? Measured on 73d5e347f7: KnowledgeSourceSchema.adapter is z.string() (packages/spec/src/ai/knowledge-source.zod.ts:251). Adapter ids are not a closed set, because KnowledgeTursoPlugin takes opts.id (knowledge-turso/src/plugin.ts:450) and pgvector registers adapter.id. Adapters register in their plugin start(), after sources register, so a refusal at registerSource or registerMetadataSource would refuse a valid source on every boot. The boot side is already loud: reportUnmountedAdapters prints the error, and index and search answer a coded 503.",
       "options": [
        "A. Save-time admission, live: extend admitAuthoredSource (service-knowledge, reached through metadata-core knowledge-source-save-admission.ts on PUT /meta/knowledge_source and the MCP draft save) to refuse 400 with a code naming the source, the adapter and listAdapters() when the running deployment mounts no such adapter. Accurate per deployment. It does not cover package installs (isSystem), code-registered sources or os validate. A narrowing (Clause-② yes), size S-M.",
        "B. A spec-level tombstone for the concrete reach only: refuse adapter: 'ragflow' at parse with a retiredValue prescription (ADR-0087), so os validate, publish and every door refuse it. A contract change to packages/spec with regenerated artifacts and an ADR-0087 disposition. A narrowing, size S-M. It does not catch typos.",
        "C. A closed vocabulary or os validate lint of known adapter ids (turso, pgvector, memory): it would falsely refuse a renamed turso id, so it could be a warn-only lint at most. It needs a new ledger of known ids and is not recommended.",
        "D. Close item 2 as delivered by the boot error plus the coded 503 at index and search (PR #37442 and this PR), and change this PR's 'Part of' to 'Fixes' (the seat does that)."
       ],
       "recommendation": "A+B, because together they cover live saves accurately and the one name most likely to be stored (ragflow) at every door, including os validate, without a false refusal of configurable ids. If the area wants no narrowing now, D, since the boot and request paths are already loud and coded."
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: claim 7217110477's file surface cites :372 as 'the boot build pass's kept(...) line'; on 73d5e347f7 :372 is dropMetadataSource's kept() (removal path), and the boot pass's second line is buildIfDue's unreadable-reading warn. A claim-text inaccuracy, not a defect."
     ]
    }

    Generated by Claude Code

  10. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

    Close-out · area o1-C · 2026-11-27T13:56Z

    Delivered by PR #37951 (merged 73d0240). Item 2 was ruled D by the area and accepted by L1-a: boot is the named refusal point for a source whose adapter is not mounted, and searchWithRefusals plus the coded 503 already deliver the rest. Option A, refusing such a source at save, is follow-up card #37961 (Blocked-by #37306). Nothing remains on this card; pm:dispatched removed with this comment.

  11. removed
    pm:dispatched
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverfindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions