Cursor Build Prompt¶
Maintainer tooling
This page is for maintainers and coding agents. End users should start at Start here.
Build and maintain RowGuard from the architecture and specification documents in this repository.
Current shipped release: 0.6.0. Do not re-implement 0.1.0–0.6.0 unless fixing
regressions. Next planned milestone is 0.7.0 (plugin system) per
ROADMAP.md and docs/developer/MILESTONES.md (MILESTONES is authoritative).
Shipped through 0.6.0¶
Python 3.10+
Pydantic v2
SQLAlchemy 2.x
SQLRules integration (
sqlrules>=1.0.0,<2)SQLAlchemy Core
TableandSelectSQLAlchemy ORM mapped classes (projected + single-entity)
SQLModel table sources (
rowguard[sqlmodel])Sync
Session/Connectionand asyncAsyncSession/AsyncConnectionselect(),execute(),validate_rows(),compile_plan(),stream()aselect(),aexecute(),astream()StreamResult[T]/AsyncStreamResult[T]with context-managed cleanupStreamObserver/BaseStreamObserverprogress hooks (sync callables)Staged immutable
ExecutionPlanand planning configsQueryResult[T],RejectedRow(incl.source_identity),QueryStatisticsRejection policies:
raise,collect,skip,log,callback,quarantineAsync reject callbacks / quarantine providers on async APIs
Rejection thresholds (
max_rejections,max_rejection_rate)Mapping-based validation default; opt-in
orm_validation="from_attributes"Unloaded/deferred attribute errors (
unloaded_attributes="error")SQLite unit + integration + streaming + async + ORM/SQLModel tests
Strict typing
No ORM relationship traversal
Implementation Rules¶
Read all documents under
docs/; treat MILESTONES as authoritative for scope.Preserve package boundaries:
SQLAlchemy owns SQL.
SQLRules owns constraint compilation.
Pydantic owns validation.
RowGuard owns orchestration and rejection handling.
Keep public APIs thin.
Use immutable plans and result objects.
Keep mutable state per execution.
Add tests before moving to the next subsystem.
Do not implement deferred features ahead of their milestone.
Keep docs aligned with code (especially README / API.md / SPEC.md).
Run Ruff, mypy, pytest, and benchmark smoke tests before completion.
Next Deliverable¶
Implement the 0.7.0 plugin system required by
docs/developer/MILESTONES.md, without breaking 0.6.x call sites.