Skip to content

[AS2-E2-S6] Add diagnostics helpers for probe and decode failures - #89

Merged
bboczula merged 9 commits into
developmentfrom
codex/issue-45-diagnostics-helpers
Jun 10, 2026
Merged

[AS2-E2-S6] Add diagnostics helpers for probe and decode failures#89
bboczula merged 9 commits into
developmentfrom
codex/issue-45-diagnostics-helpers

Conversation

@bboczula

Copy link
Copy Markdown
Owner

Summary

  • Added private runtime diagnostic message constants with stable ASSET_* callback prefixes.
  • Added a centralized runtime helper that records internal diagnostics and emits filtered log callback events.
  • Routed probe, decode, and file-load failure paths through the helper while preserving existing public Result mappings.
  • Documented diagnostic ownership and cleanup-path scope to avoid duplicate log spam.
  • Added focused unit coverage for callback emission, log-level filtering, and single emission from decode-from-file failures.

Validation

  • Debug build passed with MSBuild.
  • Debug unit tests passed: 176/176.
  • Debug public header validation passed.
  • Release build passed with MSBuild.
  • Release unit tests passed: 176/176.
  • Release public header validation passed.

Closes #45.

bboczula added 8 commits June 10, 2026 06:49
Adds private diagnostics message constants with stable ASSET_* prefixes for runtime callback logs. Keeps the structure internal so public SDK headers do not expose diagnostic storage or error-code details.
Introduces an internal RuntimeContext helper that records diagnostics and dispatches filtered callback log events. This keeps failure-path logging consistent without changing public API shape.
Routes image and mesh probe/decode failures through the centralized runtime helper. Unsupported formats use warning logs, while malformed inputs and decoder rejection use error logs with the same existing Result mappings.
Routes LoadFile and decode-from-file load failures through the centralized diagnostic emission helper. File-not-found and IO failures now produce one error callback message while preserving existing Result mappings.
Marks the decode-from-file boundary where load diagnostics stop and blob decode diagnostics begin. This makes the single-log-per-failure-path rule explicit for future maintenance.
Records that this story covers probe, decode, file-load, and wrapper cleanup diagnostics. Keeps explicit invalid Release and Destroy validation paths non-logging unless a later story expands the scope.
Adds focused tests for unsupported decode logs, file-load logs, log-level filtering, and single decode-from-file emission. Callback capture now copies message text so assertions do not depend on pointer lifetime.
Verified Debug and Release builds with MSBuild. Ran Debug and Release unit tests, plus public header compile validation for both configurations.

Copy link
Copy Markdown
Owner Author

Review note:

unit_tests/GeneralUnitTests.cpp near the new runtime diagnostics file-load tests:

Can we add a direct LoadFile failure logging assertion as well? The production change now routes LoadFile failures through EmitDiagnostic, but the new coverage only verifies file-load logging through the decode-from-file wrappers.

Adds direct LoadFile failure assertions to the runtime diagnostics file-load test. Verifies the blob-load callback message and handle state alongside the existing decode-from-file wrapper coverage.

Copy link
Copy Markdown
Owner Author

Hello again, I am a Humble Human C++ Developer.

I addressed the review note by expanding RuntimeDiagnosticsEmitFileLoadLogs to cover direct LoadFile failure logging in addition to the existing decode-from-file wrapper coverage.

What changed:

  • Added a direct LoadFile(context, "missing_blob_source.bin", &blob) failure assertion.
  • Verified the callback emits exactly one Error log for that path.
  • Verified the message is AssetSuite::Internal::Diagnostics::BlobLoadFailed.
  • Verified the output BlobHandle remains null.
  • Kept the existing image and mesh decode-from-file logging checks in the same test.

Validation:

  • Debug build passed.
  • Debug unit tests passed: 176/176.

Pushed commit: 49302b4 Cover direct LoadFile diagnostic logging.

@bboczula
bboczula marked this pull request as ready for review June 10, 2026 19:47
@bboczula
bboczula merged commit a4bb5fa into development Jun 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant