Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/ofw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
Severity,
TraceDiagnosis,
)
from ofw.exports import (
ClusterFamilyId,
ClusterPartitionRule,
ConsentStatus,
DataLicense,
ExportBundle,
ExportPartition,
ExportPolicy,
LeakageError,
LeakageErrorCode,
MineExports,
PrivacyTransform,
)
from ofw.harness import EditableFile, Harness, Subagent, Tool, editable
from ofw.mine import (
Mine,
Expand Down Expand Up @@ -125,6 +138,7 @@ class _OfwNamespace:
MiningPolicy = MiningPolicy
ScoreName = ScoreName
PythonDiagnoser = PythonDiagnoser
ExportPolicy = ExportPolicy

def editable(self, path: Path) -> EditableFile:
return editable(path)
Expand Down Expand Up @@ -174,7 +188,10 @@ def read_snapshot_content(
"AssetAccess",
"CanaryCase",
"CaseId",
"ClusterPartitionRule",
"ClusterFamilyId",
"ClusterState",
"ConsentStatus",
"ClusterRevisionRef",
"ComponentKind",
"CollectionError",
Expand All @@ -186,11 +203,15 @@ def read_snapshot_content(
"DockerCompose",
"DiagnosisResult",
"DiagnosisRun",
"DataLicense",
"DiagnosisError",
"DiagnosisErrorCode",
"EditableFile",
"EvidenceAnchor",
"EvidenceAnchorKind",
"ExportBundle",
"ExportPartition",
"ExportPolicy",
"FailureCluster",
"GitCommit",
"Harness",
Expand All @@ -205,12 +226,15 @@ def read_snapshot_content(
"LangfuseOtelSpanAttributes",
"LangfuseProject",
"LangfuseSpan",
"LeakageError",
"LeakageErrorCode",
"LocalProcess",
"ModelFingerprint",
"ModuleName",
"Mine",
"MineError",
"MineErrorCode",
"MineExports",
"MiningPolicy",
"MechanismKey",
"ObservationContent",
Expand All @@ -223,6 +247,7 @@ def read_snapshot_content(
"RepositorySnapshot",
"ProcessCommand",
"ProcessLimits",
"PrivacyTransform",
"PythonEntrypoint",
"PythonLoop",
"PythonDiagnoser",
Expand Down
4 changes: 2 additions & 2 deletions src/ofw/diagnosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def run(self) -> DiagnosisResult:
prepared = environment.prepare(revision, CanaryCase(CaseId("diagnosis"), ""))
try:
diagnoses = tuple(
self._diagnose(_read_snapshot(admission, self.mine), prepared)
self._diagnose(read_snapshot(admission, self.mine), prepared)
for admission in failures
if admission.snapshot_path is not None
)
Expand Down Expand Up @@ -490,7 +490,7 @@ def _anchor_exists(anchor: EvidenceAnchor, snapshot: TraceSnapshot) -> bool:
return any(score.id.value == anchor.id for score in snapshot.scores)


def _read_snapshot(admission: TraceAdmission, mine: MineResult) -> TraceSnapshot:
def read_snapshot(admission: TraceAdmission, mine: MineResult) -> TraceSnapshot:
path = admission.snapshot_path
digest = admission.snapshot_digest
if path is None or digest is None:
Expand Down
Loading