refactor(desktop): move root diagnostics below AppShell #5892
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 474 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5892"
general
weight: 0.35
hqhq1025
Summary
Refs #4582 — M5, diagnostics and startup notices.
AppShell reached Desktop diagnostics directly in three places: the error toast's report action (
diagnostics.copyReport) and the previous-shutdown notice (takePreviousMainProcessInterruption/copyPreviousMainProcessInterruption), whose ref and effect lived inAppShellContent. Move both into afeatures/diagnosticsslice:DiagnosticReportToastProvideris the renderer's toast layer and builds the report action from the injectedcopyToastReportservice. AppShell supplies only the three labels, which stay in the shared shell catalog beside the Error Boundary and command-palette copy that use the same words.PreviousMainProcessInterruptionNoticeowns the read, the shown-once guard and the toast. It is mounted beside the always-mountedConversationLifecycleand still waits for appearance hydration. Its copy moves out ofshell-remaining-copy.tsunchanged.platform/desktop/create-diagnostics-services.tsis the only adapter, and feature-services composition is its only production importer. It forwards only the fields the toast carried, as AppShell did.AppShell loses its three diagnostics bridge paths (9 → 6), one
useEffect(hook gate 28 hooks / 43 → 42 call sites), oneuseRefand 262 non-trivia tokens. The renderer architecture ratchet rejects those bridge paths if they come back toapp-shell.tsx.Not in this PR: the Error Boundary's crash report, the command palette's manual report (
app-shell-command-actions.ts, which #5712 is rewriting) and About's manual report still call the bridge from legacy files. None of them runs in AppShell's render body.Verification
build:test+test:dist), including 8 new tests indiagnostics-owner.test.ts: the notice reads nothing beforeready, shows once and copies its report; shows nothing after a clean shutdown; a locale change while the read is pending shows one notice, in the current locale; error toasts offer the report and copy it through the injected service; a failed copy shows the supplied labels; the adapter forwards only the fields present and delegates the previous-run calls; each owner is mounted once and the adapter is the only Desktop path.readygate or the adapter's empty-field filtering each fails one of those tests; the restored implementation passes.typecheck(preload, main, renderer, storybook),lint,format:check, Knip (desktop, ui),check:asf-headers,check:locale-hygiene --base,windows:inventory,check:app-shell-hooks,check:renderer-architecture --base c838e1fa7 --strict-baseand the Astryx surface inventory (regenerated for the three new files) pass.rename-focus.spec.tsandzh-tw-locale.spec.tspass (2/2) on a localbuild, so the app boots with the new provider tree and survives a runtime locale switch. No Electron test exercises the report action or the notice; this PR adds none, pere2e/AGENTS.md.main-process-diagnostics.test.ts.AI use
Tool(s) and scope: Claude Opus 5.5 (in Claude Code) implemented this ownership move, its tests, documentation and validation under human direction. The commit carries
Generated-by: Claude Opus 5.5.Checklist
Does this PR entail a change in behavior?