test(meta): raise meta coverage to >=90% + fix ffi CallbackRegistry crash

MA
4mo ago
+19275-38241

Summary

Brings the atom/meta test suite to comprehensive, 1:1-with-headers coverage and fixes two latent bugs in ffi.hpp uncovered along the way.

Tests

  • Add the previously-missing tests/meta/reflection/test_refl_field.cpp (covers FieldBase: construction/defaults, member-pointer binding, validators, and the C++23 deducing-this builders incl. derived-type preservation).
  • Expand the meta test suites so every header with runtime code reaches ≥90% deduplicated source-line coverage (33 of 34 at 92.5%–100%). Coverage was measured per-test to avoid gcov's per-instantiation line inflation, which otherwise makes template headers report 5–15× their real line count.
  • facade_any stops at its reachable ceiling (~88%): the remaining lines are defensive proxy-call catch blocks and the never-invoked less_than_impl, unreachable without fault injection.
  • Full suite: 1233 test cases, 0 failures across all 37 meta test executables.

ffi fixes

  • CallbackRegistry SIGSEGV: registerCallback stored the raw closure type in std::any while getCallback<Sig> retrieved it as std::function<Sig>; the pointer-form any_cast returned nullptr on the mismatch (it does not throw, so the surrounding catch was dead code) and the null was wrapped in a success result, so callers dereferenced null and crashed. Now the callable is wrapped in a std::function with the deduced signature (sync + async paths), and getCallback null-guards to return TypeMismatch.
  • Lazy getHandle: DynamicLibrary::getHandle now honours the load strategy like getFunction (Lazy/Immediate load on access; OnDemand still needs an explicit loadLibrary()).

Note on scope

This branch also carries 6 pre-existing branch-sync / pre-commit.ci bot commits that were already on local dev but not yet on upstream dev; they appear in the diff but are not part of the substantive change above.

🤖 Generated with Claude Code


Summary by cubic

Raises atom/meta runtime-header coverage to ≥90% and fixes an ffi callback crash. Adds hot-reloadable components via meta::DynamicLibrary, switches scripting to Python, and adopts atom::type::expected for serialization results.

  • New Features

    • Implemented hot reload: Registry::loadComponentFromFile loads modules via meta::DynamicLibrary (opt-in ATOM_COMPONENTS_ENABLE_HOT_RELOAD/hot_reload).
    • Added tests/meta/reflection/test_refl_field.cpp and split shared field logic into atom/meta/refl_field.hpp.
    • Completed the components event system with Event, EventCallback, EventCallbackId in core/types.hpp; enabled events by default; added Registry::registerComponentInstance.
  • Refactors and Fixes

    • Scripting: replaced phantom ChaiScript with real Python support and updated language detection.
    • Serialization: APIs now return atom::type::expected (SerializationOutcome/DeserializationOutcome); structured SerializationError added.
    • Type module: moved public symbols into atom::type (e.g., NonCopyable, StaticString, Trackable, PointerSentinel) and updated call sites.
    • Containers: components optionally uses atom::containers fast containers when ATOM_USE_BOOST_CONTAINERS is set.
    • FFI: CallbackRegistry stores std::function<Sig> and returns TypeMismatch on signature mismatch; DynamicLibrary::getHandle respects load strategy.
    • Consolidated “advanced_*” variants: components bindings moved to scripting/bindings; system/command’s advanced executor merged into executor with a new command/command.hpp umbrella.
    • Fixed module macros and re-enabled types/macros tests; demoted hot-path logging to trace/debug; formatted exception messages via fmt::format; removed dead components/data/type_conversion.hpp and the Abseil dependency from package.hpp.
    • Misc: added missing standard headers; aligned event data correctly; updated docs (WARP.md, components/CLAUDE.md) and bumped pre-commit-hooks to v6.0.0.