Repository navigation
flow: multi-LoRA veto registry, BYOC HTTP server, and value-free calibration collector - #2576
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
|
… guard, fail-closed client, opt-in calibration
|
Addressed all P1 and P2 findings from Claude's adversarial review at
|
Independent adversarial review: REQUEST CHANGESFrom: Claude I read all six files at this head and the diff from 9cc95c3. My earlier review is #2576 (comment). I ran stdlib probes with Several fixes are real. Two P1s are still open. Earlier findingsP1, caller picks its own adapter: partly fixed, still open.
P1, form values in plaintext: partly fixed, still open.
P1, the remote check cannot see the screen: addressed as design. The docstring now says the backend reads both images from a customer-VPC artifact store by digest and must abstain if it cannot load or check them. That answers the question. One gap stays (P2): nothing ties the digests to this run, so a caller can name an older clean screenshot pair. Add a run or step nonce that the server checks. P2, client fail-closed: mostly fixed. Server down, timeout, HTTP errors and bad JSON now return HALT_ESCALATE, and there is a test with the server stopped. No path returns a pass on error. Gaps:
P2, adapter sha256 never checked: fixed as documentation. The docstring now says the field is not enforced and lists what a loader must do. That is enough while no loader exists. P2, other items.
TLSThe bind gate holds. New P2: the server wraps the listening socket, so the TLS handshake runs inside The veto's outputThe router returns ALLOW, VETO or HALT_ESCALATE. ABSTAIN always becomes HALT_ESCALATE, and the server enforces this again. Nothing in the repo turns ALLOW into VERIFIED. Please say in the ClaimsNo claims about unreleased models. Protected paths and CI
|
…sts, worker-thread TLS, hardened client
|
Addressed every delta finding in
Verified: |
Independent adversarial review: REQUEST CHANGESFrom: Claude This is a delta review from 0409221. My previous review is #2576 (comment). I read all six files at this head and re-ran my probes with Many fixes are real. One P1 is still open: with the default settings, the caller still picks the adapter that scores its own run. Earlier findingsP1, caller steers the veto: not fixed with the default settings.
P1, PHI on the wire: fixed in the format. One P2 remains.
P2, images not tied to the run: not fixed.
P2, client fail-closed: mostly fixed.
P2, TLS handshake on the serve thread: fixed. New P2.
WordingThe title and the module docstrings no longer say "zero-PHI" or "overnight". The PR body still says "zero-PHI" and "overnight per-app LoRA calibration". Please update it. Protected paths and CI
|
…d fail-closed client invariants on BYOC veto server
|
Addressed every remaining P1 and P2 from Claude's review at
Verified locally: |
Independent adversarial review: APPROVEFrom: Claude This is a delta review from 8a670f4. My previous review is #2576 (comment). I read the two changed modules in full and diffed the other four files against 8a670f4. The approval has two conditions:
I found no new P0 or P1. Earlier findingsP1, caller picks the adapter: fixed.
P2, HMAC not enforced: fixed for issued bindings. Open for startup bindings and the export.
P2, nonce and image replay: fixed.
P2, timeout and thread cap: thread pinning fixed. The cap can now be filled without a key.
P2, client fail-closed: fixed.
A genuine VETO still comes back as VETO. Wording: not fixedThe PR body still says "zero-PHI" and "overnight per-app LoRA calibration". Please edit the body before merge. The docstring of New findings (P2 and P3, not blocking)
Protected paths and CI
|
Independent adversarial review: APPROVEFrom: Gemini Scope InspectedFull read-only audit of all 3 production modules ( Security & Correctness Checks
Non-Blocking Follow-Up Notes (P2)
No blocking issues found at |
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 (no raw field values)CalibrationCollector&record_operator_override(...)logging SHA-256 screenshot hashes, allowlisted structural metadata (with PII pattern guards), and verdict labels into tenant-scoped JSONL queues for offline 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.