File size: 1,826 Bytes
7861bff
feb1b1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e776c3c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72


from __future__ import annotations


class DomainError(Exception):
    """Base of every domain-raised error."""


class SchemaError(DomainError):
    """Raw input violates the candidate schema mirror (type/shape only)."""


class InvalidCandidateId(SchemaError):
    """A candidate id does not match the canonical pattern."""


class FieldSchemaViolation(SchemaError):
    """A raw field has the wrong type or shape."""


class InvariantViolation(DomainError):
    """A constructed object would break a domain invariant."""


class RepresentationStageError(InvariantViolation):
    """A slice was attached out of order or accessed before population."""


class CQVInvariantError(InvariantViolation):
    """Wrong dim, NaN/inf, out-of-range cell, or schema_version mismatch."""


class ScoreInvariantError(InvariantViolation):
    """A gating or scoring-formula contradiction."""


class RankingInvariantError(InvariantViolation):
    """Count / unique-rank / monotonicity / tie-break violation."""


class ProvenanceError(DomainError):
    """An ``EvidenceRef`` path does not resolve in the ``RawCandidate``."""


class ArtifactContractError(DomainError):
    """Feature-layout / anchor-set / weights schema_version mismatch."""


class IntegrityViolation(DomainError):
    """An engine chose to fail hard on an integrity breach (rare path)."""


class IneligibleCandidate(DomainError):
    """An engine chose to fail hard on ineligibility (rare path)."""


__all__: tuple[str, ...] = (
    "ArtifactContractError",
    "CQVInvariantError",
    "DomainError",
    "FieldSchemaViolation",
    "IneligibleCandidate",
    "IntegrityViolation",
    "InvalidCandidateId",
    "InvariantViolation",
    "ProvenanceError",
    "RankingInvariantError",
    "RepresentationStageError",
    "SchemaError",
    "ScoreInvariantError",
)