v2.0.0
Loading...
Searching...
No Matches
mna_verification.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef MNA_VERIFICATION_H
36#define MNA_VERIFICATION_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "mna_global.h"
43#include "mna_script.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QString>
50#include <QStringList>
51#include <QVariant>
52#include <QVariantMap>
53#include <QMap>
54#include <QList>
55#include <QDateTime>
56#include <QJsonObject>
57#include <QCborMap>
58
59//=============================================================================================================
60// DEFINE NAMESPACE MNALIB
61//=============================================================================================================
62
63namespace MNALIB
64{
65
66//=============================================================================================================
74{
75 QString id;
76 QString description;
77 QString phase;
78 QString expression;
83 QString severity;
84 QString onFail;
85
86 QJsonObject toJson() const;
87 static MnaVerificationCheck fromJson(const QJsonObject& json);
88 QCborMap toCbor() const;
89 static MnaVerificationCheck fromCbor(const QCborMap& cbor);
90};
91
92//=============================================================================================================
99{
100 QString checkId;
101 bool passed = false;
102 QString severity;
103 QString message;
104 QVariant actualValue;
105 QDateTime evaluatedAt;
106
107 QJsonObject toJson() const;
108 static MnaVerificationResult fromJson(const QJsonObject& json);
109 QCborMap toCbor() const;
110 static MnaVerificationResult fromCbor(const QCborMap& cbor);
111};
112
113//=============================================================================================================
121{
122 // Input snapshot
123 QMap<QString, QString> inputHashes;
124
125 // Resolved attributes at execution time (after param-tree evaluation)
127
128 // Software environment
130 QString qtVersion;
131 QString compilerInfo;
132 QString osInfo;
133 QString hostName;
134
135 // For IPC/Script nodes
137
138 // Timing
139 QDateTime startedAt;
140 QDateTime finishedAt;
141 qint64 wallTimeMs = 0;
142 qint64 peakMemoryBytes = 0;
143
144 // Random seed (if stochastic operations were used)
145 qint64 randomSeed = -1;
146
147 QJsonObject toJson() const;
148 static MnaProvenance fromJson(const QJsonObject& json);
149 QCborMap toCbor() const;
150 static MnaProvenance fromCbor(const QCborMap& cbor);
151};
152
153//=============================================================================================================
162{
164 QString explanation;
165
167 QList<MnaVerificationCheck> checks;
168
170 QList<MnaVerificationResult> preResults;
171
173 QList<MnaVerificationResult> postResults;
174
177
178 QJsonObject toJson() const;
179 static MnaVerification fromJson(const QJsonObject& json);
180 QCborMap toCbor() const;
181 static MnaVerification fromCbor(const QCborMap& cbor);
182};
183
184} // namespace MNALIB
185
186#endif // MNA_VERIFICATION_H
mna library export/import macros.
#define MNASHARED_EXPORT
Definition mna_global.h:55
MnaScript struct declaration — inline code embedded in a graph node.
MNE Analysis Container Format (mna/mnx).
Inline code for script-type graph nodes.
Definition mna_script.h:69
Verification check for a graph node.
QString severity
"error" (abort), "warning" (log + continue), "info" (always continue)
QString expression
Simple evaluable expression: "rank(covariance) > 0".
QString phase
"pre" (before execution) or "post" (after execution)
QString description
Human-readable: "Covariance matrix must be positive-definite".
static MnaVerificationCheck fromCbor(const QCborMap &cbor)
QString onFail
Optional remediation hint.
static MnaVerificationCheck fromJson(const QJsonObject &json)
QString id
Unique check identifier within the node (e.g. "cov_posdef").
Check evaluation result.
static MnaVerificationResult fromCbor(const QCborMap &cbor)
QString message
Formatted message: "PASS: ..." or "FAIL [error]: ...".
QString checkId
References MnaVerificationCheck::id.
QVariant actualValue
The evaluated expression result.
QString severity
Echoed from the check definition.
QDateTime evaluatedAt
When this check was evaluated.
bool passed
true if the expression evaluated to true
static MnaVerificationResult fromJson(const QJsonObject &json)
Provenance record for reproducibility.
QJsonObject toJson() const
static MnaProvenance fromCbor(const QCborMap &cbor)
QString externalToolVersion
e.g. "FreeSurfer 7.4.1", "Python 3.11.5"
QString osInfo
e.g. "macOS 15.4 arm64"
qint64 peakMemoryBytes
Peak RSS (if measurable), 0 otherwise.
QString qtVersion
e.g. "6.11.0"
QString compilerInfo
e.g. "AppleClang 16.0.0"
qint64 wallTimeMs
Wall-clock duration in milliseconds.
QString hostName
Machine name (for cluster provenance).
qint64 randomSeed
-1 if not applicable
QMap< QString, QString > inputHashes
portName → SHA-256
static MnaProvenance fromJson(const QJsonObject &json)
QString mneCppVersion
e.g. "2.2.0"
Verification, explanation, and provenance for a graph node.
MnaProvenance provenance
Complete provenance snapshot (populated by executor).
QString explanation
Human-readable explanation of what this node does and why.
static MnaVerification fromJson(const QJsonObject &json)
QList< MnaVerificationCheck > checks
Declarative checks (authored by user, evaluated by executor).
QJsonObject toJson() const
QList< MnaVerificationResult > preResults
Results of pre-execution checks (populated by executor).
QList< MnaVerificationResult > postResults
Results of post-execution checks (populated by executor).
static MnaVerification fromCbor(const QCborMap &cbor)