← Back to Pull requests

feat(ios): drafts keep the relation the server supplied, and Ember's its mark (42003c1) #1382

Open
unknown opened this pull request with 239 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 03, 2026 15:15 UTC
Author

What

The first of four PRs for task 42003(c) (REQ-IOS-026, ios_draft.allium NewerServerRelationIsStored). It is the data the read-only blocks will need. There is no UI change.

  • Relation: a draft now keeps the ProductConversation the server last placed its row in, and which response said so (list, product_history; lookup comes in c2).

  • - Lists: every list the app applies records the relations it supplies, whether from a refresh (ConversationListStore.refresh) or a reconciliation (applyExternal), on every non-empty draft, open or only stored.
    - Product History: each History the app loads does the same for its segments' rows.
    - What counts: only server-supplied identities, as Conversation.serverIdentity and rowsPlaced(by:) define them. A row id standing in for one is never recorded. A newer relation replaces the stored one, and a list that omits a row leaves its relation as it was.
  • Coordinator mark: Ember's draft is marked when Ember's row is known, so later PRs can tell it apart without a lookup.

  • Stored shape: both are additive to the stored draft. Drafts saved before read as having no relation and no mark, which is what they had.
  • Follow-ups, each stacked on this one: c2 the lookup by row id, c3 the blocks above the composer and in History, c4 other rows' queue entries.

    Tests

  • DraftStoreTests (Catalyst):

  • - a relation is kept with its source, replaced by a newer one, and kept when a list omits the row;
    - a stored draft that is not open gets its relation too;
    - the Coordinator mark is kept, and an older file reads as unmarked.
  • ReconciliationIdentityTests.testAListGivesADraftItsRelation: a reconciled list gives a stored draft its relation. It fails without the list hooks.

  • Not covered by a test: the Product History path and the Coordinator marking in AppModel.
  • 🤖 Generated with Claude Code

    Diff: 239 lines (+179 / -60) across 2 files Reviewer: scottopell Review duration: 2590m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 239 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.328
    Real PR Conversation Timeline
    1 comments
    "Review active on #1382"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.9% · Safe to merge
    19.9%