fix(result-contract-completion): enforce complete result provenance

This commit is contained in:
KOKO\Mimi
2026-08-02 02:34:07 +09:00
parent f23deb0ade
commit 51939fba5b
10 changed files with 785 additions and 157 deletions
@@ -69,6 +69,11 @@ std::string quote(const std::filesystem::path& path) {
return '"' + path.string() + '"';
}
std::string path_utf8(const std::filesystem::path& path) {
const std::u8string value = path.u8string();
return {reinterpret_cast<const char*>(value.data()), value.size()};
}
std::string read_text(const std::filesystem::path& path) {
std::ifstream input{path, std::ios::binary};
return {
@@ -93,8 +98,15 @@ TEST(MinimalCantileverPipeline, WritesReadableFiniteEquilibratedResults) {
fesa::read_hdf5_results(output.path());
ASSERT_TRUE(read.database.has_value());
ASSERT_TRUE(read.model.has_value());
ASSERT_TRUE(read.metadata.has_value());
EXPECT_TRUE(read.diagnostics.empty());
EXPECT_EQ(read.database->schema_version, "2.0.0");
EXPECT_EQ(
read.metadata->input_source,
path_utf8(fixture_path("minimal_cantilever.inp")));
EXPECT_EQ(
read.metadata->input_fingerprint,
"fnv1a64:73f31da4615f09b3");
ASSERT_EQ(read.model->nodes.size(), 2U);
EXPECT_EQ(read.model->nodes[0].id, fesa::NodeId{0});