fix(doctor): open the project a lone doctor asks about - #2743
Merged
Merged
Conversation
On a fresh daemon the Doctor probe only looked the project server up in the open-server cache. With nothing else opening the project, the core answered doctor_report_owner_warming forever and doctor printed "mounting" until another request mounted it. The probe on both brokers (Unix engine and portable) now schedules the same admitted background open an MCP initialize schedules when no server is cached, and the doctor client polls a warming owner within its existing warm-up window like missing telemetry. The acceptance helper that re-ran doctor until it stopped reporting mounting is deleted. Stored index-path reads that cannot run (a reset-required or mounting store) are now warnings rather than issues: the store state is already reported, and an unrunnable diagnostic is not an issue. Fixes #2713
|
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.
Cause
Only the project owner publishes the canonical Doctor report. On both brokers (the Unix engine and the portable/Windows path), the Doctor probe only looked for the project server in the open-server cache (
cached_project_server/portable_cached_project_server). On a fresh daemon nothing had opened the project, so the probe answered "not ready". The core then serveddoctor_report_owner_warmingand never requested an open, sodoctorprinted "mounting" until some other request mounted the project (#2713). A single doctor run also returned on the first warming reply, so it could not have seen a report even if an open had started.Change
initializeschedules when no server is cached:schedule_project_server_warmuporschedule_portable_project_server_warmup, whoseinitialize_requestis now optional. Admission still goes throughensure_registered_project_route, so an unenrolled directory is refused as before. The probe's typed not-enrolled, warming, discovery-deferred and reset-required responses are unchanged.doctoruntil it stopped saying "mounting" (mounted_doctor_report) is deleted in favour of a single run.index.exclude.v1/index.include.v1over a reset-required or still-mounting store) is now a warning, not an issue. fix(config): report uncompilable stored index patterns #2728 counted it as an issue, which turned a pending reset into2 issue(s). The store state is already reported, and doctor's own rule is that a diagnostic that could not run is not an issue.Tests
typed_terminal_restart_acceptance::stale_sessions_store_reset::doctor_alone_on_a_fresh_daemon_opens_the_project_and_reports_findings. It inits a project, restarts the daemon, then runs onedoctor --json. On master it fails withleft: String("mounting") right: "observed", and it passes here (3/3 runs).stale_session_stores_refuse_sessions_only_until_their_scoped_reset,project_session_store_at_another_{lcm_schema,git_correlation}_version…,…workflow_schema_identity…) fail on current master at line 508 with2 issue(s)from the index-path reads, and pass here.Counts:
typed_terminal_restart_acceptance::: 11 passed, 0 failed. The CLI was built withtest-transport, so the commit-barrier tests run too.tracedecaylib: 775 passed, 0 failed.storage_suite multi_connection_test::(runs doctor): 2 passed.Built-CLI journey (isolated HOME, one scoped daemon)
The journey used the debug
tracedecaybinary, a fresh HOME and a git project, withtracedecay daemon runundersystemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=1G. Aftertracedecay init, I stopped the daemon, started a new one, and ran a single doctor with no other request:Checks
cargo clippy -p tracedecay --features test-helpers,test-transport --all-targets -- -D warnings: clean.cargo fmt --all -- --check: clean.--workspace --all-targets --target x86_64-pc-windows-gnu …): 0 errors. The warnings in the touched files are pre-existing unused imports on the import lines.ripwire --edit-check: both schedulers have 0 incompatible callers.--quality-delta=<merge-base>..HEADhas one gating row:run_doctor_jsonin this acceptance suite duplicatesdoctor_jsonintracedecay-cli'score_cli_suite. Both are single-shotdoctor --jsontest helpers in different packages' test targets, which cannot share a helper.Fixes #2713