How sarthakdeshmukh34887-ui/sentinelsql works
SentinelSQL turns a natural-language question into guarded PostgreSQL results. The user enters through the CLI or production FastAPI gateway; the trusted pipeline screens input, assembles permission-filtered schema and approved metrics, obtains an untrusted structured draft, validates it deterministically, executes it read-only, verifies results, then masks and renders output. The diagram preserves the documented trust boundaries and major runtime subsystems. Some pipeline stages and wiring are unsampled; those links are omitted or marked unverified rather than inferred as certain.
Main entry points: pipeline.py Query pipeline · app.py CLI · schema.py Schema catalog · gateway.py REST gateway
Components 20
User interfaces
- CLI
sentinelsql/cli/app.py - REST gateway
sentinelsql/api/gateway.py
Trusted query control
- Query pipeline
sentinelsql/orchestrator/pipeline.py - LLM provider
sentinelsql/llm/providers.py - AST validator
sentinelsql/validator/ast_validator.py - Evaluation runner
sentinelsql/eval/runner.py
Catalog and database
- Schema catalog
sentinelsql/catalog/schema.py - Metrics catalog
sentinelsql/catalog/metrics.py - Query executor
sentinelsql/db/executor.py - Read-only engine
sentinelsql/db/engine.py
Security and operations
- Input screening
sentinelsql/screening/screener.py - Result verifier
sentinelsql/verifier/auditor.py - Result guard
sentinelsql/guard/renderer.py - Two-tier cache
sentinelsql/cache/manager.py - Cache backends
sentinelsql/cache/backends.py - Audit logger
sentinelsql/audit/logger.py - Settings
sentinelsql/config.py
Other components
- Analyst
- External LLM
- PostgreSQL
Connections 21
- Analyst → CLI: asks via
README.md - Analyst → REST gateway: asks via
README.md - CLI → Query pipeline: submits query
- CLI → REST gateway: starts server
sentinelsql/cli/app.py - REST gateway → Query pipeline: routes query
- Query pipeline → Input screening: screens input
- Query pipeline → Schema catalog: builds snapshot
- Schema catalog → Metrics catalog: includes metrics
sentinelsql/catalog/schema.py - Query pipeline → LLM provider: requests draft
- LLM provider → External LLM: generates draft
- Query pipeline → AST validator: validates draft
- Query pipeline → Query executor: executes plan
sentinelsql/orchestrator/pipeline.py - Query executor → Read-only engine: opens transaction
sentinelsql/db/executor.py - Read-only engine → PostgreSQL: queries read-only
sentinelsql/db/engine.py - Query pipeline → Result verifier: verifies results
sentinelsql/orchestrator/pipeline.py - Query pipeline → Result guard: guards output
- Query pipeline → Two-tier cache: checks caches
- Two-tier cache → Cache backends: uses backend
sentinelsql/cache/manager.py - Query pipeline → Audit logger: emits event
sentinelsql/orchestrator/pipeline.py - Schema catalog → Read-only engine: introspects schema
sentinelsql/catalog/schema.py - Evaluation runner → Query pipeline: evaluates queries