Skip to content

os start / os dev 的 --database 描述手写了一份 URL scheme 举例,相对 inferDriverTypeFromUrl 实际识别的 scheme 不完整 #7028

Description

@os-project-manager

observation 级(今天没有用户会撞到)——由 #6969 顺手发现,按 Prime Directive #10 不在那个 PR 里修。

现状

packages/cli/src/commands/start.ts 与 dev.ts 的 --database flag 描述里手写了一串 URL scheme 举例:

Database URL: file:./db.sqlite | libsql://... | postgres://... | mongodb://... | memory://

而真正决定「哪些 scheme 会被识别成驱动」的是 packages/cli/src/utils/storage-driver.ts 的 inferDriverTypeFromUrl()。两边对照,散文里没提到的还有:mysql:// / mysql2://、sqlite:、wasm-sqlite://、mongodb+srv://、:memory:、.db / .sqlite / .sqlite3 后缀、以及 https://*.turso.*。

为什么归为 observation 而不是缺陷

可选的收口方向(留给 triage 定夺,不预设)

  1. 什么都不做——举例就是举例。
  2. 把散文补齐到与 inferDriverTypeFromUrl 一致(治标:仍是手写副本,仍会漂移)。
  3. 先让 scheme 词表有一处定义(例如把 inferDriverTypeFromUrl 的匹配改成表驱动),再让描述从它派生——与 cli/runtime: explicit driver(--database-driver / OS_DATABASE_DRIVER)在 CLI 与 standalone stack 之间仍有三处分叉(#6265 后续) #6345 / --database-driver 的 oclif 白名单改为从共享驱动表推导 —— 裁定第 3 项「一个词表、一处推导」的后半(阻塞于 PR #6910) #6969 对驱动 id 走的是同一条路。方向 3 才是结构性的,但它要的是一次真正的重构,不是文案修补。

关联

#6969(驱动 id 词表的同类收口,本 finding 的来源)· #6345(一个词表、一处推导)· packages/cli/src/utils/storage-driver.ts 的 inferDriverTypeFromUrl()

Activity

  1. os-project-manager commented on Aug 9, 2026

    @os-project-manager
    CollaboratorAuthor

    判级:维持 finding,不入队

    席位判级(domain:cli)。本卡自己的推理成立,复核后无异议:

    1. 该 flag 没有 options: 白名单 —— 散文是举例,不是可接受值的声明。列举不全不拒绝任何合法输入,所以今天没有用户会因此撞到任何东西。
    2. 已列的每一条 scheme 都确实被 inferDriverTypeFromUrl() 识别 —— 没有一条是错的,只是不全。
    3. 与 --database-driver 的 oclif 白名单改为从共享驱动表推导 —— 裁定第 3 项「一个词表、一处推导」的后半(阻塞于 PR #6910) #6969 那处形状确实不同:那处是 oclif 的强制白名单(不在表里就被拒),两份副本里有一份是契约;这处两份都不是契约。

    ⇒ observation 级,不构成缺陷,不入队。

    三个方向里只有一个不是化妆

    重启条件(记在这里,免得下次重新推一遍)

    本卡在下列任一条件成立时才值得重开,否则保持不动:

    • --database 被加上 options: 白名单(散文从举例变成契约的那一刻);或
    • scheme 词表因别的原因已经被表驱动化(此时「让描述派生」从重构降级为接线,成本塌陷);或
    • 出现第三处手写 scheme 副本(三份副本意味着漂移已经在发生,而不是可能发生)。

    在那之前,补齐散文只会把一份会漂的副本换成另一份会漂的副本。


    Generated by Claude Code

  2. claude commented on Aug 10, 2026

    @claude
    Contributor

    Findings round (periodic re-verification): HOLD maintained (finding + domain:cli unchanged). Re-checked @ origin/main 603cab8: --database still carries no options: whitelist and inferDriverTypeFromUrl is still the regex chain at packages/cli/src/utils/storage-driver.ts:217 — neither restart condition (prose becomes contract, or the scheme vocabulary gets a single definition) has fired.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  3. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings triage: HOLD.

    Re-verified @ origin/main 8dd98bf: the --database descriptions still carry the same five-example prose (start.ts:108, dev.ts:105) with no options: whitelist, and inferDriverTypeFromUrl (packages/cli/src/utils/storage-driver.ts:217) still recognizes the wider scheme set (mysql://, wasm-sqlite:// at :232, etc.). Neither restart condition has fired: the prose has not become a contract, and the scheme vocabulary still has no single definition to derive from. Observation stands — incomplete examples, none wrong, nothing rejected.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  4. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings triage round, 2026-08-11 (PM session, maintainer-directed: 「跑一轮集中定级」).

    Graded: close (not planned). The flag is free text with no whitelist — the prose is examples, not a declaration of acceptable values; every listed example is correct, and incompleteness rejects nothing. Deriving the prose from inferDriverTypeFromUrl's regex list would build shared-vocabulary machinery for a help string — cost above value at this stage. Reopen if the scheme vocabulary ever becomes a shared table (then the derivation is free) or a user is measurably misled. Maintainer veto window: reopen at will.


    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

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions