v2.0.0
Loading...
Searching...
No Matches
mna_verification.h
Go to the documentation of this file.
1//=============================================================================================================
30
31#ifndef MNA_VERIFICATION_H
32#define MNA_VERIFICATION_H
33
34//=============================================================================================================
35// INCLUDES
36//=============================================================================================================
37
38#include "mna_global.h"
39#include "mna_script.h"
40
41//=============================================================================================================
42// QT INCLUDES
43//=============================================================================================================
44
45#include <QString>
46#include <QStringList>
47#include <QVariant>
48#include <QVariantMap>
49#include <QMap>
50#include <QList>
51#include <QDateTime>
52#include <QJsonObject>
53#include <QCborMap>
54
55//=============================================================================================================
56// DEFINE NAMESPACE MNALIB
57//=============================================================================================================
58
59namespace MNALIB
60{
61
62//=============================================================================================================
72{
73 QString id;
74 QString description;
75 QString phase;
76 QString expression;
81 QString severity;
82 QString onFail;
83
84 QJsonObject toJson() const;
85 static MnaVerificationCheck fromJson(const QJsonObject& json);
86 QCborMap toCbor() const;
87 static MnaVerificationCheck fromCbor(const QCborMap& cbor);
88};
89
90//=============================================================================================================
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//=============================================================================================================
123{
124 // Input snapshot
125 QMap<QString, QString> inputHashes;
126
127 // Resolved attributes at execution time (after param-tree evaluation)
129
130 // Software environment
132 QString qtVersion;
133 QString compilerInfo;
134 QString osInfo;
135 QString hostName;
136
137 // For IPC/Script nodes
139
140 // Timing
141 QDateTime startedAt;
142 QDateTime finishedAt;
143 qint64 wallTimeMs = 0;
144 qint64 peakMemoryBytes = 0;
145
146 // Random seed (if stochastic operations were used)
147 qint64 randomSeed = -1;
148
149 QJsonObject toJson() const;
150 static MnaProvenance fromJson(const QJsonObject& json);
151 QCborMap toCbor() const;
152 static MnaProvenance fromCbor(const QCborMap& cbor);
153};
154
155//=============================================================================================================
166{
168 QString explanation;
169
171 QList<MnaVerificationCheck> checks;
172
174 QList<MnaVerificationResult> preResults;
175
177 QList<MnaVerificationResult> postResults;
178
181
182 QJsonObject toJson() const;
183 static MnaVerification fromJson(const QJsonObject& json);
184 QCborMap toCbor() const;
185 static MnaVerification fromCbor(const QCborMap& cbor);
186};
187
188} // namespace MNALIB
189
190#endif // MNA_VERIFICATION_H
Export/import macros, build-info accessors, and MNALIB namespace anchor for the MNE Analysis Containe...
#define MNASHARED_EXPORT
Definition mna_global.h:47
Inline source code carried by a Script-mode graph node — language, interpreter command,...
MNE Analysis Container Format (mna/mnx).
Inline interpreter-launched source code carried by a Script-mode MnaNode.
Definition mna_script.h:66
Verification check for a graph node.
QString severity
"error" (abort), "warning" (log + continue), "info" (always continue)
QString expression
MnaParamTree expression over attributes, inputs and (post) outputs: "rank > 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)