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

doc__persistency_arc_inspection

ASIL_B

YES

draft

Persistency DFA

doc__persistency_dfa

ASIL_B

NO

valid

Persistency FMEA

doc__persistency_fmea

ASIL_B

NO

valid

Persistency KVS Feature Architecture

doc__persistency_kvs_architecture

ASIL_B

NO

valid

Persistency KVS Security WPs

doc__persistency_security_wp

ASIL_B

YES

valid

Persistency Safety WPs

doc__persistency_safety_wp

ASIL_B

NO

valid

STRIDE

doc__persistency_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

doc__persistency_codeowners

ASIL_B

YES

valid

Persistency Module Verification Report

doc__persistency_verification_report

ASIL_B

NO

valid

Persistency Release Note

doc__persistency_release_note

ASIL_B

NO

valid

Persistency Safety Analysis Checklist

doc__persistency_safety_analysis_fdr

ASIL_B

YES

valid

Persistency Safety Analysis Checklist

doc__module_safety_analysis_fdr

ASIL_B

YES

valid

Persistency Safety Manual

doc__persistency_safety_manual

ASIL_B

NO

valid

Persistency Safety Package Formal Review

doc__persistency_safety_package_fdr

ASIL_B

NO

valid

Persistency Safety Plan

doc__persistency_safety_plan

ASIL_B

NO

valid

Persistency Safety Plan Formal Review

doc__persistency_safety_plan_fdr

ASIL_B

NO

valid

Persistency Security Manual

doc__persistency_security_manual

ASIL_B

YES

draft

Persistency Security Package Formal Review

doc__persistency_sec_pkg_fdr

ASIL_B

YES

valid

Persistency Security Plan

doc__persistency_security_plan

ASIL_B

YES

valid

Persistency Security Plan Formal Review

doc__persistency_security_plan_fdr

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

doc__kvs

ASIL_B

NO

valid

KVS Architecture Inspection Checklist

doc__kvs_arc_inspection

ASIL_B

YES

draft

KVS Component Architecture

doc__kvs_component_architecture

ASIL_B

YES

valid

KVS Detailed Design

doc__kvs_detailed_design

ASIL_B

NO

draft

KVS DFA

doc__kvs_dfa

ASIL_B

NO

valid

KVS FMEA

doc__kvs_fmea

ASIL_B

NO

valid

KVS Implementation Inspection Checklist

doc__kvs_impl_inspection

ASIL_B

YES

draft

KVS Module Architecture

doc__kvs_architecture

ASIL_B

NO

valid

KVS Requirements

doc__kvs_requirements

ASIL_B

NO

valid

KVS Requirements Inspection Checklist

doc__kvs_req_inspection

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 with KvsBuilder and basic key-value operations

  • defaults.rs: usage of default values

  • snapshots.rs: snapshot count and snapshot restore

  • custom_types.rs: serialization and deserialization of custom types

  • migration.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-tidy are used; for Rust code, clippy is used

  • Safety level: The ASIL level affects safety-related build settings and validation

  • Source code languages: The build system optimizes for the configured languages