forked from longtao.wu/droboticflow
27 lines
1.3 KiB
Go
27 lines
1.3 KiB
Go
package store
|
|
|
|
import (
|
|
"droboticflow/internal/domain"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// Advisory mode separates the optional full media audit from normal work.
|
|
// Unknown configuration retains strict admission. Permissions, ownership and
|
|
// optimistic versions are enforced by the existing claim/save/review paths.
|
|
func AnnotationSourceAuditAdvisory() bool {
|
|
return os.Getenv("ANNOTATION_SOURCE_VALIDATION_MODE") == "advisory"
|
|
}
|
|
|
|
const AnnotationSourceUnavailablePrefix = "基础帧映射不可用:"
|
|
|
|
func AnnotationSourceTaskMatches(task domain.AnnotationTaskRecord, item domain.HumanItemRecord) bool {
|
|
return task.ID != "" && task.ID == item.LegacyTaskID && task.OrganizationID == item.OrganizationID && task.ProjectID == item.ProjectID && task.RunID == item.RunID
|
|
}
|
|
|
|
// Only a real processing failure can isolate a task in advisory mode. An old
|
|
// full-audit failure, or missing proof metadata, is not such evidence.
|
|
func AnnotationSourceUnavailable(item domain.HumanItemRecord) bool {
|
|
return (item.CurrentStageID == "annotation_combined" || item.CurrentStageID == "semantic_annotation" || item.CurrentStageID == "split_annotation") && item.ProcessingJob != nil && item.ProcessingJob.Status == "failed" && strings.HasPrefix(item.ProcessingJob.Error, AnnotationSourceUnavailablePrefix)
|
|
}
|