Skip to content

refactor(#458): Dispatch .input loading through I/O adapter registry#493

Merged
justinjoy merged 1 commit intomainfrom
feat/458-dispatch-rewrite
Apr 12, 2026
Merged

refactor(#458): Dispatch .input loading through I/O adapter registry#493
justinjoy merged 1 commit intomainfrom
feat/458-dispatch-rewrite

Conversation

@justinjoy
Copy link
Copy Markdown
Collaborator

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_adapter
  • wirelog/io/io_ctx.c + io_ctx_internal.h — new wl_io_ctx_create_for_relation production constructor
  • wirelog/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 module

Revertibility

Single commit. git revert cleanly restores the legacy CSV path without unwinding #451-#456.

Test results

@justinjoy justinjoy force-pushed the feat/458-dispatch-rewrite branch 2 times, most recently from b581696 to 4d5193e Compare April 12, 2026 07:39
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).
@justinjoy justinjoy force-pushed the feat/458-dispatch-rewrite branch from 4d5193e to faf3914 Compare April 12, 2026 07:54
@justinjoy justinjoy merged commit c122ab4 into main Apr 12, 2026
7 checks passed
@justinjoy justinjoy deleted the feat/458-dispatch-rewrite branch April 12, 2026 11:39
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.

session_facts.c dispatch rewrite (rollback unit)

1 participant