Skip to content

fix(doctor): validate Node-wrapped client policy - #768

Closed
rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/doctor-node-client-policy-20261006
Closed

rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/doctor-node-client-policy-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

Problem

Client-registration inspection returns early for a Node-wrapped REA command, bypassing the client-specific alignment checks. As a result, rea doctor --client codex reports a one-second startup timeout as healthy; Copilot registrations with a narrower tool selection similarly evade the existing policy check.

Change

Apply the existing client-specific checks before accepting the Node launcher shape. Ownership, disabled-state checks, accepted launcher forms, and registration-writing behavior are unchanged.

Evidence and verification

  • Actual built public doctor, isolated owned HOME and real TOML config: before the one-second registration reports healthy/aligned; after it reports config_drift/stale and exits 1. The valid 30-second control remains healthy and exits 0.
  • Regression baseline: two failures and eleven passing controls using real TOML/JSON files.
  • After: 42 focused registration/lifecycle/dialect tests pass.
  • npm run check and check:fast pass (125 existing warnings, zero errors).
  • Complete npm run verify:package passes: actual isolated npm-packed installation, CLI/MCP discovery and analysis, setup/backup/readback/update/startup checks. No user-global installation was changed.

AI-assisted implementation, independently reviewed; signed commit with DCO. This verifies REA's configuration assessment, not a running Codex or Copilot client session.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Reviewed: moving the Node-launcher early return to after Codex timeout and vscode/copilot/commandcode policy checks is the minimal correct fix — Node-wrapped registrations now funnel through the same policy. Real TOML/JSON boundary tests with isolated HOME cover the reported 1s-timeout and narrowed-tools failures. APPROVE. Non-blocking gap: no Node-wrapped vscode-type/commandcode-transport case; existing direct-binary coverage likely suffices.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Review — APPROVE

Summary

In registrationAligned(), moves the Node-launcher early return true ([node, rea.mjs, mcp]) to after the Codex startup_timeout_sec, vscode / copilot_cli / commandcode checks, so a 1s Codex timeout or narrowed Copilot tools no longer incorrectly reports aligned.

Verification

  • Minimal reorder; preserves ownership / disabled / transport semantics.
  • Both Node-wrapped and direct-binary/npx paths now funnel through the same policy checks. Matches isOwnedClientRegistrationCommand in ClientRegistrationIdentity.ts:12-17.
  • Tests: extends tests/boundary/filesystem/clientRegistrationStatus.test.ts with Node-wrapped Codex (1 vs 30) and Copilot (["binary_session"] vs ["*"]) using real TOML/JSON plus isolated HOME.
  • CI: all SUCCESS.

Gap (non-blocking)

  • No Node-wrapped vscode.type !== stdio or commandcode.transport !== stdio case. Existing direct-binary coverage likely suffices, but one parametrized case would lock the shared ordering.

@rudycelekli

Copy link
Copy Markdown
Author

Thanks. I checked the other Node-wrapped transport paths: parseRegistration rejects a non-stdio VS Code type or Command Code transport before registrationAligned runs, regardless of launcher. Those paths therefore cannot take the former Node alignment shortcut; the existing missing/SSE transport boundary controls exercise that rejection. The changed policy checks that could be bypassed are pinned with the Node-wrapped Codex timeout and Copilot tool-selection cases. The package verifier also passed; I am not claiming a native VS Code or Command Code application launch.

@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Superseded by #815, which integrated this change and has now merged (3af3811). Thanks @rudycelekli for the fix and the thorough verification — much appreciated!

@morluto morluto closed this Oct 7, 2026
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the area: setup Setup, packaging, upgrade, install, Doctor, and client registration label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants