Skip to content

refactor: define sensor, event, provider and dev server internals natively - #375

Merged
kvlonge merged 2 commits into
mainfrom
refactor/native-sensor-facades
Nov 11, 2026
Merged

kvlonge merged 2 commits into
mainfrom
refactor/native-sensor-facades

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Why

Python in SQLTide should be a thin wrapper: only the documented authored API and third-party glue stay Python.

Changes

  • Sensor runtime shapes and enums, event observations and dev server shapes are native; the old modules re-export them.
  • Provider discovery is native and its Python modules are removed.
  • The authored sensor classes and declarations, AuditCompleted/RunCompleted, Provider and the dev server request bodies stay Python; retry validation and provider naming call native functions.
  • Package initializers no longer carry docstrings.
  • Boundary: remaining_lines 2685→1774. New stays: rule 3 sensors/models.py, events/models.py, providers.py; rule 1 sensors/types.py; rule 4 dev_server/models.py. Removed stay: provider/main/_discover_provider_classes.py.

Introspection and subclassing of internal shapes

As in the previous shape releases: native shapes have no vars()/__dict__, generic field types, annotations and signatures, and passing imports of old modules are gone (no docs or examples use them). Package __doc__ is now None.

Verification

make check-ci on the final head; goldens unedited. New regression tests, each passing on 0.65.13 first, pin sensor identity fingerprints with literal values, retry-policy and step validation messages, provider-discovery errors and module eviction, and event dispatch by identity. Against 0.65.13: 6×1500 differential shape cases and 2,003 sensor fingerprints match; 6×400 provider-discovery projects match on outcome, error chain and module state; planted mutations are caught; CLI, sensor and dev-server API outputs are identical after masking.

…e native core

Sensor runtime shapes and enums, event observations, dev server shapes and
provider discovery are native. The authored sensor classes and
declarations, the event catalog classes, the Provider base class and the
dev server request bodies stay Python, with retry validation and provider
naming delegated to native functions. Sensor identity fingerprints are
unchanged and pinned by tests. Package initializers no longer carry
docstrings. Movable Python drops from 2685 to 1774 lines.
Provider discovery restores sys.path before rendering an import failure,
so an exception whose message cannot be rendered no longer leaves the
project directory on the path. Errors raised without an explicit cause
chain to the exception being handled, as a Python raise does. Sensor
identity fingerprints format each part as the previous f-string did.
@kvlonge
kvlonge enabled auto-merge (squash) November 11, 2026 04:47
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploying sqltide with  Cloudflare Pages  Cloudflare Pages

Latest commit: 87bf186
Status: ✅  Deploy successful!
Preview URL: https://5e82ba31.sqltide.pages.dev
Branch Preview URL: https://wip-native-facades.sqltide.pages.dev

View logs

@kvlonge
kvlonge merged commit 677ad64 into main Nov 11, 2026
17 checks passed
@kvlonge
kvlonge deleted the refactor/native-sensor-facades branch November 11, 2026 05:07
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.

1 participant