-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathforscan_models.py
More file actions
85 lines (66 loc) · 1.63 KB
/
forscan_models.py
File metadata and controls
85 lines (66 loc) · 1.63 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime
from enum import StrEnum
@dataclass(frozen=True)
class AbtFileMeta:
file_name: str
vin: str
system: str
captured_at: datetime
@dataclass(frozen=True)
class ParsedRecord:
offset: int
name: str
value: int
interpretation: str
class SafetyLevel(StrEnum):
LOW = "low"
MEDIUM = "medium"
HIGH = "high"
@dataclass(frozen=True)
class DtcInfo:
code: str
title: str
system: str
severity: SafetyLevel
likely_causes: tuple[str, ...]
recommended_steps: tuple[str, ...]
@dataclass(frozen=True)
class ChangePlan:
module: str
parameter: str
current_value: str
target_value: str
safety_level: SafetyLevel
pre_checks: tuple[str, ...]
execution_steps: tuple[str, ...]
rollback_steps: tuple[str, ...]
warnings: tuple[str, ...]
@dataclass(frozen=True)
class SourceEvidence:
title: str
url: str
category: str
last_checked: str
notes: str
@dataclass(frozen=True)
class TrustReport:
legitimacy_score: int
verdict: str
strengths: tuple[str, ...]
caveats: tuple[str, ...]
sources: tuple[SourceEvidence, ...]
@dataclass(frozen=True)
class TopicExplanation:
topic: str
summary: str
why_it_matters: tuple[str, ...]
common_mistakes: tuple[str, ...]
best_practices: tuple[str, ...]
ABT_CAPTURED_AT_FORMAT = "%Y%m%d%H%M%S"
ABT_FIELDS: tuple[tuple[int, str, str], ...] = (
(0, "first_uint32", "Primary sample value"),
(4, "second_uint32", "Secondary sample value"),
)
EXPLANATION_SEPARATOR = "\n" + "=" * 72 + "\n"