ReviewOS

home-lang/home

Port SQLite URL parsing and filesystem error contracts

#206
Closed chris opened this 10 days ago ·
10 days ago

Context

The sequential Bun corpus frontier is now at js/sql/sqlite-url-parsing.test.ts (position 3945/4708), immediately after the 231-test SQLite SQL suite landed in 877769f7ba383b48c548271896286704bc3d95ae.

Tracks the focused follow-up to #205 and contributes to #66.

Current gaps

  • Empty file:// paths normalize to :memory: but Bun expects /.
  • Odd or invalid SQLite paths can reach native createDirPath and emit an unexpected errno: 45 stack instead of a stable SQL-facing error.
  • Protocol/path combinations need consistent preservation of percent-encoded and platform-specific forms.

Acceptance criteria

  • js/sql/sqlite-url-parsing.test.ts passes completely in the Home Bun corpus runner.
  • sqlite:, sqlite://, file:, and file:// path forms match Bun's normalization contracts.
  • Invalid/uncreatable paths produce deterministic user-facing errors without leaking native errno stacks.
  • Existing SQLite SQL and SQL adapter permanent gates remain green.
  • Add this file to the permanent SQL gate with its exact pass count.
10 days ago

Completed on main in 09fff6f2aac9fc2c70b4602ab50d33586c13520e (fix(sql): match SQLite URL lifecycle).

Results:

  • js/sql/sqlite-url-parsing.test.ts: 176 passed, 0 failed, 0 TODO, 0 unsupported.
  • file:// forms now use the same file-URL conversion/fallback behavior as Bun.fileURLToPath, including / for the empty URL and correct percent/platform path behavior.
  • SQLite database creation is lazy and occurs on first query, so URL/options inspection no longer touches malformed or foreign-platform paths and no longer emits native unexpected errno stacks.
  • mode=rw exposes readonly: false without incorrectly setting create; mode=rwc remains the explicit creation mode.
  • The suite is pinned at 176 tests in the permanent SQL adapter gate; that gate passes alongside the 231-test SQLite SQL suite.

The sequential frontier advances through 3945/4708. The next SQL/TLS frontier is tracked in #207.

Sign in to comment on this issue.