Skip to content

feat: v2.16.0 — C ABI & CLI Rebuild (§Phase 15 milestone 60) - #55

Merged
SoundMatt merged 1 commit into
mainfrom
feat/v2.16.0-c-abi-cli-rebuild
Jul 29, 2026
Merged

SoundMatt merged 1 commit into
mainfrom
feat/v2.16.0-c-abi-cli-rebuild

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Implements ROADMAP.md milestone 60, "C ABI & CLI Rebuild (v2.16.0)" — the final milestone of Phase 15, closing out the TC18 protocol replacement's client-facing surfaces.

  • capi.h/capi_impl.hpp — REPLACE. From-scratch RTOS/bare-metal C ABI against the server+endpoint request model (rcp_stream_key_t + rcp_byte_bus_id_t, rcp_acf_info_t mirroring rcp::acf::AcfMessageInfo). rcp_ctrl_h now binds a caller-supplied rcp_request_fn_t C function pointer — the C-linkage analog of rcp/record.hpp's/rcp/observe.hpp's RequestFn — so it can be backed by rcp::mock::Server::dispatch, rcp::udp::Client::request, or real hardware without depending on either. Registry storage is a fixed 16-entry table (genuinely no heap allocation); rcp_response_t gains a caller-supplied payload_cap so responses are actually written into caller memory (new REQ-CAPI-009 covers the overrun-rejection case).
  • cli.hpp (+ cli/main.cpp, unchanged) — ADAPT. version/capabilities/status unchanged in shape. send's protocol-flags form moves from --zone <name> --type <cmdtype> to --server <stream_key> --endpoint <byte_bus_id> --op read|write [--evt-op <0-7>], dispatching against rcp::mock::Server (v2.12.0) instead of legacy_mock's Zone-keyed registry. capabilities_json()'s transports/features refreshed to the v2.13.0/v2.14.0 transports and v2.3.0/v2.4.0/v2.7.0 endpoint set.
  • adapt.hpp — ADAPT. Adapt() now takes a RequestFn instead of shared_ptr<Controller>. zone_to_relay_id/zone_from_relay_id replaced by endpoint_id_to_relay_id/relay_id_to_endpoint_id, encoding (stream_key, byte_bus_id) into relay::Message.id. subscribe() now reports function_not_supported unconditionally (no analog in the target spec's request/response shape, matching every ADAPTed Phase 14/15 header). relay/relay.hpp itself is unchanged.

rcp.hpp/rcp/legacy_mock.hpp are untouched — rcp/config.hpp is the one remaining pre-replacement dependent, and its own rebind is out of this milestone's scope. Grepped the tree for consumers of the pre-v2.16.0 capi_impl.hpp/cli.hpp/adapt.hpp APIs beyond their own tests: none found, so no legacy-shim split was needed.

tests/test_capi.cpp, tests/test_cli.cpp, and tests/test_relay.cpp are rewritten in place under their existing REQ-CAPI-*/REQ-CLI-*/REQ-RELAY-* prefixes, traced in .fusa-reqs.json. version.hpp/CMakeLists.txt bumped to 2.16.0. README.md and ROADMAP.md updated with a "Done (v2.16.0)" note.

Test plan

  • cmake --build build --parallel + ctest --test-dir build -j1 — 60/60 passing, GCC 16 and Clang (Debug + Release)
  • Manual smoke test of the cpp-rcp CLI binary (version, capabilities, send --server ... --endpoint ... --op ...)
  • cpfusa check / lint / analyze / trace --gaps — no new errors, only baseline-consistent warnings/infos
  • Confirmed relay conform --strict only exercises version/capabilities/status (never send), which are unaffected in shape

@SoundMatt
SoundMatt force-pushed the feat/v2.16.0-c-abi-cli-rebuild branch 2 times, most recently from a431012 to 051b8f4 Compare July 29, 2026 03:02
Rebuilds capi.h/capi_impl.hpp from scratch against the server+endpoint
request model established through v2.15.0, per the Satellite Package
Disposition table's REPLACE entry for this pair. rcp_zone_t/rcp_command_t/
rcp_response_t/rcp_priority_t are discarded outright; addressing moves to
a caller-chosen rcp_stream_key_t + rcp_byte_bus_id_t, rcp_acf_info_t
mirrors rcp::acf::AcfMessageInfo one-for-one, and an rcp_ctrl_h now binds
one caller-supplied rcp_request_fn_t callback (a C-linkage RequestFn, the
same client-side send-equivalent call shape rcp/record.hpp's and
rcp/observe.hpp's own RequestFn standardize on) rather than wrapping
rcp::legacy_mock::Controller directly — so the callback can be backed by
rcp::mock::Server::dispatch, rcp::udp::Client::request, or real hardware
without this header depending on any of them. The registry becomes a
fixed 16-entry table (no heap allocation, closing a gap the old
std::unordered_map-backed registry left in its own "no heap" claim), and
rcp_response_t gains a caller-supplied payload_cap so a response payload
is actually written into caller-owned memory instead of the old stub's
unconditional payload=nullptr.

cli.hpp (and cli/main.cpp, unchanged) is adapted in place: version/
capabilities/status carry forward unchanged in shape; send's protocol-
flags form moves from --zone/--type to --server/--endpoint/--op[/--evt-op],
dispatching against rcp::mock::Server instead of legacy_mock's Zone-keyed
Registry. capabilities_json()'s transports/features are refreshed to the
v2.13.0/v2.14.0 transports and v2.3.0/v2.4.0/v2.7.0 endpoint set.

adapt.hpp's Adapt() now takes a RequestFn instead of a
shared_ptr<Controller>, the same "primitives, not a wrapped chokepoint"
choice every ADAPTed Phase 14/15 header already made. zone_to_relay_id/
zone_from_relay_id's PascalCase-zone scheme is replaced by
endpoint_id_to_relay_id/relay_id_to_endpoint_id, encoding a
(stream_key, byte_bus_id) pair into relay::Message.id;
message_to_request/response_to_message replace message_to_command/
status_to_message, mapping op/evt_op via meta instead of the removed
CommandType/Priority pair. subscribe() now reports
std::errc::function_not_supported unconditionally — the same call every
ADAPTed application bridge made at v2.15.0 for the removed Status push
model, which has no analog in the target specification's request/response
shape.

rcp.hpp and rcp/legacy_mock.hpp are untouched: rcp/config.hpp is the one
remaining pre-replacement dependent, and its own rebind is not part of
this milestone's scope. Grepping the tree for consumers of the pre-v2.16.0
capi_impl.hpp/cli.hpp/adapt.hpp APIs beyond their own tests found none, so
no legacy-shim split file was needed anywhere in this change.

tests/test_capi.cpp, tests/test_cli.cpp, and tests/test_relay.cpp are
rewritten in place under their existing REQ-CAPI-*/REQ-CLI-*/REQ-RELAY-*
prefixes (REQ-CAPI-009 new, for the payload_cap-overrun rejection),
traced in .fusa-reqs.json. version.hpp/CMakeLists.txt bumped to 2.16.0;
README.md and ROADMAP.md updated with a Done note.

Verified locally: full build + ctest (60/60 passing) on GCC and Clang,
cpp-FuSa check/lint/analyze/trace, and manual smoke-testing of the CLI
binary. The RELAY conform --strict gate only exercises version/
capabilities/status (never send), which are unaffected in shape.

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt force-pushed the feat/v2.16.0-c-abi-cli-rebuild branch from 051b8f4 to 052b5c5 Compare July 29, 2026 03:10
@SoundMatt
SoundMatt merged commit c1f9e13 into main Jul 29, 2026
38 of 39 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