recovery-probe

v1.1.0
io.github.BojanKovachki/recovery-probe Checked 8 hours ago Published 14 days ago

Fail reads in web and Electron test apps, inspect recovery, and compare before/after evidence.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

find_page_reads Find the reads behind a page

Opens a page in headless Chromium and lists the JSON GET requests it makes while it loads. Use it to choose the endpoint for check_read_recovery. Only successful page fetch and XHR reads are seen; native, IPC and service-worker traffic is not.

ParameterTypeDescription
url *stringPage of a development or test app.
durationMsintegerHow long to watch after the page loads.
storageStatestringPlaywright storage state file of a signed-in test account.

check_read_recovery Check that a page recovers when a read fails

Loads the page healthy, then fails one GET endpoint with each fault kind and checks that the ready marker comes back: by itself (recovery "automatic") or after clicking retrySelector ("retry"). Returns an outcome per fault, why the healthy baseline failed if it did, the text the screen showed under a fault it did not recover from, and the report folder, which includes fix-brief.md and reproduce.mjs.

ParameterTypeDescription
endpoint *stringOrigin and path of the GET read to fail, as find_page_reads lists it.
readySelector *stringCSS selector of the one element that is visible only once that read has rendered its data. It must match exactly one element: for a list, choose its container or a single item, not a selector every it…
url *stringPage of a development or test app.
faultsarrayWhich faults to apply; all of http-error, connection-failure, invalid-json by default.
readyTextstringText the ready element must contain.
recoverystring
retrySelectorstringRequired when recovery is "retry".
storageStatestring
timeoutMsinteger
timesintegerHow many consecutive requests each fault fails.

start_network_faults Start a network fault proxy

Starts a loopback HTTPS proxy for an app's own connections (an SDK, a main process, a CLI or a test run). Start the app or tests with the returned environment; connections pass until set_network_faults arms rules. Faults apply to whole connections per host: HTTPS stays end to end.

ParameterTypeDescription
portinteger

set_network_faults Arm or remove network faults

Replaces the armed rules, or removes them all with restore: true. Windows count from this call. Set dropOpen on a rule so clients that keep connections open have to reconnect.

ParameterTypeDescription
restoreboolean
rulesarray

network_fault_summary Show what the network faults did

Reports how many connections went through the proxy and, for the armed rules, how many each matched and faulted. A rule that faulted nothing means the app did not use the proxy or the host name is wrong.

stop_network_faults Stop the network fault proxy

Removes every fault, closes the proxy and returns its final summary.

find_suspects Find failure handling that can lose data

Reads JavaScript and TypeScript sources, without running them, for two patterns: UNKNOWN_AS_EMPTY (a failed or unexpected read becomes an empty collection, so "unknown" looks like "none") and FAILURE_ONLY_LOGGED (a read stores its data when it succeeds, but its failure is only logged). Each suspect names the read to fail and the check that proves or dismisses it. Use changedSince "main" to scan only what a branch changed. Needs TypeScript in the project.

ParameterTypeDescription
changedSincestringGit reference, such as main: scan only the files changed since it, uncommitted and untracked ones included.
includeTestsbooleanScan test files too.
pathsarrayFiles and directories to scan, relative to the working directory. Default: all of it.

compare_reports Compare reports from before and after a change

Compares reports of the same check from before and after a change, such as main and a branch, and returns a verdict (IMPROVED, PARTLY_IMPROVED, REGRESSED, MIXED, UNCHANGED, INCONCLUSIVE or NOT_COMPARABLE), what happened to each problem, and a Markdown block for a pull request. A problem counts as gone only when a complete run after the change checked it, so a run that stopped early is never a fix. Give several reports per side for repeated runs.

ParameterTypeDescription
after *arrayReports of the same check from after the change.
before *arrayReports from before the change: report.json files or their folders.
afterLabelstringName for the after side, such as the branch.
beforeLabelstringName for the before side, such as main.

plan_verification Propose the checks that verify a code change

Experimental. Before recording a baseline, proposes which existing Recovery Probe checks verify a change: it matches the files changed since a Git reference (committed, staged, unstaged, untracked, deleted, renamed) against the project scenario registry (recovery-probe.registry.json) and the suspects on the changed lines. Each check says which file selected it, what it checks, where its expectation came from and what it does not cover. It also lists suggestions to review, changed files with no known check, and what needs a person: open questions, missing expectations, invalid entries. It runs…

ParameterTypeDescription
basestringThe Git reference the change starts from.
expectationsobjectExpected behavior, and where it comes from, for registry scenarios that state none, by scenario name. Only what the user said; never invent one.
forcebooleanReplace an existing plan file. Only after reviewing it.
registrystringThe scenario registry, relative to the working directory. Default: recovery-probe.registry.json.
runsintegerRuns of each check on each side in the candidate plan. Default: 3.
taskstringWhat the change is for, kept in the report as given.
writestringWrite the candidate verify plan to this relative path, such as .recovery-probe/verify.json.

verify_change Verify a code change with before and after evidence

Call with baseline true before changing the code, and without it before saying the change is done. The plan file lists the checks that prove the change. Verify reruns them, compares the runs with the baseline, and scans the lines changed since the plan base for suspects. VERIFIED needs every check improved or clean with complete runs on both sides, and no suspect on a changed line; otherwise the reasons say what to resolve. Do not call a change done while it is NOT_VERIFIED.

ParameterTypeDescription
baselinebooleanRecord the runs from before the change instead of verifying it.
planstringThe plan file, relative to the working directory. Default: .recovery-probe/verify.json.

run_recovery_probe Run a Recovery Probe command

Runs a Recovery Probe command that has no dedicated tool, such as check and discover for an Electron app or an attached browser, action, observe (with --steps, --network or --files), refresh, reads, windows, android --list or doctor (setup checks), and returns its exit code and output. Commands: check, discover, action, reads, windows, observe, refresh, android, doctor. Pass --json where the command supports it. See the package docs for each command's configuration.

ParameterTypeDescription
args *arrayCommand and arguments, for example ["observe", "--config", "observe.json", "--json"].
timeoutMsinteger