refactor(#458): Dispatch .input loading through I/O adapter registry#493
Merged
refactor(#458): Dispatch .input loading through I/O adapter registry#493
Conversation
b581696 to
4d5193e
Compare
Replace the hard-coded CSV loading path in session_facts.c with adapter-based dispatch via wl_io_find_adapter. Each .input relation resolves its scheme from the io="..." parameter (defaulting to "csv"), looks up the registered adapter, creates a wl_io_ctx_t from the relation metadata, and delegates to the adapter's read callback. Path resolution and CSV-specific logic now live entirely in csv_adapter.c. session_facts.c is scheme-agnostic. This is the revertible integration commit -- git revert cleanly restores the legacy CSV path without unwinding #451-#456. Part of #446 (I/O adapter umbrella).
4d5193e to
faf3914
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #458. Part of #446 (I/O adapter umbrella). This is the core integration commit.
Replaces the hard-coded CSV loading path in session_facts.c with adapter-based dispatch. Each .input relation resolves its scheme from io="..." (defaulting to "csv"), looks up the registered adapter, and delegates to its read callback. session_facts.c is now fully scheme-agnostic.
Changes
wirelog/session_facts.c— rewritten to dispatch via wl_io_find_adapterwirelog/io/io_ctx.c+io_ctx_internal.h— new wl_io_ctx_create_for_relation production constructorwirelog/io/csv_adapter.c— intern trampoline uses wl_intern_put directly (0-based, matching legacy path)tests/test_io_dispatch.c— all 3 TDD tests PASS (mock adapter, CSV default, unknown scheme error)bench/meson.build— bench targets link io moduleRevertibility
Single commit. git revert cleanly restores the legacy CSV path without unwinding #451-#456.
Test results