test(harness): make daemon-status validators JSON-aware#532
Merged
Conversation
The status rewrite (#528, #529) restyled the human output, so the CLI validation harness's text-scraping of `--daemon status` was stale (it looked for `Daemon PID:`, `Ready`, `Total records:` labels that no longer print in that shape). Point the CLI target at `--daemon status --json` and parse the structured payload instead. - cli-validation.rs RPC.1/2/4: parse the `--json` wrapper `{running, status, drives, stats}` — pid + lifecycle state (RPC.1), the tier-aware drives array (RPC.2, Parked/Cold may report 0 records), and the folded-in performance counters under `stats` (RPC.4). No more string scraping, so the checks are stable across cosmetic output changes. - 11-rpc.toml RPC.1/2/4 + 01-general.toml T169: invoke `status --json` and assert JSON keys (`"running"`, `"pid"`, `"drives"`, `"total_records"`, ...). api-validation.rs already validates the raw JSON-RPC responses, so its RPC.1-4 validators needed no change. Verified cli-validation.rs compiles clean (`cargo check` on the rust-script package); it runs live-on-Windows only, so end-to-end execution is unverified here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What
The status rewrite (#528/#529) restyled the human
--daemon statusoutput, so the live-Windows CLI validation harness's text-scraping (Daemon PID:,Ready,Total records:) went stale. This points the CLI target at--daemon status --jsonand parses structured JSON instead — stable across cosmetic output changes.cli-validation.rsRPC.1/2/4: parse the--jsonwrapper{running, status, drives, stats}— pid + lifecycle state (RPC.1), tier-aware drives array (RPC.2, Parked/Cold may report 0 records), folded-in perf counters understats(RPC.4).11-rpc.tomlRPC.1/2/4 +01-general.tomlT169: invokestatus --json, assert JSON keys ("running","pid","drives","total_records", …).api-validation.rsalready validates the raw JSON-RPC responses (it never scraped text), so its RPC.1–4 validators are unchanged.Verification
cargo checkon the generated rust-script package is clean (harness compiles). These harnesses run live-on-Windows only (need a real daemon + NTFS), so end-to-end execution is unverified from macOS — the JSON shapes are matched against the--jsonoutput introduced in #528/#529.