Draft
Conversation
Canonical low-level primitive for detecting UnboundTable nodes in an expression graph. Used by the ExprKind detection logic in subsequent steps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces ExprKind (Expr / PartialExpr) and writes it to metadata.json at build_expr time. Detection is automatic: expressions containing an UnboundTable node get kind=partial_expr; fully bound expressions get kind=expr. No user flag needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds _extract_kind() which reads the kind field written by build_expr from the tgz archive. _load_catalog_row now uses it so the TUI displays expr vs partial_expr correctly. Old builds without a kind key fall back to "expr". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Makes these symbols available at xorq.catalog.api so the MCP server, CLI, and downstream consumers can import them without reaching into internal modules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nbound exprs Four tests covering both layers: - test_build_expr_kind_bound / _partial: verify metadata.json at the compiler level - test_extract_kind_bound / _partial: verify the full stack through a real catalog entry and the TUI helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_extract_kind() in tui.py was a free function that re-opened the tgz to read metadata.json. Moving it onto CatalogEntry as a .kind property puts the logic where it belongs — next to .expr and .aliases — and gives every consumer (TUI, CLI, MCP server) a single, consistent way to query the kind without knowing about the tgz layout. tui._load_catalog_row now reads entry.kind directly. The _extract_kind helper and its json import are removed from tui.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s property _extract_backends() in tui.py read profiles.yaml from the tgz to return backend names. Moving it onto CatalogEntry as a .backends property keeps all tgz-reading logic on the entry object itself, alongside .kind and .expr. tui._load_catalog_row now reads entry.backends directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntry Deduplicate tarfile+yaml reading logic shared by kind and backends properties into a single instance method that takes a DumpFiles enum value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Read kind from expr.yaml before loading the full expression; raise ValueError with a clear message directing users to compose-add. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Display ExprKind alongside each entry name so users can distinguish runnable (expr) entries from those needing composition (unbound_expr). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds `strict=True` parameter that raises ValueError when more than one UnboundTable is found, guarding against unsupported multi-source unbound expressions. Includes four tests covering all cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ec449bd to
986d60e
Compare
…ecution Adds `xorq catalog schema <name-or-alias>` command that prints Schema In (for unbound/partial expressions) and Schema Out (for all entries) by reading expr.yaml directly from the tgz — no backend connection required. - CatalogEntry.schema_out / .schema_in cached properties parse expr.yaml - CatalogEntry._parse_schema_* staticmethods handle dtype dict → str conversion - Catalog.get_entry() resolves both entry names and aliases - --json flag for machine-readable output - Shell completion covers both names and aliases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…guarantee Now that has_unbound_table enforces at most one UnboundTable at build time, replace the early-return loop with an explicit next()/None pattern that makes the single-match assumption clear. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
986d60e to
c882a50
Compare
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.
depends on #1682