generated from coulomb/repo-seed
193 lines
3.5 KiB
Python
193 lines
3.5 KiB
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Any
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Repository:
|
|
id: int
|
|
name: str
|
|
url: str
|
|
description: str | None
|
|
branch: str
|
|
status: str
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class RepositorySnapshot:
|
|
id: int
|
|
repository_id: int
|
|
commit_hash: str
|
|
branch: str
|
|
source_path: str
|
|
file_count: int
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class AnalysisRun:
|
|
id: int
|
|
repository_id: int
|
|
snapshot_id: int | None
|
|
status: str
|
|
started_at: str
|
|
completed_at: str | None
|
|
error_message: str | None
|
|
scanner_version: str
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ObservedFact:
|
|
id: int
|
|
repository_id: int
|
|
analysis_run_id: int
|
|
snapshot_id: int | None
|
|
kind: str
|
|
path: str
|
|
name: str
|
|
value: str
|
|
metadata: dict[str, Any]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ScanSummary:
|
|
analysis_run: AnalysisRun
|
|
snapshot: RepositorySnapshot | None
|
|
facts: list[ObservedFact]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class SourceReference:
|
|
fact_id: int | None
|
|
path: str
|
|
kind: str
|
|
name: str
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CandidateEvidence:
|
|
id: int
|
|
type: str
|
|
reference: str
|
|
strength: str
|
|
status: str
|
|
source_refs: list[SourceReference]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CandidateFeature:
|
|
id: int
|
|
name: str
|
|
type: str
|
|
location: str
|
|
confidence: float
|
|
status: str
|
|
source_refs: list[SourceReference]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CandidateCapability:
|
|
id: int
|
|
name: str
|
|
description: str
|
|
inputs: list[str]
|
|
outputs: list[str]
|
|
confidence: float
|
|
status: str
|
|
source_refs: list[SourceReference]
|
|
features: list[CandidateFeature] = field(default_factory=list)
|
|
evidence: list[CandidateEvidence] = field(default_factory=list)
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CandidateAbility:
|
|
id: int
|
|
name: str
|
|
description: str
|
|
confidence: float
|
|
status: str
|
|
source_refs: list[SourceReference]
|
|
capabilities: list[CandidateCapability] = field(default_factory=list)
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CandidateGraph:
|
|
repository: Repository
|
|
analysis_run: AnalysisRun
|
|
abilities: list[CandidateAbility]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Evidence:
|
|
id: int
|
|
type: str
|
|
reference: str
|
|
strength: str
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Feature:
|
|
id: int
|
|
name: str
|
|
type: str
|
|
location: str
|
|
confidence: float
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Capability:
|
|
id: int
|
|
name: str
|
|
description: str
|
|
inputs: list[str]
|
|
outputs: list[str]
|
|
confidence: float
|
|
features: list[Feature] = field(default_factory=list)
|
|
evidence: list[Evidence] = field(default_factory=list)
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Ability:
|
|
id: int
|
|
name: str
|
|
description: str
|
|
confidence: float
|
|
capabilities: list[Capability] = field(default_factory=list)
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class RepositoryAbilityMap:
|
|
repository: Repository
|
|
abilities: list[Ability]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class SearchResult:
|
|
repository_id: int
|
|
repository_name: str
|
|
match_type: str
|
|
match_name: str
|
|
confidence: float
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class AbilitySummary:
|
|
id: int
|
|
repository_id: int
|
|
repository_name: str
|
|
name: str
|
|
description: str
|
|
confidence: float
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CapabilitySummary:
|
|
id: int
|
|
repository_id: int
|
|
repository_name: str
|
|
ability_id: int
|
|
ability_name: str
|
|
name: str
|
|
description: str
|
|
confidence: float
|