Skip to content
Open
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
53 changes: 53 additions & 0 deletions docs/design/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,59 @@ Additional reasons include: different failure domains (IPC vs logging), differen
- **Declarative policies:** Debounce and aging (reset) logic ride on enums (`DebounceMode`, `ResetTrigger`) to handle typical cases. Debounce variants: `CountWithinWindow { min_count, window }`, `HoldTime { duration }`, `EdgeWithCooldown { cooldown }`, `CountThreshold { min_count }`. Reset triggers: `OperationCycles { kind, min_cycles, cycle_ref }`, `StableFor(duration)`, `ToolOnly`. `cycle_ref` links the aging policy to a concrete cycle counter identity (e.g. `"ignition.main"`, `"drive.standard"`) so the DFM can correlate counts from different domains. Clarification: Debouncing can occur in Fault Lib and/or DFM (if central aggregation needed) while aging (reset) is performed in DFM.
- **Panic on missing descriptors:** If a caller asks for a fault that isn’t in the catalog we `expect(...)` and crash. That flushes out drift early, so production flows should generate the catalog and component code together.


### Repositories structures - TBD

The fault-lib, the Diagnostic Fault Manager and sovd server will have to share common types like `FaultCatalog` , `FaultDescriptor` (including all used types), etc.
Since the Diagnostic Fault Manager will have only one instance in the HPC it would make sense to locate it in the same repository where the SOVD server is implemented (TBD) (despite if there will be IPC or direct API between them). The fault-api will be used by many applications and activities in the system and it would make sense to expose in this package only necessary types.

#### Proposal I - separated repos


![Split SOVD repositories](sovd-repos-op1.svg)


**Pros**:

- smaller leaner repos
-


**Cons**:

- api changes split over few repos, can easy lead to compatibility brake (change in the `sovd-common` and `fault-lib` done but not merged into `sovd-core`, etc )
- compatibility tracking between 3 sovd crates needed



#### Proposal II - SOVD mono repo

The sovd-core repository will host implementation of all components. Each component has his own crate.

- fault-lib
- sovd common shared types
- diagnostic fault manager
- sovd server

The application will be able to see and use any sovd artefact.

**Pros**:

- less effort to bring API / common types / change into up stream
- no compatibility issues between crates
- bazel preferred approach


**Cons**:

- possible high traffic in the repository forcing often rebasing
- size of the repository






## Open Topics

Open Topics to be addressed during development:
Expand Down
2 changes: 2 additions & 0 deletions docs/design/sovd-repos-op1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions docs/design/sovd-repos.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<mxfile host="65bd71144e">
<diagram id="SB4EzPuIkV70QSatqYcW" name="Page-1">
<mxGraphModel dx="854" dy="986" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="3" value="fault-lib" style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=center;strokeColor=none;fillColor=#00BEF2;shape=mxgraph.azure.git_repository;" vertex="1" parent="1">
<mxGeometry x="130" y="340" width="50" height="50" as="geometry"/>
</mxCell>
<mxCell id="5" value="sovd-common" style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=center;strokeColor=none;fillColor=#00BEF2;shape=mxgraph.azure.git_repository;" vertex="1" parent="1">
<mxGeometry x="260" y="120" width="50" height="50" as="geometry"/>
</mxCell>
<mxCell id="6" value="sovd-&lt;span style=&quot;color: rgb(63, 63, 63); background-color: transparent;&quot;&gt;core&lt;/span&gt;" style="verticalLabelPosition=bottom;html=1;verticalAlign=top;align=center;strokeColor=none;fillColor=#00BEF2;shape=mxgraph.azure.git_repository;" vertex="1" parent="1">
<mxGeometry x="400" y="340" width="50" height="50" as="geometry"/>
</mxCell>
<mxCell id="12" style="edgeStyle=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="155" y="145"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="13" value="use sovd-common&lt;div&gt;crate&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="12">
<mxGeometry x="-0.0533" relative="1" as="geometry">
<mxPoint y="52" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="14" style="edgeStyle=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="6" target="5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="425" y="145"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="15" value="use sovd-common&lt;div&gt;crate&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="14">
<mxGeometry x="-0.4065" y="-4" relative="1" as="geometry">
<mxPoint x="-4" y="12" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="19" value="Conatins both&amp;nbsp;&lt;div&gt;sovd server and&amp;nbsp;&lt;/div&gt;&lt;div&gt;diagnostic fault manager&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="530" y="320" width="110" height="70" as="geometry"/>
</mxCell>
<mxCell id="20" style="edgeStyle=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;" edge="1" parent="1" source="19" target="6">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>