Repository navigation
feat(vlm): label confirmation backend, VLM scope policy, detector class, audit and promote gate (#119) - #167
Merged
Merged
Conversation
GET/PUT /vlm/policy limit which crops the continuous worker and the auto_label VLM stage label (all, uncertain, representatives, off), with a per-day attempt budget and a stable sample fraction. Both selectors take their scope clauses from one function. Explicit cluster requests are never limited. The policy is cloned with the project. Refs #119
Ingest records detector_class_name (registry-name form), detector_confidence and, when the label is a registry class, detector_class_id, whatever the class_resolution. No VLM, classifier or human write touches them, so a detector-vs-VLM comparison stays queryable. Mapped on new and existing indexes and served on the item wire. Refs #119
Lists unvalidated items whose VLM class differs from the class the detector gave them, sorted by vlm_confidence and then detector confidence. Served by GET /review/tabs; the query fake gains match_none and registered script twins for its tests. Refs #119
POST /audit/start draws a deterministic stratified sample (per detector class, under a total budget) of machine-labelled crops, GET /audit/queue lists the ones still waiting for a human, and every human class write on a drawn crop stamps whether the detector, the VLM, both or neither was right. GET /audit/report gives per-class precision with Wilson 95% intervals, the confusion matrix and insufficient_sample flags. Refs #119
POST /clusters/auto_promote and the auto_label promote stage promote a class only when the audit holds enough human-labelled crops of it and the detector's audited precision clears promote_min_precision (default 0.95); otherwise 409 audit_required or audit_precision_low names the classes and nothing is written. force=true bypasses the gate and is logged distinctly; a dry run is never gated. Refs #119
…M selection The worker and the auto_label sweep now share the cluster-scope exclusions, so no scope selects a test_holdout or class_excluded item. Refs #119
The id carried only the UTC second, so two starts in one second shared it. It now has microseconds and a random suffix and still sorts by time. Also documents that sample_frac hashes the crop id. Refs #119
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend half of #119, from docs/design/label_confirmation_plan.md section 6, as five stacked changes plus a refactor commit that keeps the new mappings out of the grandfathered curation_opensearch.py.
All contract changes are additive. Deviations from the plan are recorded in the commit messages and issues: #165 (disagreements sort order), #166 (audit fields on the item wire). The uncertain scope uses only the confidence clause because the plan's wording would select every crop on a default project.
Verified offline: full suite 7134 passed, 14 skipped on the merged result; pre-commit all hooks; frontend contract tests (882) still pass; no existing test dropped.
NOT yet verified: the two Painless scripts (sample_frac hash filter, disagreement comparison) and the representatives msearch against a real OpenSearch, and live steps V1 to V5 of the plan (VLM throughput, scope off writes nothing, representatives call count, human label lock and holdout, audit report vs manual count). The Cropwright frontend half is a separate change.