Persistency Documentation#
This documentation describes the Persistency module of S-CORE. The module implements the Persistency feature with the Key-Value-Storage (KVS), which stores, retrieves and manages key-value pairs persistently in JSON format on the file system. It provides a Rust and a C++ implementation.
The documentation follows the SCORE module folder structure and the SCORE building blocks concept. The feature requirements are maintained in the SCORE platform repository.
Overview#
This repository provides a standardized setup for projects using C++ or Rust and Bazel as a build system. It integrates best practices for build, test, CI/CD and documentation.
Feature Documentation#
The Feature documentation covers the feature-level definition of the Persistency module, including architecture and safety planning artifacts.
Title |
ID |
Safety |
Security |
Status |
|---|---|---|---|---|
Persistency Architecture Inspection Checklist |
ASIL_B |
YES |
draft |
|
Persistency DFA |
ASIL_B |
NO |
valid |
|
Persistency FMEA |
ASIL_B |
NO |
valid |
|
Persistency KVS Feature Architecture |
ASIL_B |
NO |
valid |
|
Persistency KVS Security WPs |
ASIL_B |
YES |
valid |
|
Persistency Safety WPs |
ASIL_B |
NO |
valid |
|
STRIDE |
ASIL_B |
YES |
valid |
Module Documentation#
The Module documentation covers the module-level view (Persistency Module), including architecture, safety management documents, and the user manual.
Title |
ID |
Safety |
Security |
Status |
|---|---|---|---|---|
Persistency Codeowners |
ASIL_B |
YES |
valid |
|
Persistency Module Verification Report |
ASIL_B |
NO |
valid |
|
Persistency Release Note |
ASIL_B |
NO |
valid |
|
Persistency Safety Analysis Checklist |
ASIL_B |
YES |
valid |
|
Persistency Safety Analysis Checklist |
ASIL_B |
YES |
valid |
|
Persistency Safety Manual |
ASIL_B |
NO |
valid |
|
Persistency Safety Package Formal Review |
ASIL_B |
NO |
valid |
|
Persistency Safety Plan |
ASIL_B |
NO |
valid |
|
Persistency Safety Plan Formal Review |
ASIL_B |
NO |
valid |
|
Persistency Security Manual |
ASIL_B |
YES |
draft |
|
Persistency Security Package Formal Review |
ASIL_B |
YES |
valid |
|
Persistency Security Plan |
ASIL_B |
YES |
valid |
|
Persistency Security Plan Formal Review |
ASIL_B |
YES |
valid |
Component Documentation#
The Components documentation provides detailed documentation for each individual library component, including requirements, architecture, and design decisions:
Title |
ID |
Safety |
Security |
Status |
|---|---|---|---|---|
KVS |
ASIL_B |
NO |
valid |
|
KVS Architecture Inspection Checklist |
ASIL_B |
YES |
draft |
|
KVS Component Architecture |
ASIL_B |
YES |
valid |
|
KVS Detailed Design |
ASIL_B |
NO |
draft |
|
KVS DFA |
ASIL_B |
NO |
valid |
|
KVS FMEA |
ASIL_B |
NO |
valid |
|
KVS Implementation Inspection Checklist |
ASIL_B |
YES |
draft |
|
KVS Module Architecture |
ASIL_B |
NO |
valid |
|
KVS Requirements |
ASIL_B |
NO |
valid |
|
KVS Requirements Inspection Checklist |
ASIL_B |
YES |
valid |
Examples#
Usage examples of the Rust implementation are located in score/kvs/rust_kvs/examples:
basic.rs: creating a KVS instance withKvsBuilderand basic key-value operationsdefaults.rs: usage of default valuessnapshots.rs: snapshot count and snapshot restorecustom_types.rs: serialization and deserialization of custom typesmigration.rs: migration between storage backends
The example basic.rs is executed with cargo run -p rust_kvs --example basic, the other examples accordingly with their file name.
The integration of the module into a Bazel project is described in examples/README.md.
Quick Start - Building and Testing#
To build the module:
bazel build --config=per-x86_64-linux -- //score/...
Building without an explicit --config (e.g. per-x86_64-linux, per-x86_64-qnx, per-arm64-qnx) is not supported.
To run all tests:
bazel test //...
To run Unit Tests:
bazel test //:unit_tests
To run Component / Feature Integration Tests:
bazel test //:cit_tests
Module Build Configuration#
The project_config.bzl file at the root of the module defines metadata used by Bazel macros.
This file controls build behavior and project-specific settings. It should follow the S-CORE definition.
See S-CORE user guide for project_config.bzl for details.
Example:
PROJECT_CONFIG = {
"asil_level": "ASIL_B",
"source_code": ["cpp", "rust"],
}
The configuration enables conditional build behavior:
Language-specific tools: For C++ code, tools like
clang-tidyare used; for Rust code,clippyis usedSafety level: The ASIL level affects safety-related build settings and validation
Source code languages: The build system optimizes for the configured languages