refactor(desktop): move Composer staging into a persistent owner #5868
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 489 lines diff across 6 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.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5868"
general
weight: 0.35
hqhq1025
Summary
Refs #4582 — M3 / D, first slice.
Attachment, directory-reference and quote staging currently live in AppShell, so local staging updates invalidate the shell and send callbacks receive render-bound state. Move their controller into a persistent
ComposerStagingProvider, with actual Composer, transcript annotation and session-reference readers below it. AppShell keeps only stable commands; the controller and context/binding modules are sealed by the architecture guards. The attachment service is injected through the Desktop adapter. The staging readers compose under the Conversation publication/observation owner introduced in #5869; transcript state remains private to that owner.Submission captures the original draft before awaiting. Cleanup remains bound to that draft and directory Host. The public snapshot exposes only operations consumed in production; recovery can add restoration when its later slice defines that ownership. Accepted sends remove only captured quotes, preserving quotes added or edited during delivery; failed sends retain staging. The Composer input stays mounted across staging, section and Session changes. AppShell drops from 44 to 43 stateful hook calls and removes its staging-service bridge access.
Readiness, revision-draft state, send-pending state and delivery recovery remain later M3 slices. This preserves current-main revision/queue behavior; it does not implement the product changes in #5058 or #5274. Those open PRs overlap the submit/quote hooks and will need integration through the captured command boundary.
Verification
d7dffca98c5b9f878ef9b71b4dcda4122e03f1c6and AppShell hook gate pass.npm run build,npm run typecheck,npm run lint,npm run format:check, Desktop/UI Knip, ASF headers, Astryx inventory and Windows inventory pass.19d48183: UI 696/696 and full Storybook browser smoke: 441 stories / 481 theme renders, including all Slash Menu and Shared Session Guestplayassertions; the mention-story fixtures mount the persistent staging owner. The existing runner retriedproduct-workhub--retry-while-work-filteredafter one failure under four-way concurrency; it passed alone. No retry policy or timeout was changed.@reference submission, and transcript pointer capture outside the native window). The directory chooser return is mocked; no manual OS dialog or real-model acceptance is claimed. No intended visual redesign.AI use
Tool(s) and scope: OpenAI Codex implemented this ownership migration, tests, documentation and validation under human direction. The commit includes
Generated-by: OpenAI Codex. This PR awaits independent human review.Checklist
Does this PR entail a change in behavior?