Skip to content

Native app: show merge risk apart from the review's quality score - #342

Open
kentdebruin wants to merge 1 commit into
mainfrom
report-show-merge-risk-separately-from-quality
Open

kentdebruin wants to merge 1 commit into
mainfrom
report-show-merge-risk-separately-from-quality

Conversation

@kentdebruin

Copy link
Copy Markdown
Contributor

Ports the review-summary wire and UI changes from 47c0699 to the native Swift client (OS1 / OS1Mac).

Why

The server's osReview summary now carries risk (low/medium/high), recovery (minutes/hours/days/irreversible) and riskFactors beside confidence, which scores quality only. Models/Session.swift dropped all three and still described confidence as merge safety, so the workspace review row and the session card never showed risk.

What changed

  • Model (Session.swift): OsReviewSummary gains risk: Risk?, recovery: Recovery?, riskFactors: [String]? with a hand-written decoder. An unknown risk or recovery word drops to nil instead of failing the whole sessions list.
  • Workspace review row (WorkspaceReviewRows.swift): the agent row's second line becomes 4/5 · high risk · No findings. The band and the score keep the quality tone; only the risk word takes its own ink (red for high, yellow for medium, dim for low, faint when stale). ReviewRow.detail is a Text so one line can carry two inks and still read as one VoiceOver label. Logic lives in a pure AgentReviewDetail so it is testable. The review sheet header repeats both numbers.
  • Session card (SessionRowPreview.swift): a separate high risk fact on the strip via PrPreviewFacts.riskFact, with the same tones; the verdict phrase is unchanged.
  • Fixture: OS1_WORKSPACE_REVIEW_FIXTURE=1 renders the row at every level for scripts/capture-ios.ts; the PR-cards fixture now carries risk values.
  • Colours are the existing native status inks (greenInk/yellowInk/redInk, secondaryLabel/tertiaryLabel), which already hold contrast on both platform canvases in both appearances; no web colour values were copied.

Tests

  • SessionTests: decoding at low/medium/high, recovery and factors, an older server without the fields, an unknown word, and a stale review keeping its risk.
  • SessionRowPreviewTests: risk fact per level, absent risk, stale risk goes faint, risk never enters the verdict phrase.
  • AgentReviewDetailTests (new): line wording and inks per level, absent, stale, no score, and a running pass.

Verification

  • xcodebuild build for OS1 (iOS Simulator) and OS1Mac; xcodebuild test on OS1Mac for the six related suites: 120 tests, 0 failures.
  • bun run check green.
  • Simulator captures (iPhone 17 Pro, light and dark) of the workspace agent row at each risk level and the session cards are attached in the OS session.

Started by Kent de Bruin in this OS session

The server's osReview summary now carries risk (low/medium/high), recovery
(minutes/hours/days/irreversible) and riskFactors beside the 1-5 confidence,
which scores quality only. The Swift model dropped all three and its comment
still called confidence "how safe this is to merge".

OsReviewSummary gains the three fields with a hand-written decoder: a risk or
recovery word this build does not know drops to nil instead of failing the
whole sessions list. Both native review surfaces say risk as its own axis, the
way the web sidebar does: the workspace agent row puts "high risk" between the
score and the state in its own ink (the band stays quality), and the session
card's fact strip adds a separate "high risk" fact. High and medium take the
existing red and yellow status inks, low goes dim, and a stale reading goes
faint with the verdict it belongs to. The review sheet's header repeats the
two numbers. A DEBUG fixture (OS1_WORKSPACE_REVIEW_FIXTURE) renders the row at
every level for the screenshot harness.

Tests cover decoding at each level, absent and unknown words, stale readings,
and the wording and inks of both presentations.

Co-authored-by: Kent de Bruin <[email protected]>
@open-session-os-tella-dev

open-session-os-tella-dev Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🤖 OS review · approve · quality 5/5 · risk low

Safe to merge. No blocking correctness, compatibility, or security issues found.

🟢 Risk low · recovery in minutes
Additive Swift decoding and UI labels are stateless; reverting restores subsequent app rendering.

Reviewed 8351afe · GPT-5.6 Sol · open session · labels: os-auto-fix fix and push · os-adversarial deeper pass · os-simplify cleanup

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
opensession Ready Ready Preview Sep 10, 2026 7:58am UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant