Summary
Refs #6914. Without a scope option, rea doctor reports healthy: false whenever any detected client or provider is unhealthy, including ones the user never set up (here: IDA, JADX, Kuna, and the Codex, VS Code and Gemini registrations). A working setup then looks broken, and the report does not say which failures matter or how to check only the set-up workflow.
Problem and expected behavior
- Trigger: run
rea doctorwith no--client,--provideror--skillon a host where only some clients and providers are set up. - Before:
healthy: falseandenvironment_healthy: false, with no pointer to the configured workflow's readiness. The scoped mode that answers this already exists, but the user has to know to use it and which IDs to pass. - After: the audit-wide report additionally carries
configured_scope, with the set-up clients, providers and skill, their readiness under the existing explicit-scope rules, and the exactrea doctorcommand that reports that scope.healthy,environment_healthy,scope_checksand the exit status are unchanged.
Change and scope
-
src/application/DoctorScope.ts: newconfiguredDoctorScope, which selects:- clients whose registration state is anything except
missingormanual(sostale,unknownandinvalidregistrations stay in, and their failures still count); - providers whose inspection reports
configured: true, plus Hopper when it is configured or its launcher was discovered (presence, not readiness, so a failing Hopper stays visible); - the skill when any selected copy is installed, including a partial install whose aggregate state is
missing.
selectConfiguredDoctorScopepicks the clients and providers;configuredDoctorScopebuilds the explicit scope and reusesscopeDoctorChecksforhealthy, so there is no second definition of readiness. Nothing is reported when no client or provider is set up. It reportsargv(the exact unquoted arguments, starting withnpx -y rea-agents@<version>orbunx rea-agents@<version>, pinned to the running release, when doctor was launched that way, otherwiserea) andcommand, the same invocation quoted for PowerShell on Windows and POSIX shells elsewhere, quoting only arguments that need it (on Windows that includes a leading@and any,, which PowerShell treats as splatting and array syntax). - clients whose registration state is anything except
-
src/application/Doctor.ts: when any client is configured,inspectConfiguredScopereads that client set's skill copies (as the suggested--client … --skillscope does) throughinspectSkillIdentity, the helpercollectDoctorIdentitynow shares, and judgesconfigured_scopefrom those facts. With no configured client the suggested scope reads every copy, so the audit's facts are reused. The audit's own checks are unchanged. If doctor's final cleanup fails,configured_scope.healthybecomes false with the top-level fields, as the suggested scope would report. -
DoctorReport.configured_scope?is emitted only whenscope.mode === "audit-wide". -
docs/installation.md: explains why an audit-widehealthycan be false for a working setup and whatconfigured_scopecontains. -
Not included: no change to what
healthymeans or to the exit status; the issue's discussion suggests keeping both summaries, and this keeps the audit result authoritative. No new CLI flag (the existing--client/--provider/--skillscope already covers the "configured only" check; the report now names it).
Follow the contribution scope. Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
- Semantic owner and earliest changed stage: doctor scope selection (
DoctorScope.ts), consumed byinspectDoctor. - Contribution scope fit and linked maintainer decision: usability change within the existing doctor command; not applicable. The issue is labeled as a feature and its exact presentation is open for maintainer preference.
- CLI and MCP/tool-catalog contract: additive optional
configured_scopefield on audit-wide doctor reports; no change for explicit-scope reports or to existing fields and exit status. No MCP tool schema change. - Provider, bridge, target-format, or platform compatibility: none.
- Evidence, artifact, provenance, or reconstruction contract: none.
- Target selection, authority, upstream behavior, and cleanup details (if applicable): read-only; reuses the facts doctor already collects (registrations, provider inspections, skill state). No new probes.
- Generated metadata (
docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none.
Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible.
- Read existing files or captured data.
- Launch or attach to a process.
- Inject instrumentation or run scripts/code.
- Change process memory, registers, files, or configuration.
- Contact network services.
- Recover protected code or work around protections.
- Documentation or usability only; no target interaction.
- Not sure yet; investigation or maintainer guidance needed.
Evidence and regression coverage
-
Tests added or updated:
src/application/Doctor.test.ts→ "doctor configured scope":- a workstation with an aligned
cursorregistration, missingcodex/vscode, configured Ghidra, discovered Hopper and unconfigured IDA/JADX/Kuna: the audit stayshealthy: false,configured_scopeis{clients: ["cursor"], providers: ["ghidra", "hopper"], skill: true, healthy: true}with the matching command, and running that exact scope also reportshealthy: true(and has noconfigured_scope); - a configured but unavailable Ghidra makes
configured_scope.healthyfalse and listsghidra-javawith its remediation infailing_checks; a healthy scope hasfailing_checks: []; - a
staleregistration stays in the configured clients and fails it; - a target path with a space and a quote is shell-quoted in the command; on
win32it is quoted for PowerShell and kept unquoted inargv; - a partial skill install (aligned
cursor, missingcodexcopy) keeps--skilland makes the workflow unhealthy; - a final cleanup failure (through
runDoctorOwned) makes bothconfigured_scopeand the suggested scope unhealthy and appears infailing_checks; - a package-runner launch keeps the pinned
npx -y rea-agents@<version>inargv/command, andsystemDoctorHostdetectsbunxfrom the environment; - on
win32,@sample.exeanda,b.exeare quoted whiledir/a@b.exestays bare; on Linux@sample.exestays bare; - a discovered Hopper whose later check fails (Linux
hopper-demo-runtime) stays inprovidersand makes the workflow unhealthy; - the skill is judged from the configured clients' copies: with an aligned
cursorcopy and a stale copy elsewhere, the audit keeps its failingskill:identitycheck whileconfigured_scope.healthyis true and matches the suggested scope; a stalecursorcopy makes it false (review finding); - no
configured_scopewhen nothing is set up.
- a workstation with an aligned
-
Base reproduction or other evidence: on the base revision the four positive tests fail (
configured_scopeisundefined); the "nothing set up" control passes on both. -
User-visible CLI/MCP output (if applicable):
rea doctor --format jsonon a real macOS host (one agent client registered, Hopper installed, IDA/JADX/Kuna and other clients not set up), run from this branch's build:{"healthy": false, "environment_healthy": false, "configured_scope": {"clients": ["<client>"], "providers": ["hopper"], "skill": true, "healthy": false, "command": "rea doctor --client <client> --provider hopper --skill", "failing_checks": [{"name": "registration:<client>", "ok": false, "classification": "config_drift", …}, {"name": "skill:identity", "ok": false, "classification": "config_drift", …}]}}(The registered client's ID is replaced with
<client>here; everything else is verbatim.)Here
configured_scope.healthyis false for real reasons rather than the unconfigured components: the development build expects skill version 46 while the installed copy is 42, and the client registration points at the installed 6.7.0 rather than this checkout. Running the printed command reports exactly those two failures (registration:<client>,skill:identity). The installed 6.7.0 on the same host reports the samehealthy/environment_healthywithoutconfigured_scope. -
Remaining proof gaps: not run on Linux or Windows hosts; Windows quoting is covered by a unit test only, and
commandtargets PowerShell (cmd.exe callers should useargv). Whether maintainers prefer a different field name or an additional human-readable summary line is open.
For evidence-bearing changes:
- Observed, derived, and inferred claims remain distinguishable.
- Artifact identity, source provenance, and failed attempts remain preserved.
- Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
Node 24.22.1, macOS arm64, after npm ci. At head c91230b3:
npx vitest run src/application/Doctor.test.ts— 91 passed.npx vitest run src/application tests/boundary/cli/doctorHopperDiscovery.test.ts tests/boundary/cli/cliSetup.test.ts(afternpm run build) — 161 files passed; 2521 tests passed, 3 skipped.npm run typecheck— passed.npm run lint— 0 errors; 2657 warnings, identical to main without these changes.npm run format:checkandnpm run docs:check— passed.npm run build— passed.
At 78faaaa4 (first commit), additionally: npx vitest run src/application tests/boundary/cli — 329 of 330 files passed; 3648 tests passed, 8 skipped, 1 failed: tests/boundary/cli/idaRetainedCleanupCli.test.ts, which passes when run alone on this branch and on main without these changes. npm run verify:test-discovery and npm run verify:architecture-guards passed. These were not repeated at c91230b3.
GitHub CI on e7aebf37 failed only in tests/boundary/process/packedBridgeVerification.test.ts, which also failed on main at the base commit; that is now fixed on main. CI on 7baaa6ba failed only in tests/process-global/commandFinalizationCancellation.test.ts, which fails identically on current main 397aa62f without these changes (run locally on a clean checkout; see the PR comments).
Compatibility, safety, and release
- Breaking changes or migration steps: none; one optional field added to audit-wide reports.
- Real Hopper/Ghidra, browser, or OS coverage: real
rea doctoron macOS arm64 (above). Not run on Linux or Windows. - Package or release metadata impact: none.
- Security, privacy, process, or containment review: no new reads beyond what doctor already collects; the report repeats client and provider IDs that the audit already lists.
Author readiness
Human owner: @akshatgg
- I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
- I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
- I declare this PR ready for initial maintainer review.
Before merge
- This PR addresses a concrete problem or an agreed enhancement.
- Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
- The PR has one focused outcome and the title follows
type(scope): outcome. - Related issue is linked, or the reason for not linking one is stated above.
- Tests cover changed observable behavior and meaningful failure paths.
- Owning docs, contracts, and generated metadata are updated where needed.
- User-visible CLI/MCP changes include representative output.
- I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
Activity
19Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
|---|---|---|---|
| 📝 Code Review | ✅ Completed 2026-10-25T21:17:50.631068Z | c91230b | New commits |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Note on the red CI: the only failing tests are in tests/boundary/process/packedBridgeVerification.test.ts, the packed Python bridge check, which this PR does not touch. The same test fails on main at this branch's base commit 2250e67b (run 40090967365) and on later main commits, together with packagedWasmVerifierOwnership. The other shards were cancelled after that failure. I'll update the branch once main is green so CI reruns.
CI update: the earlier packedBridgeVerification failure is gone (fixed on main). The run on 7baaa6ba now fails only in tests/process-global/commandFinalizationCancellation.test.ts (five "preserves the analysis-view result and exit status …" cases), in Test shard 2/8 and Portable tests. Those five fail the same way on current main (397aa62f) without this PR's changes; I ran that file locally on a clean main checkout. This PR does not touch analysis-view or command finalization.
@gensokyo-dev @morluto, this is ready for review when you have a moment. It addresses #6914: rea doctor gains an additive configured_scope on audit-wide reports, and healthy and the exit status are unchanged. All bot review threads so far have been answered with fixes and tests.
Two maintainer-only points:
- CI on this branch is red only in
tests/process-global/commandFinalizationCancellation.test.ts, which fails identically on currentmain(397aa62f) without these changes (details in the comment above). A rerun oncemainis green should clear it, and I'm happy to update the branch then. - The field name and presentation (
configured_scopewithargvand a host-quotedcommand) are open to your preference if you'd rather shape it differently.
Tested this on a real Windows 11 x64 machine at commit e785f819d.
The new configured_scope behavior works as expected in my setup. rea doctor correctly detects my configured workflow as Codex + Ghidra 12.1.4 + JADX, while unrelated/unconfigured providers remain part of the audit-wide result.
Running: rea doctor --client codex --provider ghidra --provider jadx
returns healthy: true.
Adding --skill makes the scoped result unhealthy because my installed skill is reported as stale (installed_version: 42, expected_skill_version: 46), with config_drift reported correctly.
So on my Windows test, the configured-scope logic and the suggested scoped command both behaved as expected.
One small UX observation from the Windows test : when configured_scope.healthy is false, the summary does not immediately show which configured check caused it.
In my case, I had to look further down to see that skill:identity was the failing check due to the stale skill version.
Would it be useful for configured_scope to also expose something like failing_checks or a short reason when it is unhealthy? I think that would make the new summary much easier to interpret.
@Innerloop17 thanks for testing on Windows 11, and good suggestion. Added in c91230b3: configured_scope now carries failing_checks, the checks that make it unhealthy with their detail and remediation (empty when healthy). A final cleanup failure is listed there too.
It lists the scope's own checks rather than pointing into the audit, because the configured scope judges the skill from the configured clients' copies. Its skill:identity can therefore differ from the audit's. In your case it should show skill:identity with the stale-copy detail and the rea setup --skill-client … --skill remediation.
Can u test again.......
The new failing_checks field works correctly on my Windows setup, thanks for adding it so quickly!!
One small readability thought: because detail and remediation can get fairly long, the current compact row format is a bit dense to scan.
Maybe this is my Pythonic bias showing 😄, but I find a multiline rendering easier to scan, for example:
failing_checks:
- name: skill:identity
classification: config_drift
detail: ...
remediation: ...The current output is technically fine; this is just a UX/readability suggestion for the summary block.
Thanks @Innerloop17 for testing it again on Windows, glad failing_checks works for you!
The compact rows come from the CLI's shared default output format (TOON), which renders every list of same-shaped objects that way (checks, providerInspections, etc.). Changing it only for failing_checks would make the doctor report inconsistent.
For the multiline layout you showed, rea doctor --format yaml already prints each failing check as its own block with name, classification, detail and remediation on separate lines (--format json works too).
Changing the default rendering would be a CLI-wide decision for the maintainers, so I've kept this PR to the doctor data itself.
Thanks, that makes sense. And good to know that --format yaml already gives the multiline structure I had in mind.
Thanks for the clarification!
[Medium impact] The reviewed changes appear safe to merge.
Summary
Adds
configured_scopeto audit-wide doctor reports without changing the audit result or exit status.Both earlier findings remain fixed: skill checks read the selected clients’ copies, and package-runner commands pin the running release. No new actionable issues or security concerns were found in the changes since the last review. Supersession could not be checked because GitHub access was unavailable. No runtime checks were run.
Diagram
Reviews (7) · Last reviewed commit: "feat(doctor): name the failing checks in..." · Reviewed by Greptile