Skip to content

fix(cli): preserve literal knowledge observation queries - #4657

Merged
yannickmonney merged 1 commit into
mainfrom
fix/observation-knowledge-sql-literals
Oct 9, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/observation-knowledge-sql-literals

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

The knowledge observer inserted its corpus queries with a JavaScript replacement string. The SQL pattern’s dollar-apostrophe sequence was interpreted as a replacement token, removing the end anchor and closing quote and causing PostgreSQL to reject the query before producing the inventory.

Use a replacement callback to preserve the source-owned SQL literally. A regression checks both complete corpus patterns; transaction limits, read-only scope and inventory validation are unchanged.

Validation: the added regression fails on the original source; the original generated query fails on real PostgreSQL while the repaired query returns both migration ledgers and both corpus inventories inside READ ONLY/ROLLBACK. All 76 observer tests (1,703 assertions), CLI lint/typecheck, 162 applicable SAST rules on the changed production file and normal commit hooks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant