Repository navigation
feat(flow): Multi-LoRA veto registry, zero-PHI calibration collector, and shared BYOC HTTP server - #2576
feat(flow): Multi-LoRA veto registry, zero-PHI calibration collector, and shared BYOC HTTP server#2576abrichr wants to merge 3 commits into
Conversation
…, and JSONL exporter
…LoRA veto HTTP server
Independent adversarial review: REQUEST CHANGESFrom: Claude I read all six files at this head, and Gemini's note on openadapt-internal #211 (comment 7092819494). None of these files is imported anywhere else in the repo, so nothing runs today. The findings below are about what the modules will do once someone wires them in. P1: the agent can pick its own lenient adapter and get ALLOW
Scenario: the registry holds public adapter P1: form values leave the machine in plaintext, and "zero-PHI" is not true for this PR as a whole
The PR title and the collector docstring say "zero-PHI", but only P1: the remote check cannot see the screenThe server receives only P2: fail-closed on the client side depends on a caller that doesn't existThe server side is fail-closed: auth, size, JSON, schema and backend errors all return P2: registry integrity hash is never checked
P2: other items
|
Summary
Implements the Multi-LoRA visual veto registry + Mitigation #1 (Online False-Pause Calibration Flywheel) + Mitigation #4 (Shared BYOC Multi-LoRA Veto HTTP Server for zero-GPU VA/clinic laptops) in
packages/flow/openadapt_flow/:multi_lora_veto.py: DeclarativeAppAdapterRegistry+MultiLoraVetoRouterhot-swapping compact per-app LoRA adapters by(tenant_id, app_id, workflow_id, domain)with strict BYOC tenant isolation, per-adapter temperature calibration, fail-closedABSTAIN -> HALT_ESCALATE, and deduplicated Exception Inbox QLoRA JSONL export.calibration_collector.py(Mitigation pip install -r requirements (There is no requirements file in the repo) #1): Value-free / zero-PHICalibrationCollector&record_operator_override(...)logging SHA-256 screenshot hashes, allowlisted structural metadata (with PII pattern guards), and verdict labels into tenant-scoped JSONL queues for overnight per-app LoRA calibration. Enforces fail-closed tenant isolation on writes and reads.byoc_veto_server.py(Mitigation Modify record.py to accept a command line description of the task that is being performed #4): Lightweight stdlibThreadingHTTPServer(POST /v1/verify,GET /healthz) +post_verify_request(...)client routing zero-GPU laptop checks to a single customer-VPC GPU runningMultiLoraVetoRouter. Enforces constant-time tenant-key auth (401/403), serialized GPU hot-swap lock, strictABSTAIN -> HALT_ESCALATE, and fail-closed503on backend errors.Verification
pytest tests/test_multi_lora_veto.py tests/test_calibration_collector.py tests/test_byoc_veto_server.py -q: 13 passedruff check&ruff format --check: cleanmypyon all 3 source modules: Success: no issues foundpython3 scripts/check_source_boundary.py: OK: no boundary violationsgitleaks protect --staged --redact: no leaks foundpackages/types/untouched.