Interface AnnotationSetTriageService
- All Known Implementing Classes:
AnnotationSetTriageServiceImpl
public interface AnnotationSetTriageService
Triage rulings on
AnnotationSets: how much a set matters, one
standing judgement per judge.
🛑 judgedBy is the curator, not the caller. Curation writes
reach Gemma through the curation agent rather than from the curator's browser,
so the authenticated principal on these calls is normally the agent acting on
someone's behalf. Every identity here is therefore passed in explicitly and
never read from the security context — resolving it from the principal would
stamp every human ruling with the agent's name, make
TriageJudgeKind.CURATOR unreachable, and collapse two curators'
distinct judgements onto one row through the
UNIQUE(annotationSet, judgedBy) key.
The REST layer decides who may claim to be whom; see the delegation gate on the triage endpoint.
-
Method Summary
Modifier and TypeMethodDescriptionCorpus-wide tally by verdict.effectiveFor(AnnotationSet annotationSet) The ruling that counts — the most recent — or empty when nobody has ruled.effectiveForIds(Collection<Long> annotationSetIds) BatchedeffectiveFor(AnnotationSet).effectiveForInvestigationIds(Collection<Long> investigationIds) The effective ruling for each of several datasets, keyed by dataset id — newest ruling across every annotation set the dataset owns.findByInvestigation(Investigation investigation) Every ruling on any set of one investigation, most recent first.findBySet(AnnotationSet annotationSet) Every ruling on one set, most recent first.judge(AnnotationSet annotationSet, TriageVerdict verdict, String judgedBy, TriageJudgeKind judgeKind, String note) Record or replacejudgedBy's ruling onannotationSet.booleanreviewedByHuman(AnnotationSet annotationSet) Whether a person — not only a machine — has ruled on this set.booleanwithdraw(AnnotationSet annotationSet, String judgedBy) WithdrawjudgedBy's ruling, returning the set to un-triaged if it was the only one.
-
Method Details
-
judge
AnnotationSetTriage judge(AnnotationSet annotationSet, TriageVerdict verdict, String judgedBy, TriageJudgeKind judgeKind, @Nullable String note) Record or replacejudgedBy's ruling onannotationSet. Idempotent per judge: a second call from the same judge updates the standing row rather than adding one.- Parameters:
judgedBy- the ruling identity — a username for a person, a run id for an agent. Never the transport's principal.judgeKind- stored rather than inferred fromjudgedBy, so "has a person ruled on this" does not depend on knowing every agent run id.note- why; the only place aTriageVerdict.WontFixsays what it is declining to fix. Optional.
-
withdraw
WithdrawjudgedBy's ruling, returning the set to un-triaged if it was the only one.- Returns:
- whether a row was removed
-
findBySet
Every ruling on one set, most recent first. -
effectiveFor
The ruling that counts — the most recent — or empty when nobody has ruled. -
effectiveForIds
BatchedeffectiveFor(AnnotationSet). Sets with no ruling are absent from the map rather than mapped to null. -
effectiveForInvestigationIds
The effective ruling for each of several datasets, keyed by dataset id — newest ruling across every annotation set the dataset owns. One round-trip for a whole page. -
findByInvestigation
Every ruling on any set of one investigation, most recent first. -
reviewedByHuman
Whether a person — not only a machine — has ruled on this set. -
countByVerdict
Map<TriageVerdict, Long> countByVerdict()Corpus-wide tally by verdict.
-