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//=============================================================================================================
70{
71 QString id;
72 QString description;
73 QString phase;
74 QString expression;
79 QString severity;
80 QString onFail;
81
82 QJsonObject toJson() const;
83 static MnaVerificationCheck fromJson(const QJsonObject& json);
84 QCborMap toCbor() const;
85 static MnaVerificationCheck fromCbor(const QCborMap& cbor);
86};
87
88//=============================================================================================================
95{
96 QString checkId;
97 bool passed = false;
98 QString severity;
99 QString message;
100 QVariant actualValue;
101 QDateTime evaluatedAt;
102
103 QJsonObject toJson() const;
104 static MnaVerificationResult fromJson(const QJsonObject& json);
105 QCborMap toCbor() const;
106 static MnaVerificationResult fromCbor(const QCborMap& cbor);
107};
108
109//=============================================================================================================
117{
118 // Input snapshot
119 QMap<QString, QString> inputHashes;
120
121 // Resolved attributes at execution time (after param-tree evaluation)
123
124 // Software environment
126 QString qtVersion;
127 QString compilerInfo;
128 QString osInfo;
129 QString hostName;
130
131 // For IPC/Script nodes
133
134 // Timing
135 QDateTime startedAt;
136 QDateTime finishedAt;
137 qint64 wallTimeMs = 0;
138 qint64 peakMemoryBytes = 0;
139
140 // Random seed (if stochastic operations were used)
141 qint64 randomSeed = -1;
142
143 QJsonObject toJson() const;
144 static MnaProvenance fromJson(const QJsonObject& json);
145 QCborMap toCbor() const;
146 static MnaProvenance fromCbor(const QCborMap& cbor);
147};
148
149//=============================================================================================================
158{
160 QString explanation;
161
163 QList<MnaVerificationCheck> checks;
164
166 QList<MnaVerificationResult> preResults;
167
169 QList<MnaVerificationResult> postResults;
170
173
174 QJsonObject toJson() const;
175 static MnaVerification fromJson(const QJsonObject& json);
176 QCborMap toCbor() const;
177 static MnaVerification fromCbor(const QCborMap& cbor);
178};
179
180} // namespace MNALIB
181
182#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:64
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)