![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Chain summary stored in Parquet key-value metadata. More...
#include <audit_chain.hpp>
Public Member Functions | |
| std::vector< std::pair< std::string, std::string > > | to_key_values () const |
| Export as Parquet file key-value metadata pairs. | |
| std::string | serialize () const |
| Convert to a semicolon-delimited metadata string. | |
Static Public Member Functions | |
| static expected< AuditMetadata > | deserialize (const std::string &s) |
| Parse a metadata string back into AuditMetadata. | |
Public Attributes | |
| std::string | chain_id |
| Unique identifier for this chain (generated by generate_chain_id()). | |
| int64_t | start_sequence = 0 |
| Sequence number of the first entry in this file's chain segment. | |
| int64_t | end_sequence = 0 |
| Sequence number of the last entry in this file's chain segment. | |
| std::array< uint8_t, 32 > | first_prev_hash {} |
| prev_hash of the first entry in this segment (links to the prior file). | |
| std::array< uint8_t, 32 > | last_entry_hash {} |
| entry_hash of the last entry in this segment. | |
| std::string | created_by = SIGNET_CREATED_BY |
| Creator string (e.g. "SignetStack signet-forge version 0.1.0"). | |
Extended metadata fields | |
Used by decision_log / inference_log writers to embed chain information in Parquet file key-value metadata. | |
| std::string | first_hash |
| Hex string of the first entry's entry_hash in this segment. | |
| std::string | last_hash |
| Hex string of the last entry's entry_hash in this segment. | |
| std::string | prev_file_hash |
| Hex string of the first entry's prev_hash (links to the prior file). | |
| int64_t | record_count = 0 |
| Number of audit records in this segment. | |
| std::string | record_type |
| Record type: "decision", "inference", etc. | |
Chain summary stored in Parquet key-value metadata.
Each Parquet file that contains a hash chain segment stores an AuditMetadata record in its key-value metadata. This allows fast cross-file chain verification: you only need to compare the last_entry_hash of file N with the first_prev_hash of file N+1, without reading every entry.
Serialization format (semicolon-delimited key=value pairs):
Definition at line 748 of file audit_chain.hpp.
|
inlinestatic |
Parse a metadata string back into AuditMetadata.
Expects the format produced by serialize(). Returns an error if required fields are missing or malformed.
| s | The semicolon-delimited metadata string. |
Definition at line 840 of file audit_chain.hpp.
|
inline |
Convert to a semicolon-delimited metadata string.
Format:
All values are plain ASCII. Hash values are lowercase hex.
Definition at line 822 of file audit_chain.hpp.
|
inline |
Export as Parquet file key-value metadata pairs.
Definition at line 796 of file audit_chain.hpp.
| std::string signet::forge::AuditMetadata::chain_id |
Unique identifier for this chain (generated by generate_chain_id()).
All files in the same logical audit trail share the same chain_id.
Definition at line 751 of file audit_chain.hpp.
| std::string signet::forge::AuditMetadata::created_by = SIGNET_CREATED_BY |
Creator string (e.g. "SignetStack signet-forge version 0.1.0").
Definition at line 768 of file audit_chain.hpp.
| int64_t signet::forge::AuditMetadata::end_sequence = 0 |
Sequence number of the last entry in this file's chain segment.
Definition at line 757 of file audit_chain.hpp.
| std::string signet::forge::AuditMetadata::first_hash |
Hex string of the first entry's entry_hash in this segment.
Definition at line 776 of file audit_chain.hpp.
| std::array<uint8_t, 32> signet::forge::AuditMetadata::first_prev_hash {} |
prev_hash of the first entry in this segment (links to the prior file).
All zeros if this is the first file in the chain.
Definition at line 761 of file audit_chain.hpp.
| std::array<uint8_t, 32> signet::forge::AuditMetadata::last_entry_hash {} |
entry_hash of the last entry in this segment.
The next file's first entry must have this as its prev_hash.
Definition at line 765 of file audit_chain.hpp.
| std::string signet::forge::AuditMetadata::last_hash |
Hex string of the last entry's entry_hash in this segment.
Definition at line 779 of file audit_chain.hpp.
| std::string signet::forge::AuditMetadata::prev_file_hash |
Hex string of the first entry's prev_hash (links to the prior file).
Definition at line 782 of file audit_chain.hpp.
| int64_t signet::forge::AuditMetadata::record_count = 0 |
Number of audit records in this segment.
Definition at line 785 of file audit_chain.hpp.
| std::string signet::forge::AuditMetadata::record_type |
Record type: "decision", "inference", etc.
Definition at line 788 of file audit_chain.hpp.
| int64_t signet::forge::AuditMetadata::start_sequence = 0 |
Sequence number of the first entry in this file's chain segment.
Definition at line 754 of file audit_chain.hpp.