Skip to content

Review follow-ups of PR #37951: refuse a knowledge_source save that names an adapter the running deployment does not mount #37961

Description

@objectstack-fleet

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

Filing gate: ① follow-up of PR #37951 (L1-a ACCEPT 7219082772: "Please file A as a follow-up card so it is not lost"; one card per PR, review-follow-ups exception) · Source: topic #37000
Grading: area:ai · Task · p3 (suggested: boot already names such a source at error and search/index answer a coded 503, so this moves the refusal earlier rather than fixing a silent path) · reach: an author or agent saving adapter: 'ragflow' (retired by #37004) or a mistyped adapter over PUT /meta/knowledge_source or the MCP draft save · evidence: read (dev report 7218591835 on #37479, option A).
Dedupe: repo:objectstack-ai/objectstack is:issue "PR #37951" → #37479 only; is:issue is:open knowledge unmounted adapter save → none open besides #37000.
Reader: area o1-C of seat repo:objectstack#1 claims it after triage's first touch.

维护者速读

  • 问题:保存知识源时如果写了本部署没装的存储(例如已退役的 ragflow,或拼错),保存照样成功,要到启动日志或检索报错时才发现。
  • 做什么:在保存时就拒绝,错误里写明知识源、存储名和本部署可用的存储。
  • 谁受益:在 Studio 或用 AI(MCP)写知识源的作者,当场就知道写错了。
  • 需要你做的:无(这是收窄:以前能存的写法会被拒,按惯例走契约审核)。

What

PR #37951 closed #37479 with the refusal point at boot (area decision D): reportUnmountedAdapters names the source at error, searchWithRefusals lists it, index and search answer SERVICE_UNAVAILABLE 503. A save is still accepted.

Option A from the dev report: 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 the mounted adapters when the running deployment mounts no adapter by that id. An omitted adapter (allowed once #37306 lands) is not refused. Package installs (isSystem), code-registered sources and os validate are not covered by this door; say so.

Acceptance

  • Saving a source whose adapter names no mounted adapter is refused 400 with the code, the source, the adapter and the mounted list; pinned at the HTTP door and the MCP draft save.
  • A source naming a mounted adapter, or omitting adapter, saves as today.
  • Declared Clause-②: no (narrowing) with its contract-tier review.

Blocked-by: #37306

Activity

  1. added
    pm:blocked
    area:ai
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:server · Task · p3 · pm:queue · size XS; rationale: refuse a knowledge_source save that names an adapter the running deployment does not mount. Boot already names such a source at error, and search and index answer a coded 503, so this moves the refusal earlier rather than closing a silent gap. The filer's p3 stands. Unlock: its Blocked-by: #37306 closed when PR #38026 merged at 2026-11-27T20:21Z, so pm:blocked → pm:queue. Answers seat repo:objectstack#1's Request: triage (7227551211). #38017 and #37953 were already audited at 2026-11-27T17:27Z, and both are pm:queue candidates. Recorded 2026-11-27T20:30Z.

  3. added
    domain:server
    pm:queue
    and removed
    pm:blocked
    on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Claim: PM loop round 9 · area o1-C (epic #37000; area concurrency 8 by the maintainer 2026-11-27T11:26Z) · 2026-11-27T20:34Z
    Session: session_016WV4cwPhGV4g9p1BGQaZbP
    Account: os-elon-musk
    Branch: claude/area-o1C-37961
    Worktree: objectstack-issue-37961
    Domain: domain:server
    Area: o1-C
    Seat: repo:objectstack#1
    File surface: packages/services/service-knowledge/src/knowledge-source-admission.ts (admitAuthoredSource: refuse 400 with a code naming the source, the adapter and the mounted adapters when no mounted adapter has that id; an omitted adapter passes), packages/metadata-core/src/knowledge-source-save-admission.ts if the code needs threading, tests at the HTTP door and the MCP draft save, docs naming the save refusals, a changeset with the ADR-0087 declaration.
    Container & model: XS, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: high (reason: XS, but a narrowing with its contract-tier review and dogfood battery)
    Clause-②: no (narrowing)
    Metadata-protocol: narrowed
    Responsibility: objectstack's own code, packages/services/service-knowledge/src/knowledge-source-admission.ts | a source naming an adapter the deployment does not mount saves, and fails only at boot or search | an author or agent saving a knowledge_source in Studio or over MCP
    Thread-read: 7227578818
    Premise: holds, read on origin/main 8d34c44 — admitAuthoredSource has no mounted-adapter check; #37306 merged (dbe0716), so an omitted adapter is now legal and must not be refused.
    Serial constraints cleared: probe overlap-check (the two admission files) against origin/main and every open PR: VERDICT clean exit 0 (#38038, #38013 and #37963 share a file and merge cleanly). #38038 rewords the same module's gate-2 text and #38013 adds the no-service refusal at the same door: whichever lands second merges main, and the PR says how the refusals order.
    Pre-claim lane: packages/services/** ⇒ domain:server.
    Pre-claim deps: #37306 closed.
    Prior rulings read: card thread — triage 7227578818 (XS); #37983 ruling D 7220511579 (no-service refusal at the same door).
    Fold-or-serial: not folded with #37983 (separate refusal, separate card; serial by the rule above).

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

    @objectstack-fleet
    ContributorAuthor

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

    {
     "issue": 37961,
     "status": "done",
     "branch": "claude/area-o1C-37961",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38060",
     "head": "0b2a3bc047",
     "session": "session_016WV4cwPhGV4g9p1BGQaZbP",
     "premise_still_valid": true,
     "summary": "admitAuthoredSource now refuses a knowledge_source whose adapter names no adapter the running deployment mounts: 400 VALIDATION_ERROR, the message naming the source, the adapter and the mounted adapters, written as the rule and its remedies (leaving adapter out is offered only where an omitted one would be placed). An omitted adapter and a mounted one save as before. Every door that calls authoredKnowledgeSourceRefusal inherits it: PUT /meta/knowledge_source, the MCP save_metadata_draft, and the package duplicate. Package installs (isSystem), sources registered in code and os validate are not judged at this door; the docs, the changeset and the PR say so. Premise correction: admitAuthoredSource lives in knowledge-service.ts, not knowledge-source-admission.ts; the hunk sits there beside the unplaced-source check, and the admission module is untouched. The refusals order this way: no knowledge service (the 503 #38013 adds) never reaches admitAuthoredSource, so it comes first; then identity 403, unplaced 400, this check 400, no data engine 503, then the gates. The ADR-0087 semantic entry knowledge-source-unmounted-adapter-refused-at-save is registered.",
     "tests": "Head 0b2a3bc047, every run under os-verify-lock. Closure build `turbo run build --filter='@objectstack/dogfood^...'` exit 0. service-knowledge: Test Files 18 passed (18), Tests 573 passed (573); typecheck (tsc + check:test-typecheck) exit 0. metadata-core: 29 files / 1111 tests passed; typecheck exit 0. Save-refusal door tests: runtime mcp-authoring, meta-save-capability-gate, packages-knowledge-source-gate, meta-type-write-capability-parity 4 files / 195 passed; rest meta-write-door-capability-enumeration, meta-type-write-capability 2 files / 135 passed. spec src/migrations 5 files / 206 passed. New pins: 3 cases in knowledge-source-admission.test.ts (real KnowledgeService) and the new dogfood file knowledge-source-unmounted-adapter-save.dogfood.test.ts (real showcase plus MCP with a real OAuth token: PUT and save_metadata_draft refuse ragflow/memroy 400 and store nothing; CONTROL: memory and omitted save at both doors), 4 passed (4). Ablation through ablation-replace.mjs (marker ABLATED_UNMOUNTED_CHECK, count 1 on disk): unit leg 2 failed | 43 passed (45), `ragflow: expected { admitted: true } to match object { admitted: false, ... }`; door leg after the rebuild (ablation-dist-preflight found the marker in dist, exit 0): 2 failed | 2 passed (4), the PUT answered `Saved knowledge_source 'ks_retired_store' ... expected 200 to be 400`, and the MCP leg was red too. A first door-leg attempt was discarded: its literal comparison failed the DTS build (TS2367), so dist was absent. Restored: git diff HEAD empty, status clean, rebuilt, preflight --absent exit 0, unit 45 passed, dogfood file 4 passed.",
     "gates": "Local: dispatch-gates --commands --repo objectstack-ai/objectstack gave 118 families, all run on 0b2a3bc047, exit codes captured before any pipe; --ran: '118 derived famil(ies) accounted for — 115 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)'. NOT MEASURED: check:skill-examples, reason: it reads packages/client-react/dist, which is outside the closure built here (PREREQUISITE NOT MET). NOT MEASURED: check:dual-build-cjs-loads, reason: it needs a whole-tree dist (PREREQUISITE NOT MET). NOT MEASURED: check:type-check-debt, reason: its re-measure build waited on the verify lock while this branch's battery held it, and exited 3. Local-only: check:skill-frame-freshness exit 0; check:dev-prereqs exit 1 ('38 of 110 workspace packages declare an entry point under dist/ that is not on disk'; only the dogfood closure is built; a local reading). check:adr-0087-registration exit 0 (registered, new here). overlap-check before pr_create: VERDICT clean exit 0 against origin/main 27ee98438e and the heads of #38056, #38050, #38038, #38013, #37982 and #37963. CI check-runs on 0b2a3bc047 at report time: Lint (all lanes), Type Check (workspace / debt ledger / source / consumer), Check Changeset, PR-body guards, Governed Surface Queue Guard, Check PR Size, Spec property liveness, Flag docs affected, Check Documentation Links = in_progress; Schedule gate, Borrowed queue verdict, Queue verdict, Packed-tarball smoke, 18.x upgrade harness = skipped; Test Core was not listed yet.",
     "dogfood_battery": "0b2a3bc047 · os-verify-lock VERDICT command-exit 0 (held 2405s) · Test Files 491 passed | 3 skipped (494) · Tests 4148 passed | 68 skipped (4216) · no failures",
     "mcp_calls": "0",
     "api_writes": "3 — git push (the branch probe and two heads, not REST); 1 relay pr_create (fw-20261128T002916Z-e60cf0: POST /repos/objectstack-ai/objectstack/pulls + POST /issues/38060/assignees, read back identical, assignee os-elon-musk); 1 relay comment on #37961 via post-stamped (this report)",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: the claim's file surface names knowledge-source-admission.ts for admitAuthoredSource; on 8d34c4404f it is in knowledge-service.ts. The claim text is wrong; there is no defect."
     ],
     "deviations": "(1) Reading of 'a code naming the source, the adapter and the mounted adapters': the existing ADR-0112 VALIDATION_ERROR (the code of the sibling unplaced refusal) with a message that names all three. A new error code would be a ledger change, so it is not added. (2) One existing fixture in knowledge-source-admission.test.ts (the no-engine case) now registers the memory adapter its item names, so it still reaches the 503 it pins. (3) The dispatch said 'dispatch-gates --commands under the lock'; the derivation and the 118 check families ran unlocked, as os-dev.md says check:* gates do. Builds, tests, the ablation and the battery all ran under the lock. (4) Two attempts to run the ablation and a gate runner as background scripts were refused by the session's permission classifier: one ran gates concurrently with a queued ablation, and one ran the ablation outside the lock. Neither ran. Both were redone in order, through the lock (ablation) and in the foreground (gates). (5) After the PR opened, the worktree's node_modules was removed and the worktree with it (git worktree remove, no --force)."
    }
  7. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Close-out · area o1-C · 2026-11-28T06:07Z

    Delivered by PR #38060 (merged f9c6f92 at 2026-11-28T06:04Z). Its skills-docs follow-up is #38158 (pm:blocked by this card's PR, which has now merged). Nothing remains on this card for the area. pm:dispatched removed with this comment.

  8. removed
    pm:dispatched
    on Nov 28, 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:serverpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions