How ffroliva/sharpit works
sharpit is a developer console and test-time safety gate for Python web applications, principally FastAPI/Starlette, with Flask support for pytest gates. The main workflow installs the adapter into an app, captures runtime and application facts, exposes panels through an API and browser UI, and lets developers inspect findings. Separately, pytest can collect per-test evidence and fail gates on regressions. The README documents these capabilities; sampled sources confirm selected advisor, routing, UI, and shared-state relationships, but not every panel’s wiring.
Main entry points: install.py Framework install · scan.py Advisor scans · capture Runtime capture · pytest_plugin Pytest adapter
Components 25
App integration
- Framework install
src/sharpit/fastapi/install.py - Activation and access
src/sharpit/engine/activation.py - App introspection
src/sharpit/fastapi/introspector.py - Install context
src/sharpit/engine/context.py
Runtime evidence
- Runtime capture
src/sharpit/engine/capture - Runtime insights
src/sharpit/engine/collectors/insights/service.py - Panel collectors
src/sharpit/engine/collectors - Secret masking
src/sharpit/engine/masking.py
Advisors and findings
- Advisor scans
src/sharpit/engine/advisors/scan.py - Advisor reports
src/sharpit/engine/advisors/report.py - REST API advisor
src/sharpit/engine/collectors/restapi/service.py - Database advisor
src/sharpit/engine/collectors/database_advisor/report.py - Vulnerability scan
src/sharpit/engine/collectors/vulns/service.py
Console interfaces
- Console API routes
src/sharpit/fastapi/routes - Console UI shell
ui/src/App.svelte - UI API client
ui/src/lib/api.ts - Panel views
ui/src/views - CLI and MCP tools
src/sharpit/cli/client.py
Test gates
- Pytest adapter
src/sharpit/pytest_plugin - Gate session
src/sharpit/engine/testsession - Gate reports
src/sharpit/engine/testsession/report.py
Other components
- Developer
- Python web app
- Browser
- Pytest runner
Connections 24
- Developer → Framework install: installs
README.md - Python web app → Framework install: mounts console
README.md - Framework install → Activation and access: checks activation
- Framework install → Install context: creates context
- Framework install → App introspection: adapts app
- Python web app → Runtime capture: emits runtime evidence
README.md - Runtime capture → Runtime insights: journals evidence
src/sharpit/engine/collectors/insights/service.py - Runtime capture → Panel collectors: supplies panel data
- Secret masking → Panel collectors: masks values
src/sharpit/engine/collectors/postgresql/querytext.py - Developer → Advisor scans: requests scan
README.md - Advisor scans → Advisor reports: builds report
src/sharpit/engine/advisors/scan.py - REST API advisor → Advisor scans: runs shared scan
src/sharpit/engine/collectors/restapi/service.py - Database advisor → Advisor scans: uses findings
src/sharpit/engine/collectors/database_advisor/report.py - Developer → Vulnerability scan: requests scan
README.md - Browser → Console UI shell: opens console
README.md - Console UI shell → Panel views: renders panels
ui/src/App.svelte - Panel views → UI API client: requests data
ui/src/views/DatabaseAdvisor.svelte - UI API client → Console API routes: calls API
README.md - Console API routes → Database advisor: serves advisor
src/sharpit/fastapi/routes/database_advisor.py - Developer → CLI and MCP tools: uses tools
- Pytest runner → Pytest adapter: loads plugin
README.md - Pytest adapter → Gate session: records test evidence
src/sharpit/pytest_plugin/apps.py - Gate session → Gate reports: writes findings
- Pytest adapter → REST API advisor: runs route advisor
src/sharpit/pytest_plugin/apps.py