Introduce two canonical metadata surfaces for agents:
lix_catalog_tableslix_catalog_columns
MVP goal: let agents discover the current public Lix surfaces and their columns from SQL.
The engine already knows table and column shapes, but that knowledge is split across registries, constants, and rewrite code. Agents need one stable SQL source of truth for:
- Which public surfaces exist.
- Which columns each surface exposes.
In scope:
- Engine-level read-only metadata surfaces for tables and columns.
- Population logic based on current engine metadata sources.
- Coverage for public core surfaces and dynamic entity views backed by builtin schemas and
lix_registered_schema.
Out of scope (MVP):
lix_catalog_functions- Unknown table/column error integration
information_schemacompatibility- Rich type/capability metadata that is not already cheap to derive from current engine logic
One row per public queryable surface.
Required columns:
table_name(TEXT, PK)schema_key(TEXT, nullable; populated for entity views)
One row per column per public queryable surface.
Required columns:
table_name(TEXT)column_name(TEXT)ordinal_position(INTEGER)
Primary key:
- (
table_name,column_name)
Populate catalogs from the current engine logic, without introducing a new metadata system first.
- Start from the public core surface names already registered in
PUBLIC_LIX_TABLE_REGISTRY. - Enumerate entity views from builtin schemas plus the latest registered schemas visible through
lix_registered_schema. - Emit concrete public
table_namerows exactly as the engine exposes them, for examplelix_state,lix_state_by_branch, andlix_file_history. - For entity views, emit only the concrete table names the engine currently resolves, such as base,
_by_branch, and_historynames. - Do not invent
_history_by_branchentity-view table names unless the engine actually resolves them.
- Use the in-code
lix_table_registry/PUBLIC_LIX_TABLE_REGISTRYwhere a core surface already has explicit columns there. - Use the current state-column constants for
lix_stateandlix_state_by_branch. - Use the current projection definitions for
lix_branchand the workspace branch selector. - Use entity-view target resolution plus projected columns for entity views.
- Keep rows keyed by the concrete public
table_name, solix_file,lix_file_by_branch, andlix_file_historyeach get their own rows.
Do not infer canonical metadata from sqlite_master or pragma_table_info at runtime.
- Reuse the current engine source of truth per surface family, even if that means the catalog is assembled from multiple code paths in MVP.
- For registered schemas, use the latest schema definition per
schema_key; MVP does not need historical schema catalog entries. - The catalog only needs to describe public queryable surfaces. Internal tables and internal vtables stay out of scope for MVP.
- Phase 1: Add stable schemas for
lix_catalog_tablesandlix_catalog_columns. - Phase 2: Populate public core surfaces from existing registries, constants, and rewrite projections.
- Phase 3: Populate entity-view rows and columns from builtin schemas plus latest
lix_registered_schemarows. - Phase 4: Add regression tests that keep catalog output aligned with current public surface logic.
SELECT table_name FROM lix_catalog_tables ORDER BY table_namelists the current public core surfaces.SELECT column_name FROM lix_catalog_columns WHERE table_name = 'lix_file' ORDER BY ordinal_positionreturns the currentlix_filecolumns.SELECT column_name FROM lix_catalog_columns WHERE table_name = 'lix_state' ORDER BY ordinal_positionreturns the currentlix_statevisible columns.- Builtin and stored-schema-backed entity views appear in
lix_catalog_tables. lix_catalog_columnsreturns projected columns for registered-schema-backed entity views.- No function catalog is required for MVP.
- Unit tests for table rows generated from
PUBLIC_LIX_TABLE_REGISTRY. - Unit tests for
lix_state,lix_state_by_branch,lix_branch, and workspace branch selector column generation. - Unit tests for entity-view table and column generation from builtin and registered schemas.
- Regression tests to keep catalog output in sync with current public surface logic.
- 2026-03-05: MVP narrowed to
lix_catalog_tablesandlix_catalog_columnsonly. - 2026-03-05: Removed
lix_catalog_functionsand error discoverability from MVP scope. - 2026-03-05: Anchored entity-view discovery to builtin schemas plus latest
lix_registered_schemarows.