Skip to content

[finding][services] The mongodb and sqlite-wasm arms of the same factory still answer a missing optional package with the fault and no remedy #7385

Description

@os-help

Observation class (finding, no pm:queue). Found while implementing #7314 (PR #7384); filed unassigned rather than folded in, because #7314's scope is the libSQL/Turso arm and this is a sibling one.

Fact

packages/services/service-datasource/src/default-datasource-driver-factory.ts builds three drivers that ride in OPTIONAL packages, and all three used to answer an absent package with the fault and nothing else. #7314 / PR #7384 fixed one of them. The other two are unchanged:

sqlite-wasm driver requested but @objectstack/driver-sqlite-wasm is not installed (…).
mongodb driver requested but @objectstack/driver-mongodb is not installed (…).

Neither states the install command, neither states what happens next, and neither names the datasource that failed — while the turso arm beside them now states all three, and the host loader in @objectstack/runtime has stated them for libSQL since #5602. An admin who adds a mongo datasource in Setup and an admin who adds a libSQL one hit the same class of problem and get two different qualities of answer, decided by which driver they picked.

The remedy text is not the only thing missing: PR #7384 exports TURSO_DRIVER_PACKAGE / TURSO_DRIVER_INSTALL_COMMAND / missingTursoDriverMessage, so "how do I install the optional driver" now has one declaration for libSQL and none for the other two.

Why it is observation-grade rather than a defect

Nothing is broken. The failure fires at the right moment, is a refusal rather than a fallback, and interpolates the underlying import error — which is what keeps isUnbuiltWorkspaceFailure (connect-failure-remedy.ts) able to recognise a half-built checkout from these arms at all, since the re-throw drops the original code. What is missing is the operator's next step, which the sibling arm now provides.

Severity is deliberately not asserted; filed plainly for triage.

Shape a fix would take, if triaged

Generalise missingTursoDriverMessage into one builder over (driver id, package name, install command) and use it from all three arms, keeping the two discipline points PR #7384 landed under: name the datasource, and name exactly one fix with no escape-hatch env var (connect-failure-remedy.ts, #5794). Whether the pnpm add / yarn add parenthetical and the "refuses rather than falling back to another engine" clause generalise verbatim is worth a look — the consequence sentence is specific to a remote database being shadowed by a local one, which is exactly true for mongo and is a weaker statement for sqlite-wasm.

Related: #7314 (the libSQL half, fixed by PR #7384), #7243 (datasource.pool silently dropped in the same file — same "declared ≠ enforced" family, different surface).

⚠️ Unclaimed.


Generated by Claude Code

Activity

  1. claude commented on Aug 10, 2026

    @claude
    Contributor

    Triage (findings pass): promoted — finding removed, pm:queue added; domain:services kept (landing verified below). No ownership taken.

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


    Generated by Claude Code

  2. self-assigned this
    on Aug 10, 2026
  3. os-help commented on Aug 10, 2026

    @os-help
    CollaboratorAuthor

    Claim: PM loop round 6 (domain:services seat #6021)
    Session: session_015fkdTyGmMD5s8ZtEifvuGy
    Branch: claude/issue-7385-factory-missing-package-remedy
    Worktree: objectstack-issue-7385
    Domain: domain:services
    File surface: packages/services/service-datasource/src/default-datasource-driver-factory.ts + its test file. (Stop on breach; explain in the report.)
    Container & model: M, mode:subagent, model: opus
    Serial constraints cleared: PR #7384 (the turso-arm remedy, same file) MERGED at b0c16a561 — its missingTursoDriverMessage shape + content-pinned test pattern are the in-file template; no in-flight claim touches service-datasource (#7314's claim released, its remainder awaiting triage re-route to cli).


    Generated by Claude Code

  4. os-help commented on Aug 10, 2026

    @os-help
    CollaboratorAuthor

    ACCEPT — PR #7418, reviewed against GitHub rather than the report's own claims.

    What shipped. The sqlite-wasm and mongodb arms of default-datasource-driver-factory.ts now answer an absent optional package through a shared missingDriverPackageMessage(descriptor, args) builder, with the same constant seam #7384 introduced for libSQL (SQLITE_WASM_DRIVER_PACKAGE / _INSTALL_COMMAND / missingSqliteWasmDriverMessage and the MONGODB_ trio), all re-exported from the package index. Both arms now name the datasource, name exactly one fix, and interpolate the import error in full.

    What I verified myself, not from the report:

    One flagged surface extension, accepted. datasource-connection-service.test.ts hand-spelled the pre-#7385 sentence and would have gone on pinning a shape the factory can no longer emit; it now builds its input from missingSqliteWasmDriverMessage. Same package, same lane, declared in both the report and the PR body rather than hidden — a fixture that pins a string the producer no longer emits is a stale pin, so re-spelling it is part of this change, not a rider.

    Optionality was measured rather than assumed, and the answer is not uniform: @objectstack/driver-sqlite-wasm is a hard dependency of both @objectstack/runtime and @objectstack/cli, while @objectstack/driver-mongodb is an optionalDependencies entry of runtime and a hard dependency of the CLI. So for a stock host neither missing-package path is reachable by omission the way turso's is; the reachable cause is a half-built workspace, which is exactly why the verbatim import error and the classifier pin carry the weight here. That table is in the PR body.

    Driving it to landing now: ready → auto-merge → merge queue, with the queue-branch read as the landing check.


    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