diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 484551c..c5704a8 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -6900,3 +6900,10 @@ unchecked nested optional read at `tests/cellular_lives_tests.cpp:289`. The earn mutation offer is now copied through a safe default after the assertion still checks the offer has candidates. Its check suite failed, so the dependent server image did not start; rerun is needed to reach Harbor publication. + +CI run #288 found another unchecked optional access in cellular checkpoint +recovery at `src/persistence/cellular_checkpoint_store.cpp:568` while building +the PostgreSQL-enabled analysis target. Recovery now copies the optional record, +checks its presence, and reads it through `value_or`, keeping a missing committed +action classified as a history failure. The PostgreSQL job failed, so the +dependent server-image build and Harbor publication did not start. diff --git a/src/persistence/cellular_checkpoint_store.cpp b/src/persistence/cellular_checkpoint_store.cpp index 20e952a..17846f7 100644 --- a/src/persistence/cellular_checkpoint_store.cpp +++ b/src/persistence/cellular_checkpoint_store.cpp @@ -563,9 +563,10 @@ recover_cellular_checkpoint(Postgres& db, const FilesystemObjectStore& objects, if (!records) return std::unexpected{RecoveryFailure{RecoveryError::store, records.error()}}; for (std::size_t i = 0; i < batch_actions->size(); ++i) { - if (!(*records)[i]) + const auto found_record = (*records)[i]; + if (!found_record) return fail_with(RecoveryError::history); - const auto& record = *(*records)[i]; + const auto record = found_record.value_or(CommittedActionRecord{}); const auto& action = (*batch_actions)[i]; if (record.kind != 2 || record.result != 5 || !record.cellular_input || *record.cellular_input !=