Skip to content

Evidence types

doublegate_sdk.checks

Transport-independent deterministic inspection results; no authority handles.

Finding dataclass

One finding container; callers must sanitize fields before construction.

This dataclass does not mask or validate supplied strings. The bundled evaluator uses fixed diagnostics and empty excerpts, never input content.

Source code in src/doublegate_sdk/checks.py
@dataclass(frozen=True, slots=True)
class Finding:
    """One finding container; callers must sanitize fields before construction.

    This dataclass does not mask or validate supplied strings. The bundled
    evaluator uses fixed diagnostics and empty excerpts, never input content.
    """

    kind: str
    severity: str
    detail: str
    start: int = 0
    end: int = 0
    excerpt: str = ""

    def to_dict(self) -> dict[str, Any]:
        return {"kind": self.kind, "severity": self.severity, "detail": self.detail,
                "start": self.start, "end": self.end, "excerpt": self.excerpt}

kind instance-attribute

kind: str

severity instance-attribute

severity: str

detail instance-attribute

detail: str

start class-attribute instance-attribute

start: int = 0

end class-attribute instance-attribute

end: int = 0

excerpt class-attribute instance-attribute

excerpt: str = ''

to_dict

to_dict() -> dict[str, Any]
Source code in src/doublegate_sdk/checks.py
def to_dict(self) -> dict[str, Any]:
    return {"kind": self.kind, "severity": self.severity, "detail": self.detail,
            "start": self.start, "end": self.end, "excerpt": self.excerpt}

ScanResult dataclass

Source code in src/doublegate_sdk/checks.py
@dataclass(frozen=True, slots=True)
class ScanResult:
    outcome: str                                    # "clean" | "flagged"
    findings: tuple[Finding, ...] = ()
    masked: str = ""                                # the body a gate prompt may see

    @property
    def flagged(self) -> bool:
        return self.outcome == "flagged"

    def to_payload(self) -> dict[str, Any]:
        return {"outcome": self.outcome, "findings": [f.to_dict() for f in self.findings]}

outcome instance-attribute

outcome: str

findings class-attribute instance-attribute

findings: tuple[Finding, ...] = ()

masked class-attribute instance-attribute

masked: str = ''

flagged property

flagged: bool

to_payload

to_payload() -> dict[str, Any]
Source code in src/doublegate_sdk/checks.py
def to_payload(self) -> dict[str, Any]:
    return {"outcome": self.outcome, "findings": [f.to_dict() for f in self.findings]}