Skip to content

Advice per table, and advice/data_classes in the Node.js and .NET clients (#291, #294) - #313

Merged
jmmana merged 2 commits into
mainfrom
feat/advice-per-table
Dec 3, 2026
Merged

jmmana merged 2 commits into
mainfrom
feat/advice-per-table

Conversation

@jmmana

@jmmana jmmana commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Finishes the client and per-table parts of #291 and #294.

What it adds

  • Advice.tables: columns used per physical table and clause (projected, filtered, joined, grouped, ordered, in_functions), resolved the way Guard.explain() resolves columns (aliases, correlated subqueries, unqualified columns through the policy schema). It reuses that machinery instead of a second resolver. columns (as written) stays.
  • Protocol: ExplainResult lists the optional advice and data_classes.
  • Conformance: one explanation is the same in process, over the stdio engine and over HTTP (tests/conformance/test_explain_extras.py), and validates against the schema.
  • Node.js: Explanation.advice and .data_classes are typed. .NET: ExplainResult.Advice (QueryAdvice?) and .DataClasses, added as computed properties so the 1.0 positional record is not changed; parsing is manual (no reflection).
  • Docs (ADVICE and CLASSES EN/ES, PROTOCOL, both client READMEs) and changelog.

Found on the way

The Node.js generated types were stale: Policy was missing advice, data_classes, column_classes and not_sensitive (from #306 and #309), and CI did not notice. Regenerating fixes it, so TypeScript users of the local mode can pass those sections.

Tested

Python: 5 new per-table tests (aliases, schema-resolved columns, subqueries, stars, correlated subqueries, an ambiguous column left out) and 4 conformance tests; full suite, ruff, mypy and strict docs pass. Node: typecheck and the full suite (97). .NET: the full suite (110), including 2 new tests. All run locally.

Not done

The embedded engine binaries that the clients download are built from a release; this PR does not rebuild them, so local-mode clients get advice once a release ships it. Remote mode (HTTP) already returns it.

🤖 Generated with Claude Code

jmmana and others added 2 commits December 3, 2026 10:55
…mary (#293)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ents (#291, #294)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

2 participants