feat: Sentinel Phases 1-4 — classifier service, optimizer pipeline, local infra, and observability#3
Conversation
…nfrastructure monitoring components
…ontainerize classifier service with updated test fixtures
…ntroduce local terraform infrastructure configuration
…ostgreSQL support
…ifact persistence and local dev tooling.
…ked model lifecycle management
…ackages and dev dependencies
|
Warning Review limit reached
More reviews will be available in 55 minutes and 38 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds local infrastructure for the classifier stack, a FastAPI classifier with model loading, batching, persistence, and metrics, an optimizer pipeline that uploads and registers artifacts, plus developer workflow scripts and documentation for running the stack locally. ChangesSentinel local stack and model lifecycle
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…imizer Fixes CI "Lint & format" failure (ruff I001 + format). Reorders imports in main.py to satisfy isort rules and reformats batcher.py, model.py, pipeline.py, and test_classifier_api.py to match ruff style. Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Completes Phases 1–4 of the Sentinel content safety platform, establishing the full local development stack from model optimization through live inference and observability.
model_registry+classifications), MongoDB (flagged_content), MinIO (models/+datasets/buckets);dev-start.shscript to spin everything up in one commandhost.k3d.internal:8000) and Grafana (auto-provisioned datasource) deployed into the clusterKey design decisions captured
sync defroute for/classify— ONNX Runtimesession.run()is a blocking C call;async defwould stall the event loop/reloadendpoint — model upgrades go throughkubectl rollout restart; in-process reload with multiple replicas causes a silent version splitmodel_registryPostgreSQL table as the source of truth — classifier queries it on startup, downloads the active model from MinIO, caches at/tmp/sentinel-model-cache/<run-id>/int8/ON CONFLICT DO NOTHINGon all DB writes — idempotent inserts survive Kafka reprocessing and pod restartsmodel_registry.model_path;download.pyhandles both formats transparently--address=0.0.0.0on allkubectl port-forwardcommands — required for WSL2 so the Windows browser can reach services via localhostWhat's in each file
services/classifier/—main.py,model.py,db.py,download.py,batcher.py,metrics.py,schemas.py,Dockerfilepipelines/optimizer/—pipeline.py,export.py,optimize.py,quantize.py,upload.py,registry.pyinfra/terraform/local/— PostgreSQL, MongoDB, MinIO, Prometheus, Grafanainfra/prometheus/,infra/grafana/scripts/dev-start.sh,docs/local-dev.mdtests/test_classifier_api.py,tests/conftest.pyTest plan
./scripts/dev-start.sh— all 5 port-forward checks printready, classifier starts, banner shows correct URLscurl http://localhost:8000/health→{"status":"ok","model":"..."}curl -X POST http://localhost:8000/classify -d '{"text":"test"}'→ label + score + latencyhttp://localhost:9001— MinIO console showsmodels/anddatasets/bucketshttp://localhost:9090/targets— Prometheusclassifierjob showsState: UPhttp://localhost:3000— Grafana loads with Prometheus datasource connectedpsql ... -c "SELECT * FROM model_registry;"— row present after optimizer runuv run pytest --tb=short -q— all tests pass without torch installed🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests