Bug Description
chkit pull includes ObsessionDB metadata tables in generated local schema files. These are product/system metadata tables rather than customer/business tables and should not be emitted as schema definitions.
Observed table names:
metadata_folder
metadata_table_folder
metadata_table_tag
Impact
Generated local schema files can include non-business ObsessionDB metadata tables, which pollutes the schema and can lead to accidental drift/migration expectations for tables users do not own.
Investigation Notes
- The pull plugin maps all introspected table-like objects into
table(...) definitions.
packages/plugin-pull/src/index.ts calls the configured introspector and directly canonicalizes/renders every returned object.
- There was no denylist for ObsessionDB product metadata tables before rendering.
- A regression test can reproduce this with an introspector returning a normal
events table plus the three metadata tables: the payload previously had definitionCount: 4 instead of 1 and the rendered content contained metadata table definitions.
Expected Behavior
chkit pull should exclude ObsessionDB metadata tables from generated schema output while preserving normal business tables, views, and materialized views.
Proposed Fix
Filter pull introspection results before rendering when the object is a table named:
metadata_folder
metadata_table_folder
metadata_table_tag
Verification
A local fix has been prepared with:
- Regression test:
packages/plugin-pull/src/index.test.ts — excludes ObsessionDB metadata tables from pulled schema output
- Test/type/lint/build commands:
PATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun test packages/plugin-pull/src/index.test.ts
PATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun run --cwd packages/plugin-pull typecheck
PATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun run --cwd packages/plugin-pull lint
PATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun run --cwd packages/plugin-pull build
Bug Description
chkit pullincludes ObsessionDB metadata tables in generated local schema files. These are product/system metadata tables rather than customer/business tables and should not be emitted as schema definitions.Observed table names:
metadata_foldermetadata_table_foldermetadata_table_tagImpact
Generated local schema files can include non-business ObsessionDB metadata tables, which pollutes the schema and can lead to accidental drift/migration expectations for tables users do not own.
Investigation Notes
table(...)definitions.packages/plugin-pull/src/index.tscalls the configured introspector and directly canonicalizes/renders every returned object.eventstable plus the three metadata tables: the payload previously haddefinitionCount: 4instead of1and the rendered content contained metadata table definitions.Expected Behavior
chkit pullshould exclude ObsessionDB metadata tables from generated schema output while preserving normal business tables, views, and materialized views.Proposed Fix
Filter pull introspection results before rendering when the object is a table named:
metadata_foldermetadata_table_foldermetadata_table_tagVerification
A local fix has been prepared with:
packages/plugin-pull/src/index.test.ts—excludes ObsessionDB metadata tables from pulled schema outputPATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun test packages/plugin-pull/src/index.test.tsPATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun run --cwd packages/plugin-pull typecheckPATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun run --cwd packages/plugin-pull lintPATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun run --cwd packages/plugin-pull build