Repository navigation
Conversation
The AI review judged a change from the prompt alone. It now gets two tools over the synced schema of the database under review. search finds the objects whose name or definition contains a text. read returns the definition and statistics of the objects of up to 20 names. The tools read the synced metadata and nothing live. A definition is what the engine's renderer writes, with the parts it leaves out added: a renderer writes a schema dump, so it can leave out triggers, comments, or the collections of a table it has no columns for. A part is left out when the object renders the same without it. An engine with no renderer gets a plain listing. A result over 32 KiB is cut and carries next_from. The cursor of a read is a position in the definitions laid end to end, so every overload of a function can be reached, and a cut never falls inside a character. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The AI review judged a change from the prompt alone: the target facts and the statements. This PR gives the model two tools over the synced schema of the database under review, so a finding can rest on a row count or on a view that reads the column.
search({text, schema, from})finds the objects whose name or definition contains the text, without regard to case. It answers "what depends on this table".read({objects: [{schema, name}], from})returns the definition and statistics of the objects of up to 20 names. A table comes with its columns, indexes, constraints, and triggers, and with its row count, data size, and index size.Part of BYT-9846. Follows #21523, where the executor ran without tools.
How
catalog.goholds the two tools. They take the schema proto the executor already loads for the target facts. They read nothing live and they make no store reads.catalog_definition.gobuilds the definitions. A definition is what the renderer inbackend/plugin/schemawrites, the same text the product shows a user. A renderer writes a schema dump, so it leaves parts out: the MySQL one writes no triggers, and the PostgreSQL one skips a trigger an extension owns and writes a bare table when the sync holds no columns. The tools add such a part. The test is a second rendering without the part, and an equal result means the part was left out. An engine with no renderer gets a plain listing with every part.next_from. The model repeats the call withfromset to it. Forreadthe cursor is a position in the definitions laid end to end, so every overload of a function can be reached. A cut falls behind a line break and never inside a character.AIReviewExecutorpasses the tools in place ofNoTools, which is removed.Tests
catalog_test.gocovers PostgreSQL, MySQL, and an engine with no renderer. It covers search by column, trigger, foreign key, and enum value, name lookup, schemas that differ in case, overloads, every comment the sync stores, the parts a dump leaves out, and bad arguments. The paging tests follownext_fromto the end and compare the joined text with the source.model_ai_test.gouses the real tools in place of the canned catalog.review_run_lifecycle_test.gocreates a table in the target database and syncs it. The stub model callsread, and the test asserts the result carries that table.Known limits
🤖 Generated with Claude Code