Skip to content

migrate duplicates: no_sql_seam loud-refusal is dead code for the memory driver (false all-clear) #10677

Description

@baozhoutao

Found by QA run #10663 driving cli.migrate-duplicates-inventory at framework 79ebb37.

Symptom

os migrate duplicates --database-url memory://qa → exit 0 with a clean empty report (duplicates:[], counters.status:"read") instead of the intended {error:"no_sql_seam"} exit 1. This is the exact "indistinguishable from never looked" false all-clear that the #8928 ruling exists to prevent — a scan that reports "no duplicates" over a driver it cannot actually query.

Root cause

InMemoryDriver.execute() (packages/drivers/driver-memory/src/memory-driver.ts:300-302, confirmed in the loaded dist) logs WARN Raw execution not supported in InMemory driver and return null — it neither throws nor is absent. So resolveSeedTenancySeam's canRun (seed-tenancy-backfill.ts:247, typeof d.execute === 'function') sees a usable seam, resolveSeedTenancyExec returns a non-null exec, and the if (!exec) guard at duplicates.ts:697 never fires. Every probe then calls the no-op execute → null → normalizeRows([]) → no throw, no .skipped entry. The no_sql_seam refusal is effectively dead code for the memory driver — one of the two drivers the clause/knownGap explicitly name. Reproduced across 3 URL variants, deterministic.

Suggested fix

Either have InMemoryDriver.execute() throw an explicit "raw SQL not supported" error (so the seam is honestly absent), or make resolveSeedTenancyExec/duplicates.ts treat a null-returning execute as no-seam and take the no_sql_seam branch.

Note for the checklist

The item's clause-7 knownGap ("the memory and mongodb drivers expose no raw-SQL seam") is factually wrong for the memory driver — it exposes a no-op execute seam. @objectstack/driver-mongodb is not installed in the QA container, so the genuinely seam-less mongodb branch was not reachable this run. The six other clauses pass — the scan itself is correct.

QA-source: #10663 · cli.migrate-duplicates-inventory · clause 7 (seam-less driver refuses loudly, no_sql_seam, exit 1)

Activity

  1. added theissue type on Aug 21, 2026
  2. os-zhuang commented on Aug 21, 2026

    @os-zhuang
    Contributor

    Triage: lands in packages/cli (seed-tenancy-backfill.ts seam resolution + duplicates.ts:697 guard) ⇒ pm:queue · domain:cli · type Bug. Rationale: the #8928-mandated loud refusal is dead code on the memory driver — a scan that cannot query reports a clean pass, exactly the false all-clear the ruling exists to prevent. Deterministic repro in the card.

    Dispatch notes:

    • Fix route constrained by the driver freeze: the maintainer's 2026-08-05 investment freeze covers the driver-memory/driver-mongodb family — take the CONSUMER-side route: resolveSeedTenancyExec/duplicates.ts treats a null-returning execute as no-seam and takes the no_sql_seam branch. Do not modify InMemoryDriver.execute() without a maintainer ruling, even though a throwing seam would be the tidier contract.
    • Same PR may carry the one-line checklist correction the card names (clause-7 knownGap text: the memory driver exposes a no-op seam, not no seam) — after the fix the knownGap wording becomes accurate again; keep it consistent with what actually lands.
    • The mongodb branch stays unverified (driver not installed in the QA container) — don't claim it in tests you can't run.

    Size/model suggestion: S-to-M, opus floor (behavioral guard + pin).


    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

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions