Repository navigation
Conversation
The b2c-mcp-cip skill now says to describe tables before custom SQL and names the real columns agents guess wrong (num_orders, site_display_name), and adds a SQL dialect section: reserved words as aliases, DATE literals, EXTRACT for months, no DATEADD. Adds an eval case with regex graders for reserved aliases and guessed columns. Co-Authored-By: Claude <noreply@anthropic.com>
clavery
requested review from
patricksullivansf,
wei-liu-sf and
yhsieh1
as code owners
November 18, 2026 01:55
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.
Summary
When agents moved past the curated CIP reports and wrote their own SQL, the queries often failed on the first try. The agents guessed column names (
orders,units,site_name) and used Calcite reserved words as bare aliases (AS month,AS date). These cases come from real agent sessions using the CIP tools.b2c-mcp-cip): a new workflow step says to describe each table withcip_discoveraction: "table"before writing custom SQL and to use only the column names it returns. It also lists the real names that agents guessed wrong (num_orders/num_units,site_display_name,npromotion_id/display_name). A new SQL dialect section covers reserved-word aliases, date literals, month grouping withEXTRACT, the lack ofDATEADD, and safe division and rounding.STARTER_QUERIES.md): adds a one-line warning about reserved words.cip/custom-sql-grounding, has regex graders that fail when the trace containsSUM(orders)/SUM(units)or a bare reserved-word alias.The column names come from the curated report SQL in
operations/cip/reports.ts.Testing
The new eval case has not been run yet (
pnpm run mcp:eval --case custom-sql-grounding).