-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Relay doctor diagnostics #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9420139
feat: add Relay doctor diagnostics
krishna916 bfda8eb
fix: harden doctor failure handling
krishna916 2e55ba6
docs: add PR 49 signal remediation plan
krishna916 9a403d2
fix: stop doctor checks after interruption
krishna916 f404655
fix: coordinate doctor signal cleanup
krishna916 b8e51c5
fix: harden doctor cleanup verification
krishna916 42c1665
docs: add PR 49 cross-platform path test remediation plan
krishna916 ecce1db
style: format PR 49 remediation plan
krishna916 e9cd75f
test: use host-native doctor path fixtures
krishna916 c240ae5
docs: add PR 49 dependency audit remediation plan
krishna916 b5892fb
chore: upgrade MCP SDK for security fixes
krishna916 24b01f0
style: format dependency audit plan
krishna916 986bd48
chore: pin patched brace expansion dependency
krishna916 d201070
chore: validate patched pnpm overrides
krishna916 9d8c9ca
fix: align MCPB runtime SDK version
krishna916 1cebb25
Address Relay doctor review feedback
krishna916 57a0ad3
Fix doctor cancellation and port parsing
krishna916 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "schemaVersion": 1, | ||
| "minimumPackageVersion": "0.1.0", | ||
| "mcpContractSchemaVersion": 1, | ||
| "migrationManifestVersion": 1, | ||
| "migrationCount": 4, | ||
| "skillMetadataVersion": 1, | ||
| "integrationTemplateVersion": 1 | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # Relay doctor | ||
|
|
||
| `relay doctor` inspects an installed Relay package without repairing it. The | ||
| default output is human-readable; `relay doctor --output json` writes one | ||
| schema-versioned JSON document for automation and support. | ||
|
|
||
| Exit codes are stable: | ||
|
|
||
| - `0`: no check failed. Warnings and skipped checks are allowed. | ||
| - `1`: at least one diagnostic check failed. | ||
| - `2`: the command or output option is invalid. | ||
|
|
||
| The report schema is version `1` and always contains these checks, in order: | ||
|
|
||
| 1. `runtime.version` | ||
| 2. `runtime.platform` | ||
| 3. `package.assets` | ||
| 4. `paths.resolution` | ||
| 5. `paths.access` | ||
| 6. `database.state` | ||
| 7. `database.integrity` | ||
| 8. `database.native-addon` | ||
| 9. `integrations.codex` | ||
| 10. `integrations.claude-code` | ||
| 11. `integrations.generic-mcp` | ||
| 12. `compatibility.assets` | ||
| 13. `mcp.handshake` | ||
| 14. `ui.loopback` | ||
|
|
||
| Each check is `healthy`, `warning`, `failure`, or `skipped` and includes a | ||
| stable code. Human output uses `[OK]`, `[WARN]`, `[FAIL]`, and `[SKIP]`. | ||
|
|
||
| ## Safety boundaries | ||
|
|
||
| Doctor does not migrate, repair, replace, truncate, or delete the configured | ||
| database. It opens an existing database read-only, checks its migration | ||
| ledger, and runs SQLite `quick_check` without exposing SQL or engine details. | ||
| It does not edit client configuration or Relay ownership metadata and does | ||
| not scan for unowned Codex, Claude Code, or generic MCP files. Only paths | ||
| approved by the distribution contract may appear in output. | ||
|
|
||
| MCP and UI probes run the installed command with a disposable temporary root, | ||
| an absolute temporary database, bounded output, deterministic timeouts, and | ||
| cleanup on success, failure, timeout, or interruption. No telemetry or remote | ||
| support bundle is produced. | ||
|
|
||
| ## Troubleshooting stable codes | ||
|
|
||
| - `runtime.version.*`, `runtime.platform.*`: use Node 24.x on a claimed | ||
| Windows x64, macOS arm64, or Linux x64/glibc runtime. | ||
| - `package.assets.*`, `compatibility.assets.*`: reinstall the package from a | ||
| complete tarball; do not copy source-checkout files into an installation. | ||
| - `paths.resolution.*`, `paths.access.*`: run `relay setup` with the intended | ||
| isolated paths and check directory permissions. | ||
| - `database.missing`: initialize the installation with `relay setup`. | ||
| - `database.pending-migrations`, `database.unknown-migrations`, or | ||
| `database.integrity-*`: preserve a backup and investigate the installation | ||
| or migration history; doctor does not perform recovery. | ||
| - `database.native-addon-load-failed`: reinstall dependencies/package for the | ||
| supported Node ABI and platform. | ||
| - `integrations.*`: inspect only the explicitly recorded ownership path and | ||
| use `relay setup --client ... --config-file <absolute-path>` when an entry | ||
| needs to be re-established. | ||
| - `mcp.*` and `ui.*`: retry from the installed package, confirm the package | ||
| assets are complete, and check that loopback startup is permitted. | ||
|
|
||
| ## Human verification matrix | ||
|
|
||
| Run each case against an isolated installed tarball, recording status/code, | ||
| exit code, database/config bytes and mtimes, temporary roots, child processes, | ||
| and whether any secret fixture value appeared: | ||
|
|
||
| 1. healthy setup; | ||
| 2. warning-only setup with no owned client integration; | ||
| 3. unsupported Node/platform simulation; | ||
| 4. missing immutable asset; | ||
| 5. unwritable mutable path; | ||
| 6. pending and corrupt database copies; | ||
| 7. invalid Codex and Claude owned entries; | ||
| 8. MCP timeout; | ||
| 9. UI startup failure; | ||
| 10. Ctrl+C during MCP and UI probes. | ||
|
|
||
| The configured database, ownership metadata, and client files must remain | ||
| byte-for-byte unchanged in every case. Temporary roots and child processes | ||
| must be gone before doctor exits. |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.