Files
3ab1db27e3 fix(sqlite): accept the documented sqlite_master spelling of the schema catalog (#10277)
* fix(sqlite): accept the documented sqlite_master spelling of the schema catalog

SQLite's schema-table documentation, "Alternative Names", recognizes four spellings and says
plainly that `sqlite_master` "works anywhere" while the two `sqlite_temp_*` forms only resolve for
the TEMP database. The inspector accepted exactly one of them.

`table: "sqlite_master"` was refused with "Selected ordinary table does not exist with that exact
name: sqlite_master", which is factually wrong for a name the engine resolves:

| same library, same connection | result |
| --- | --- |
| `SELECT count(*) FROM sqlite_master` | 1 |
| `SELECT count(*) FROM sqlite_schema` | 1 |
| `SELECT count(*) FROM pragma_table_list WHERE name = 'sqlite_master'` | **0** |
| `pragma_table_xinfo('sqlite_master', 'main')` | `type, name, tbl_name, rootpage, sql` |

The stored-catalog identity comes from `temp.pragma_table_list` with a `COLLATE BINARY` exact-name
match, and that inventory lists the catalog under its canonical spelling only, so the alias never
reached the row-source facts that already work. All three schema scopes threw.

Both spellings now yield the same rows and order, and the catalog still publishes no invented
declaration:

| spelling | before | after |
| --- | --- | --- |
| `sqlite_schema` | rows, `order: rowid` | unchanged |
| `sqlite_master` | THREW | rows, `order: rowid`, no self-declaration |
| `sqlite_temp_schema`, `sqlite_temp_master`, `SQLITE_MASTER` | THREW | still THREW |
| `absent` | THREW | still THREW |

Only the everywhere-alias is added. The TEMP-only spellings and a case variant stay refused,
because SQLite does not resolve them here either.

The guide now names both spellings instead of promising one exact name.

`tests/boundary/sqlite` and `src/application/sqlite` — 79 passing, 1 skipped, 6 new cases.
Reverting the normalization fails three of them.

* test(sqlite): cover the alias through the service boundary

A review finding on the previous commit: the shared predicate change also alters
`SqliteDatabaseService.matchesSelectedSchema`, which decides CLI and MCP result admission, and
nothing exercised the alias there.

The alias case now runs through the service twice — once against a report whose catalog carries no
self-declaration, which must be admitted, and once against a report that declares the table, which
must stay an output error. Dropping the alias from `sqliteSchemaHasObjectDeclaration` fails it.

* refactor(sqlite): derive the catalog declaration check from its spelling owner

---------

Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-26 10:45:06 -05:00
..

Documentation directory

Find an installation step, investigation guide, or contributor reference by task. The REA website has worked examples and product pages.

Getting started

Desktop applications

Agent environments

Native binaries

JavaScript and Electron

Browser and captured websites

Android applications

Apple applications

.NET assemblies

Firmware

HarmonyOS packages

Packages and metadata

WebAssembly

EVM contracts

Databases and recorded packets

Process capture and instrumentation

Provider setup and formats

Contracts and evidence

Development and verification

Release migrations

Signal recordings

Generated files and release records

Path Owner and update command
public/product-catalog.json Ignored contract projection; npm run docs:generate
verification/managed-conformance-*.json Ignored managed conformance projections; npm run evidence:generate
error-contract.schema.json Tracked schema from contracts; npm run docs:error-schema
user-visible-errors.csv Generated error code and category per domain and provider-owned error case; npm run docs:error-schema
releases/<version>.contributions.json Durable release contribution record; follow the release guide

Regenerate catalogs and Evidence projections from their canonical source. Release records preserve the exact commit messages and references for each release. Guides share authored images in assets/.