Skip to content

metadata/loaders/database-loader.test.ts 的 mock driver supports 写满 off-spec 键(aggregations/nestedObjects/geoQueries/changeStreams…)—— 从未与 DriverCapabilities 对上 #4782

Description

@os-zhuang

#4634(DriverCapabilities 活性审计)期间发现,顺带记录,不在该 PR 范围内修(metadata 包不在其区域约束内,且不影响任何门禁/测试结果)。

现象

packages/metadata/src/loaders/database-loader.test.ts:36-47 的 mock driver:

supports: {
  transactions: false,
  joins: false,
  aggregations: false,      // ← 不是 DriverCapabilities 的键(那边叫 queryAggregations,现已退役)
  streaming: false,
  bulkOperations: true,     // ← 不存在的键
  nestedObjects: false,     // ← 不存在的键
  fullTextSearch: false,
  geoQueries: false,        // ← 不存在的键(那边曾叫 geospatialQuery)
  changeStreams: false,     // ← 不存在的键
},

一半键从未在 DriverCapabilitiesSchema 里存在过,另一半(transactions/joins/streaming/fullTextSearch)已于 #4634 退役。对象未做类型标注所以一直编译通过,也没有任何读者,纯属误导下一个照抄 mock 的作者。cloud 侧 ControlPlaneProxyDriver 的 fallback 字面量(supports: any)有同款问题,已另行记入 cloud 仓 issue。

建议

#4634 落地后改为 supports: {}(空广告即合法广告),删掉整块假键。一行修复。

发现于 #4634 审计,未认领。

Activity

  1. os-zhuang commented on Aug 6, 2026

    @os-zhuang
    ContributorAuthor

    存量裁决轮(维护者 2026-08-06 委托,session_01LeEfA7CFwbJb7JJmXm2KM3):裁定入队。前提经 origin/main 核实仍成立:database-loader.test.ts 的 mock driver supports 块仍写满 off-spec 键(transactions/joins/aggregations/…),与现行 DriverCapabilitiesSchema 完全对不上——误导下一个照抄者,小改动即可收口。维护者可否决。


    Generated by Claude Code

  2. hotlong commented on Aug 7, 2026

    @hotlong
    Contributor

    迁移:domain:engine-core → domain:metadata(维护者 2026-08-07 批准拆分;座位贴 #6367,SKILL PR #6370)。落点证据:修复文件即 packages/metadata/src/loaders/database-loader.test.ts:36-47(mock driver supports 收敛为空对象,driver 词表仅相邻不落 driver 包)。全量分类审计 49 卡三判,本卡 MOVE/high。分诊会话:session_01BickTBKm2JYSNnrtPT8ysa。


    Generated by Claude Code

  3. self-assigned this
    on Aug 7, 2026
  4. baozhoutao commented on Aug 7, 2026

    @baozhoutao
    Contributor

    Claim: PM loop round 1 (domain:metadata seat, sticker #6367)
    Session: session_01KDU3qAuJyajAQm3GkUXfdA
    Branch: claude/issue-4782-mock-supports-offspec
    Worktree: objectstack-issue-4782
    Domain: domain:metadata
    File surface: packages/metadata/src/loaders/database-loader.test.ts only. Stop on breach; explain in the report.
    Serial constraints cleared: none — no in-flight claim or queued PR touches this file (checked engine-core seat board, remote branches, and the current merge queue).
    Container class: S — mode:subagent, shared container.


    Generated by Claude Code

  5. baozhoutao commented on Aug 8, 2026

    @baozhoutao
    Contributor

    Correction to the claim above: the session ID contains a transposition typo. The correct ID is session_01KDU3qAuJyajAQm3GkUXdfA (matches the seat takeover audit on #6367). Branch, worktree, and all other claim fields are unchanged.


    Generated by Claude Code

  6. baozhoutao commented on Aug 8, 2026

    @baozhoutao
    Contributor

    ACCEPT (PM review, domain:metadata seat, session session_01KDU3qAuJyajAQm3GkUXdfA) — PR #6545.

    Shipped: the mock driver's supports block in packages/metadata/src/loaders/database-loader.test.ts converged to supports: {} with a comment recording that capability is METHOD presence, not a boolean. Review verified against GitHub: single-file diff exactly on the claimed surface; ESLint and TypeScript Type Check jobs both concluded success (27 checks, zero failures); premise re-verified on origin/main before implementation; reverse verification measured the honest direction (four TS2322 tombstone errors disappear, @objectstack/metadata tsc 92 → 88, ledger gate green by design). Tests-only ⇒ skip-changeset (label on and read back). Out-of-scope finding filed as #6546 (finding, unassigned, search-first).

    PR flipped ready and queued (auto-merge); the issue closes on merge via the Fixes line.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions