Repository navigation
feat: RELAY-conformant cpp-rcp CLI (§11/§12 version/capabilities/status) - #14
Merged
Merged
Conversation
…/status) Adds the CLI binary required for `relay conform` / `relay report` to validate cpp-RCP against the embedded §12 JSON schemas (the v0.3 follow-up flagged in #11). - include/rcp/cli.hpp: rcp::cli::run() emitting the three mandatory documents as JSON conforming field-for-field to RELAY spec/schemas/cli-{version,capabilities, status}.json (additionalProperties:false — exact field sets, no extras). Logic lives in the header so it is unit-testable without a subprocess. - include/rcp/version.hpp: rcp::kVersion = "0.3.0" single source of truth. - cli/main.cpp: thin argv wrapper; exit codes per §11.3 (0 ok / 2 invalid args). - CMakeLists.txt: -DRELAY_BUILD_CLI=ON builds the `cpp-rcp` binary (§13.2); project VERSION bumped 0.1.0 → 0.3.0 to match releases. - tests/test_cli.cpp: 8 conformance tests — required fields, kind discriminator, exit codes, default text vs --format json. 28/28 CTest cases pass. - ci.yml: build matrix now configures -DRELAY_BUILD_CLI=ON so the binary compiles on clang-14, gcc-12 (C++17/20), macOS clang, and MSVC. JSON output validated as well-formed and schema-field-exact for all three docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
…d sleep) The "transitions to Faulted after misses exceed fault_after" test slept a fixed 250 ms then asserted the state once. On loaded/preempted CI runners the keeper's background thread can be scheduled late, so the 3 × 20 ms miss cycles haven't completed by the single check — observed failing on the macOS shared runner in PR #14 CI (unrelated to the CLI change). Fix: poll for HealthState::Faulted up to a 5 s deadline before asserting. Same hardening pattern already used for the command-latency test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
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
Adds the
cpp-rcpCLI binary sorelay conform/relay report(RELAY tool v0.7/v0.8) can validate cpp-RCP against the embedded §12 JSON schemas. This is the v0.3 CLI-conformance follow-up flagged when adopting the spec (issue #11).Implements the three mandatory commands (§11.1):
version [--format text|json]cli-version.jsoncapabilitiescli-capabilities.jsonstatus [--format text|json]cli-status.jsonExit codes per §11.3:
0success,2invalid args.Design
include/rcp/cli.hpp—rcp::cli::run(args, out, err)holds all logic in the header so it's unit-testable without spawning a subprocess. JSON is hand-written to exact, fixed shapes (no JSON dependency added).cli/main.cpp— thin argv→run()wrapper.include/rcp/version.hpp—rcp::kVersion = "0.3.0".-DRELAY_BUILD_CLI=ONbuilds thecpp-rcpbinary (§13.2 lowercase name); project version bumped0.1.0→0.3.0.Schema fidelity
All three documents are field-exact against the schemas (which set
additionalProperties: false):Validated with Python: valid JSON, no extra keys, all required keys present for all three.
Test plan
rcp_cliconformance tests; 28/28 CTest cases pass locally-DRELAY_BUILD_CLI=ONon all 5 platforms)