Skip to content

test: pin SQL surface for curate and document exactly one SELECT rule - #285

Merged
kstonekuan merged 3 commits into
Hebbian-Robotics:mainfrom
Prateekathub:pin-curate-sql-surface
Sep 10, 2026
Merged

test: pin SQL surface for curate and document exactly one SELECT rule#285
kstonekuan merged 3 commits into
Hebbian-Robotics:mainfrom
Prateekathub:pin-curate-sql-surface

Conversation

@Prateekathub

Copy link
Copy Markdown
Contributor

Summary

Closes #279
Added the required documentation to CATALOG.md pinning the exactly-one-SELECT rule.
Added parameterized tests for PIVOT, DESCRIBE, and SUMMARIZE. I have decided to officially support DESCRIBE and SUMMARIZE since DuckDB parses them as SELECT, so they are marked as allowed in the tests.

Why

To fulfill the documentation and testing requirements outlined in issue #279 and ensure future developers don't accidentally remove the security guard.

Validation

Ran uv run ruff check --fix and uv run ruff format successfully.
Local pytest execution failed with ModuleNotFoundError: No module named 'fcntl' because I am on a Windows machine, so I am relying on the GitHub Actions CI to verify the tests run successfully on Linux.

Checklist

  • I added or updated outcome-focused tests for changed business logic.
  • I updated documentation for changed behavior, flags, formats, or requirements.
  • I ran uv run ruff check --fix, uv run ruff format, and uv run ty check.
  • I ran the relevant pytest suite. (Skipped due to Windows fcntl error)
  • I did not add recordings, generated media, credentials, private URLs, or runtime artifacts.
  • I preserved stored-data compatibility or documented an explicit version change.

@github-actions

Copy link
Copy Markdown

👋 Hi @Prateekathub — thank you so much for your first contribution to HFlow!

A maintainer will review your pull request as soon as possible. In the meantime:

💡 Tip: one open pull request per contributor at a time. Issues with an assignee are taken; everything else is fair game.

We are excited to have you here and appreciate your help making the project better! 🙌

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

DESCRIBE and SUMMARIZE pass the guard but do not produce a manifest: their output has no episode_id, and the next step refuses it. Pin them as incidental rather than supported.

TABLE episodes and VALUES (1), (2) are missing from the table and both work.

The docs line has no full stop, says curate() in a CLI section, and sits in the --sql-file paragraph.

_MULTI_STATEMENT_PAYLOADS now describes three of its rows.

@kstonekuan

kstonekuan commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

#453 merged and settled the DESCRIBE/SUMMARIZE question your way: both are refused now, along with PRAGMA and SHOW.

Rebase first. Two of your rows fail on current main, and the surface also grew: FROM-first, parenthesized SELECTs and VALUES are accepted and none is in your table, plus TABLE episodes.

Hebbian-Robotics#453 settled the DESCRIBE/SUMMARIZE question in the direction Hebbian-Robotics#279 offered:
they parse as SELECT but describe columns rather than selecting episodes, so
a manifest from one has no episode_id and every consumer refuses it. Both
rows flip to refused, and PRAGMA and SHOW join them.

Adds the rows the surface grew since: TABLE, VALUES, FROM-first and a
parenthesized SELECT. The last three are the ones Hebbian-Robotics#453's first attempt
refused on a text prefix, so they are the regression net for that.

The list is renamed from _MULTI_STATEMENT_PAYLOADS, which described three of
its thirteen rows, and carries an expected row count per row so an accepted
shape pins its output and not just its admission. The refusal pattern now
admits both spellings of the rule, since Hebbian-Robotics#453 gave the table-function
refusals their own wording.

The docs line moves out of the --sql-file paragraph, where it was a
sentence fragment about the Python function in a section about CLI
arguments, and into the curation section as prose.

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, merging.

Your PIVOT row and comment went in untouched; that is the one that reads like a false positive and is not.

#453 settled DESCRIBE/SUMMARIZE your way, so both flipped to refused and PRAGMA/SHOW joined them. Added the four rows the surface grew (TABLE, VALUES, FROM-first, parenthesized), gave each row an expected row count, renamed the list, and moved the docs line into the curation section.

@kstonekuan
kstonekuan merged commit 7236559 into Hebbian-Robotics:main Sep 10, 2026
6 checks passed
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.

The SQL surface curate() accepts changed with #271 and is neither documented nor pinned

2 participants