Skip to content

service-knowledge: search returns a short page after the permission filter instead of refilling #36993

Backlog

Description

@os-bob

maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby

Filing gate: ① product defect. Source: topic #36990.
Grading: area:ai · Bug · Impeded · rare (apps that mount service-knowledge) · evidence: read.

维护者速读

  • 问题:检索先取前 K 条,再按权限过滤,过滤完不补。一个人能看的记录越少,搜到的越接近空。
  • 修法:第一轮多取一些;过滤后不够,再取一轮。
  • 需要你做的:无。

What

  1. knowledge-service.ts search / applyPermissionFilter: first round asks each source for topK × 5; when fewer than topK survive and the adapter returned as many as asked, a second round asks up to topK × 20. At most two rounds (each embeds the query once).
  2. Counting toward topK dedupes by sourceRecordId; what is returned stays chunk-level hits.
  3. System context: one round of topK, no refill. No context: fail closed as today.
  4. The number of hits removed by the filter goes to logs only, never into the result. search's return type is unchanged.
  5. Build on the shape security(knowledge): search hits skip the API-exposure decision and field-level read rules every other row-serving door applies, now that the MCP door serves search_knowledge #36839 leaves in the same function.

Acceptance

  • 100 hits, the caller can read 5 → returns those 5 (within the cap); several sources; an adapter that caps topK does not loop; return-type snapshot unchanged.
  • Container run per AGENTS.md.

Blocked-by: #36839 (same function)
Parent: #36990. Reader: the server lane for service-knowledge.
Dedupe: knowledge search permission filter topK 1 (#36839, claimed by another seat, different mechanism) · applyPermissionFilter 5 (open: #36839 only).

Activity

  1. added
    area:ai
    on Nov 24, 2026
  2. added theissue type on Nov 24, 2026
  3. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: state pm:blocked. Grade, area and type stay as the maintainer filed them. The card's own Blocked-by: names #36839, which is still open, so it waits as blocked. The unlock scan moves it to pm:queue when that closes. Topic order per the parent's table.

  4. added
    pm:blocked
    on Nov 24, 2026
  5. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: unblocked 2026-11-24T16:42Z

  6. added
    pm:queue
    and removed
    pm:blocked
    on Nov 24, 2026
  7. added
    priority:p2
    and removed on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aipm:queuepriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions