Repository navigation
Description
Filing gate ①: a reproducible defect and a contract violation (declared ≠ delivered).
Source: evaluation of the BrightRule app (objectstack-ai/brightrule, branch feature/policy-inquiry) over the MCP server of ObjectOS EE ghcr.io/objectstack-ai/objectos-ee:18.6.0 (objectstack server 18.6.0), local stack, 2026-11-23. The client was a minimal MCP client driving deepseek-flash as the customer's own model (BYO-AI).
Dedupe: mcp search_knowledge and mcp knowledge tool found nothing on this. #32767 / #32885 (withhold a skill whose bound tools a connection does not serve) are the closed design this issue runs into, not duplicates.
What happens
The app mounts KnowledgeServicePlugin with one object source (policy_clauses, aiExposed defaults to true) and a vector adapter; the index is built (10 rows in pgvector). It also ships a skill, brightrule_policy_inquiry, with instructions and tools: ['search_knowledge', 'query_records', 'get_record', 'action_brightrule_escalate_question'].
Over /api/v1/mcp with an admin session:
initialize→ capabilitiesprompts,tools; generic server instructions (1,445 chars, governed metrics first).tools/list→ 17 tools: object CRUD, files,list_actions/run_action/resume_run,list_datasets/query_dataset,validate_expression. No knowledge search tool.prompts/list→[]. The app skill is withheld becausesearch_knowledgeis not served (skill-prompts.ts:222if (served && !skillBindingServed(row, served)) continue;). Every other binding entry is served:query_records,get_record, and the action through therun_actiondoor.- Nothing reports either fact.
os validatepasses, the boot is quiet, and the author only learns it by listing prompts on a live connection.
Why (origin/main e9fa6b5)
packages/mcp/src/mcp-http-tools.ts:3138 wireBridgeTools registers the object, file, action, federation, dataset (ADR-0149 D2) and package-doc (#35442) families. There is no knowledge family, so a knowledge source can be searched by nothing that MCP serves.
The contract it breaks
@objectstack/skills18.6.0,objectstack-ai/SKILL.md: "search_knowledgetool exposes registered sources to agents";aiExposed: "Maysearch_knowledgeexpose this source to agents (defaulttrue)".skill-prompts.tsmodule doc (Skills are declared the only third-party extension primitive, but nothing in the open distribution consumes them #3905): ADR-0063 §2 names skills and MCP as the only third-party extension primitive, and the open distribution is MCP-only (BYO-AI). On that distribution, an app's knowledge base and any skill that relies on it are both unreachable.
Measured impact (11 policy questions × 2 runs, DeepSeek as the MCP client)
| client gets only the server instructions | customer pastes the skill's instructions by hand | |
|---|---|---|
| Correct answer with a cited clause | 18/18 | 18/18 |
No-basis questions escalated (run_action) |
0/4 | 4/4 |
| No-basis answers padded with non-policy content | 1/4 | 0/4 |
| Median input tokens per question | ~97.5k | ~66.8k |
| Retrieval | keyword query_records, reading the whole catalogue |
same |
The rules reach the model only when a person copies them into each client, and retrieval is keyword-only. That works on a 10-clause corpus and grows linearly in tokens with the corpus. For the in-product side see objectstack-ai/cloud#4933 (search_knowledge never registered) and objectstack-ai/cloud#4935 (ask ignores package skills). With both simulated, the same model called the knowledge tool first on 27/27 questions.
Expected
- Serve a knowledge family on MCP. Register
search_knowledgewhen the kernel has aknowledgeservice and the grant admitsdata:read, likeregisterDatasetTools/registerPackageDocTools. Pass the caller's execution context: the open knowledge service already re-checks every object-source hit against the caller's row-level security and drops hits when no identity is passed. Only sources withaiExposed !== falseare searchable. - Make withholding visible. When a skill with
instructionsis withheld because a bound tool is not served, say so: anos validate/ lint warning that names the skill and the tool no MCP connection serves, and/or a boot or debug log line. Today the skill disappears without a trace.
Related (filed together): #36647 (artifact boot drops app code plugins, so on EE the knowledge service itself does not mount), objectstack-ai/cloud#4933, objectstack-ai/cloud#4934, objectstack-ai/cloud#4935.
Activity
objectstack-fleet commentedon Nov 23, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:server(MCP tool surface) ·pm:queue; rationale: area:ai (as filed) · Bug · the MCP server serves no knowledge tool, so an app'saiExposedknowledge sources are unreachable over MCP, and every skill that bindssearch_knowledgecannot work for a BYO-AI client. Declared but not delivered; reproduced on objectos-ee 18.6.0 with a real app evaluation (BrightRule, filed by os-bob). A shipped AI capability that fails outright is p1 under the 2026-11-21 standard → p1 · size M. Linked under MCP ask #35150.objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Claim: PM loop round 1 · 2026-11-24T01:37Z
Session:
session_01QSeKYpEsWWE9Y5YtSsDgqZAccount:
os-justinBranch:
claude/issue-36650-mcp-search-knowledgeWorktree:
objectstack-issue-36650Domain:
domain:serverSeat:
repo:objectstack#4File surface:
packages/mcp/src/**(mcp-http-tools.ts, stdio-data-bridge.ts, skill-prompts.ts and their tests),packages/runtime/src/domains/mcp.ts,packages/spec/src/system/constants/platform-tool-names.ts(MCP_DOOR_TOOL_NAMES),packages/services/service-knowledge/src/**(only if the shared tool definition + executor lands there, ADR-0149 D2),packages/lint/src/validate-ai-tool-references.ts(item 2, if the lint route is taken),.changeset/36650-*.md(stop on breach; explain in the report)Container & model:
M,mode:cloud(surface namespackages/spec/src/**plus other packages: build-heavy),model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate … the tier stays below the ceiling",effort: highClause-②: yes
Metadata-protocol: none
Responsibility:
objectstack platform code — packages/mcp wireBridgeTools registers no knowledge family (mcp-http-tools.ts:3138-3161 on 4c18c43d) | none: no MCP path serves knowledge search today | any BYO-AI MCP client of an app that mounts the knowledge service; reached today by the BrightRule evaluation filed on this cardThread-read: 7095865008
Premise: holds
Serial constraints cleared:
#34223 (draft, idle since 2026-11-19) touches packages/services/service-knowledge/src/index.ts and knowledge-service-plugin.ts — edits there stay minimal, the merge queue arbitrates; no other open PR touches this surface (41 open PRs read)objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Dispatched 2026-11-24T01:39Z under claim 7119297044:
mode:clouddev sessionsession_01QSeKYnEwQiHFXyLjP4vcfa(default tier, effort high), outcome branchclaude/issue-36650-mcp-search-knowledge. Premise re-measured read-only on origin/main 4c18c43 before dispatch: holds; one addition carried into the order — explicitsourceIdsbypass theaiExposedfilter in service-knowledge, so the MCP tool must not reach anaiExposed: falsesource.objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYnEwQiHFXyLjP4vcfa
os-dev-report
{ "issue": 36650, "status": "done", "branch": "claude/issue-36650-mcp-search-knowledge", "pr": "https://github.com/objectstack-ai/objectstack/pull/36823", "session": "session_01QSeKYnEwQiHFXyLjP4vcfa", "premise_still_valid": true, "summary": "Item 1: search_knowledge is defined once (AIToolDefinition + executor) in @objectstack/service-knowledge (knowledge-tools.ts, KnowledgeService.knowledgeTools()); the MCP door registers it from that definition in wireBridgeTools (registerKnowledgeTools) on HTTP and stdio, only where the kernel holds a knowledge service and the grant admits data:read; runtime/domains/mcp.ts resolves the service under the same gate and binds the caller's ExecutionContext; MCP_DOOR_TOOL_NAMES gains search_knowledge. Zone-2 aiExposed bypass measured true on 65ee4b7a (explicit sourceIds reach an aiExposed:false source); enforced producer-side in the tool executor (service-knowledge), not in IKnowledgeService.search, which also serves non-agent callers: an unexposed or unknown sourceIds entry is refused NOT_FOUND with one sentence. Item 2: ai-skill-tool-unresolved gains a verdict for a projected skill binding an ask tool no MCP connection serves (aggregate_data, query_data, visualize_data), plus one debug line per withheld skill at the prompts/list withholding point. Assignee field not written by this dev (claim Account os-justin carried by pr_create).", "tests": "Head 2c92317254. New pins: service-knowledge knowledge-tools.test.ts 15/15; mcp mcp-knowledge-tools.test.ts 11/11; runtime mcp-knowledge-tools-bridge.test.ts 6/6; lint validate-ai-tool-references.test.ts 29/29 (new verdict + controls). Package suites under os-verify-lock, VERDICT command-exit 0: spec 883 files/28106 tests (1 todo), service-knowledge 5/64, lint 229/9514, mcp 84/1492, runtime 644/11930 (25 skipped). Ablation via scripts/ablation-replace.mjs on knowledge-tools.ts (aiExposed filter removed; test imports src, no dist leg): anchor x1->x0, 4/15 red, restored blob == HEAD e4a69921027d, git diff HEAD empty.", "gates": "Local: build + typecheck of spec, lint, service-knowledge, mcp, runtime: VERDICT command-exit 0 (after a test-layer type fix in mcp-knowledge-tools.test.ts). spec check:generated exit 0 (14 artifacts current). dispatch-gates --commands: 120 derived; 118 exit 0 (check-plugin-teardown-shape --self-test exit 3 shallow-clone prerequisite, exit 0 after git fetch --unshallow); NOT MEASURED, PREREQUISITE NOT MET (built dists outside the diff): spec check:skill-examples, check:dual-build-cjs-loads. --ran: 120 derived, 118 run, 2 UNRUN (those two). CI check-runs on PR #36823 at report time: 25 listed, all in_progress or skipped (Lint & Repo Gates jobs, Type Check jobs, Check Changeset, Governed Surface Queue Guard: in_progress).", "line_budget": "1287 changed lines (+1274 / -13), 21 files, under the 3000 human-merge threshold", "files_changed": [ ".changeset/36650-mcp-search-knowledge.md", "content/docs/ai/connect-mcp.mdx", "content/docs/ai/knowledge-rag.mdx", "content/docs/protocol/knowledge.mdx", "packages/lint/src/rule-explanations.ts", "packages/lint/src/validate-ai-tool-references.test.ts", "packages/lint/src/validate-ai-tool-references.ts", "packages/mcp/src/mcp-file-tools.test.ts", "packages/mcp/src/mcp-http-tools.ts", "packages/mcp/src/mcp-knowledge-tools.test.ts", "packages/mcp/src/mcp-server-runtime.ts", "packages/mcp/src/plugin.ts", "packages/mcp/src/skill-prompts.ts", "packages/mcp/src/stdio-data-bridge.ts", "packages/runtime/src/domains/mcp.ts", "packages/runtime/src/mcp-knowledge-tools-bridge.test.ts", "packages/services/service-knowledge/src/__tests__/knowledge-tools.test.ts", "packages/services/service-knowledge/src/index.ts", "packages/services/service-knowledge/src/knowledge-service.ts", "packages/services/service-knowledge/src/knowledge-tools.ts", "packages/spec/src/system/constants/platform-tool-names.ts" ], "deviations": [ "origin/main advanced 3 commits to 14f4d8f8 after branch point; none touch changed paths; merge-tree clean; not merged before opening the PR (AGENTS multi-agent section 10 asks a pull before opening).", "Full dogfood not run: no ! in the title and no (narrowing) arm.", "Unshallowed the worktree clone (git fetch --unshallow origin main) to satisfy one gate's prerequisite." ], "dogfood_battery": "n/a, no ! in the PR title and no (narrowing) arm", "mcp_calls": "3: issue_read x2 (get, get_comments), pull_request_read x1 (get_check_runs); no write tool", "api_writes": "2 relay strokes: pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST issues/36823/assignees), this report comment (POST issues/36650/comments via post-stamped.mjs)", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted in PR Acceptance notes, not filed: a skill bound to a stack.tools record name is also withheld by every MCP connection (no door serves tool records) and the new lint verdict does not cover it; bindings served only when an optional service is mounted are covered only by the runtime debug line.", "carrier: cloud · cloud#4933 can register getKnowledgeToolDefinitions()/knowledgeTools() as the one definition; the cloud repo was not read (NOT MEASURED)." ], "l2_routing": "Touches packages/spec (MCP_DOOR_TOOL_NAMES constant, no Zod shape) and adds a published executor export in service-knowledge; the seat may judge whether this owes a contract review." }objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYnEwQiHFXyLjP4vcfa
os-dev-report
{ "issue": 36650, "status": "done", "round": "rework 1 (L2 review 7120785446, S1)", "branch": "claude/issue-36650-mcp-search-knowledge", "pr": "https://github.com/objectstack-ai/objectstack/pull/36823", "session": "session_01QSeKYnEwQiHFXyLjP4vcfa", "head": "ad74f6f069849c64cab87c1ad86006fc59b746e4 (fix f4b486c4f1; changeset wording ad74f6f069)", "summary": "S1 fixed by option (a): the search_knowledge definition declares minItems: 1 on sourceIds and parseInput refuses [] with VALIDATION_ERROR/400 naming the fix (omit it, or name at least one id). The door converts its schema from that same definition, so it refuses [] before dispatch and agrees with parseInput. Chosen over reading [] as omitted for the loud contract. N1/N2/N3 and E1 untouched as instructed. PR body updated via relay issue_patch (signed trailer); changeset argument sentence updated.", "pins_added": [ "service-knowledge knowledge-tools.test.ts: {query, sourceIds: []} refused VALIDATION_ERROR/400 naming sourceIds, adapter never searched; definition carries sourceIds.minItems 1", "mcp mcp-knowledge-tools.test.ts: tools/list schema carries sourceIds.minItems 1; a call with sourceIds [] is refused before the bridge is asked" ], "tests": "On f4b486c4f1 under os-verify-lock, VERDICT command-exit 0: dependency-closure build, typecheck and test of @objectstack/service-knowledge (5 files / 65 tests) and @objectstack/mcp (84 / 1493). Ablation via scripts/ablation-replace.mjs: guard 'if (record.sourceIds.length === 0) {' -> 'if (false) {' turned the empty-sourceIds pin red (1 of 16), restored blob == HEAD 3114dc6ab9ad, git diff HEAD empty.", "gates": "Not re-derived for this round: the delta touches service-knowledge src + two test files + the changeset, all inside the round-1 derivation; CI runs the full set on the new head (in_progress at report time).", "deviations": [ "The round-1 local runs of spec, lint and runtime suites were not repeated: those packages are unchanged by this delta." ], "mcp_calls": "1 this round: pull_request_read get_comments (to read review 7120785446); no write tool", "api_writes": "2 relay strokes this round: issue_patch on #36823 (PR body), this comment", "open_questions": [], "security_findings": "none" }objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Blocked-by: #36839
Ruling recorded 2026-11-24T03:32Z — the maintainer, in the seat's session
session_01QSeKYpEsWWE9Y5YtSsDgqZ, answering the seat's E1 presentation (options A–G, four-axis analysis, recommendation D; timing 甲 / 乙), verbatim:Read as: E1 → option D (the knowledge service also asks the exposure decision and the caller's field-level read rules, at source granularity, fail closed), carried by the new sub-issue #36839; timing → 甲: #36839 lands first, PR #36823 lands after it. PR #36823 itself is unchanged by the ruling (its L2 delta record on head
ad74f6f069849c64cab87c1ad86006fc59b746e4is PASS, comment 7120942740); once #36839 merges, PR #36823 mergesmainand is re-checked on that head before landing. The claim on this card stands.objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYnEwQiHFXyLjP4vcfa
os-dev-report
{ "issue": 36650, "status": "done", "round": "rework 2 (merge origin/main after #36850)", "branch": "claude/issue-36650-mcp-search-knowledge", "pr": "https://github.com/objectstack-ai/objectstack/pull/36823", "session": "session_01QSeKYnEwQiHFXyLjP4vcfa", "head": "b5d0b60d247b9a46464c61a480527be2743b46b7 (merge of origin/main 8e4ac50d43 into ad74f6f069; no rebase, no force-push)", "conflicts_resolved": [ "packages/services/service-knowledge/src/index.ts: export block, both kept (this PR's knowledge-tools exports + main's KnowledgeFieldSecurity type and knowledge-settings-contribution exports)", "packages/services/service-knowledge/src/knowledge-service.ts: import block, both kept (createKnowledgeTools/KnowledgeTools + main's knowledge-source-admission imports)" ], "summary": "Merged origin/main. #36850 moved API-exposure and field-level admission into KnowledgeService.search() (admitSources over resolveSearchTargets); the search_knowledge executor still calls search() with the caller's executionContext and explicit exposed sourceIds, so its calls now pass that admission too. No code change beyond the two conflict resolutions. PR body not patched: the executor's description is unchanged.", "tests": "On b5d0b60d24 under os-verify-lock, VERDICT command-exit 0: pnpm install --frozen-lockfile (service-knowledge package.json moved on main); build of the mcp, runtime and service-knowledge closures; typecheck of service-knowledge and mcp; test of service-knowledge (8 files / 102 tests) and mcp (84 / 1493). Also: spec check:generated exit 0 (14 artifacts current; spec moved on main), service-knowledge knowledge-tools.test.ts 16/16, runtime mcp-knowledge-tools-bridge.test.ts 6/6, lint validate-ai-tool-references.test.ts 29/29.", "ci_previous_head": "Test UI (5/16) on ad74f6f069 (run 45317954048, job 138191441367) was not a test failure: 448 files / 5136 tests passed (36 skipped), shard verify-ran and attestation green; the job failed at actions/upload-artifact 'Failed to FinalizeArtifact: Unable to make request: ECONNRESET'. No useDeferredFirstSend failure in it.", "gates": "CI on b5d0b60d24: in_progress at report time.", "deviations": [ "The first merge attempt ran in the shared checkout because an earlier command in the chain failed; it was aborted there with git merge --abort (clean, HEAD unchanged at ad74f6f069) and redone in the dedicated worktree." ], "mcp_calls": "5 this round: pull_request_read x0, actions_list x2 (list_workflow_runs, list_workflow_jobs), get_job_logs x2, ToolSearch loads not counted; no write tool", "api_writes": "1 relay stroke this round: this comment", "open_questions": [], "security_findings": "none" }objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Close-out · 2026-11-24T17:59Z · PR #36823 merged, closing this card by
Fixes #36650.Delivered:
search_knowledgeis served on the MCP door (HTTP and stdio) from the knowledge service's one definition and executor (ADR-0149 D2), searching only sources whoseaiExposedis notfalse, as the caller;prompts/listoffers a skill binding it where the tool is served; the lint rule flags a projected skill binding a tool the HTTP door does not serve. Its exposure and field-level posture comes from #36839 (PR #36850, merged first): every gate ofKnowledgeService.searchapplies to the tool. Epic #37000's #36991 is unblocked (zone a4-K has claimed it).pm:dispatchedstripped in this stroke.