AI System DesignAI System Design FundamentalsModule 11 — Architecture contracts and integration

Designing AI Interfaces for Pending, Uncertain, Corrected and Superseded Results

Question 29 of 47 · Updated

On this page

Present AI results as versioned, provisional or finalized artifacts with explicit lifecycle and evidence states, rather than as text that becomes trustworthy when a spinner disappears. Let users see what is happening, what is known, what remains unchecked, whether a result is current, what changed, and which actions are available. Maintain an authoritative task and result history on the server. The client consumes ordered, scoped updates, prevents older requests from replacing newer ones, and never treats cancellation, a partial stream, or a visually confident answer as proof of a completed or authorized operation.

How would you design a user interface that communicates pending, uncertain, corrected and superseded AI results?

ASD-088 | Module 11 — Architecture contracts and integration | Learning order 16. ASD-004 covers execution and delivery modes, ASD-081 specifies typed predictions and validity, ASD-084 reconciles multiple freshness windows, and ASD-087 addresses competing model outputs. The published RAG deadline and partial-result lesson explains correctness-aware degradation at the backend. Here the distinct concern is the user-visible lifecycle and interaction contract for a single logical result surface: explicit status, partial rendering, uncertainty, result replacement, accessible notifications, cancellation races, actionable history and understanding what may safely be used. The pending interactive streaming copilot case addresses an application-specific interruption and background processing architecture; the pending batch-job service covers durable per-record delivery; the sign-language and chronological case-history lessons have their own domain-specific correction requirements. This lesson defines reusable client-side behavior across them without repeating their backend architectures.

All example values, product designs, latency budgets and evaluation targets below are hypothetical. The local reducer is a tested reference for selected sequential transitions, not a real browser or distributed service.

1. Model the user's obligation and mental model#

Imagine a research workspace that generates an evidence-backed report. A user submits a question, sees extracted facts as retrieval completes, receives a generated draft, and later receives a checked report. A source correction subsequently invalidates a claim. The system issues a corrected report. Meanwhile, another request may have been started or the user may have left the page.

A naive UI stores a single string plus isLoading. It appends whatever tokens arrive, replaces the string on every response, and sets loading to false when a connection ends. This hides important distinctions:

  • Submission may have been locally initiated but not durably accepted.
  • Work may be queued, running, blocked on evidence or ready for review.
  • A displayed fragment may be provisional, unsupported or intentionally incomplete.
  • A complete artifact may be uncertain or explicitly abstained.
  • A final artifact may be stale, withdrawn, corrected or superseded.
  • A cancellation request may race with server-side completion.
  • A network disconnect is not proof the job failed, stopped or succeeded.

Design around a logical intent and a user-visible promise, not transport state. In a durable-job product, submission acknowledgment means accepted under the documented contract; the final report arrives later. In a nondurable interactive stream, disconnection may end the attempt and require a new request. The interface must accurately reflect which contract applies.

A user needs to know: What did I request? Is this the result for that request? Is it ready, provisional or unavailable? What uncertainty or missing evidence matters? Has it changed since I reviewed it? What can I do next, and what action has actually happened?

2. Use multiple state dimensions rather than a single misleading status#

A single enum such as LOADING, SUCCESS, ERROR cannot represent execution, knowledge quality and currentness independently.

DimensionIllustrative valuesSource of truth
Submissionsubmitting, accepted, rejected, outcome unknownDurable admission or explicit response
Executionqueued, running, waiting, completed, failed, cancelledAuthoritative task state
Deliveryno content, partial, complete, disconnected, resyncingClient subscription and cursor plus server snapshot
Evidenceprovisional, supported under contract, uncertain, abstained, invalidVersioned result and evaluator
Currentnesscurrent, expired, corrected, superseded, withdrawnAuthoritative result lineage and invalidations
Interactionidle, cancel requested, review pending, action submittedUI intent and server receipts

These dimensions are related but not interchangeable. A completed job can have an abstained result. A partial result may be technically useful for exploration but prohibited for publication. A complete result can be uncertain. A network reconnect can happen after the job has completed. A previously completed result can remain visible as history while a replacement is pending. A cancellation request changes local interaction state immediately, but not authoritative execution state.

Define allowed combinations through discriminated types or invariants. A completed result must have an immutable result identity, except where the domain explicitly distinguishes a completed job with no artifact. An abstention must not render missing estimates as zero. A withdrawn result must not remain actionable. The absence of a progress estimate must not default to 100%.

Model state by logical result slot (e.g. report for a specific query), not by a global loading Boolean. Maintain a stable identity for each requested task and each issued artifact. The user can switch between jobs without one response overwriting another. A new request may be active while the old result remains in a clearly labeled history panel.

Loading diagram…

This is a task-lifecycle projection. Cancellation requested is a separate interaction flag, and correction/supersession are separate artifact-lifecycle transitions after completion. Do not invent a terminal task transition because a new correction has arrived.

3. Architecture: authoritative results, observable delivery, client projection#

Loading diagram…

The server owns acceptance, task transitions, result identity and lineage, and any external effect receipt. The UI owns active selection, transient interaction state, rendering and accessibility behavior. The update channel can use polling, SSE or WebSocket according to the existing execution contract. It is not necessarily the source of truth: after a missed event, fetch an authorized consistent snapshot with its associated update position. The server and resource owner must enforce current authorization and eligibility for protected operations; the client's disabled button is only a convenience.

Use an explicit contract for result events. For example:

JSON
{ "schema_version": "result-update/v1", "scope_ref": "tenant-a/workspace-7", "job_id": "job-42", "sequence": 18, "kind": "result.corrected", "result_id": "report-r2", "supersedes": "report-r1", "reason_code": "source_correction", "artifact_ref": "artifact-opaque-r2", "evidence_status": "supported_with_limitations", "issued_at": "2026-01-15T10:05:00Z", "provenance_ref": "provenance-r2" }

The example is illustrative, not a full wire schema. The authoritative producer assigns sequence and identifiers. Bind job ID, tenant/resource scope and stream epoch (if sequence numbers reset) to the update contract. A tenant field in a payload is not authentication. Use authorized API access and scoped artifact retrieval. An update should never contain an unrestricted storage URL, secrets or private source data unnecessary for the display.

An artifact ID denotes immutable issued content and its provenance. A logical result slot has a mutable current pointer, updated conditionally under the agreed ownership contract. An event ID identifies an immutable update; a per-stream sequence gives ordering within the defined scope. These are distinct. Job attempts, transport connections and browser renders are not new logical tasks unless the product explicitly defines them that way.

4. Pending and partial results: progress without false completion#

Use progress that conveys meaningful work, not animation pretending to be a measurement.

Server evidenceHonest UI copyAppropriate interaction
Submission awaiting acknowledgmentSubmitting requestResolve status before duplicate submission
Durable acceptance, queuedAccepted; waiting for processingShow job ID and allowed cancel
No known fractionChecking source documents…Indeterminate indicator
Measurable bounded work7 of 10 files processedShow completed count and remaining items
Waiting on mandatory inputWaiting for source verificationExplain missing dependency or next step
Partial generated textDraft; not fully checkedPreview only within permitted scope
Full terminal artifactReport ready, with evidence limitations if anyReview, export or propose action only if eligible
Connection lostConnection interrupted; checking job statusReconnect or fetch status

Never fake percentage completion for an unbounded LLM output. A queue position may not equal remaining time under priorities and changing workloads. If a duration estimate is useful, identify its basis and uncertainty; do not promise exact completion. A backend completing 70% of token generation does not mean 70% of factual claims are validated.

Progressive rendering can reduce time to first useful information. Choose independently valid units such as validated fields, source cards or paragraphs explicitly labeled draft. Render a provisional result with separate status and prevent high-impact use until the required checks pass. Some content should be withheld until validation (for example, sensitive data requiring access checks or a consequential recommendation requiring complete evidence). A transport stream that emitted text cannot guarantee the user did not see it, even if the final UI later removes it. Validate before exposure where that risk matters.

For optional sources, display which required parts were verified and which optional parts were unavailable. For a required missing source, present the appropriate abstention or incomplete state, not a polished definitive answer. An unfinished citation marker must not look like a verified source. Partial display is a product decision, not an obligation to render every generated token.

Avoid using an old result as if it answered the new request. A useful transition is "Generating revised report; showing previous version from 10:00" with clearly separated content. If the earlier result has been invalidated, remove its actionability immediately rather than keep it apparently current until a replacement arrives.

5. Communicate uncertainty without overclaiming#

Distinguish statistical uncertainty, limitations of evidence, model disagreement and technical incompleteness. ASD-081 defines the meaning of probabilities and predictive intervals, and ASD-087 establishes when model reconciliation is justified. The UI must faithfully map those contracts to understandable states rather than infer uncertainty from fluent prose or average generic confidence scores.

For a delivery prediction with median arrival 10:20 and a nominal 90% predictive interval 10:12–10:35, show the point and range, the target and the observation/issue time. Explain that the interval is an estimate under the approved evaluation conditions, not a guarantee for this delivery. Expiry or invalidation is a different property. Do not represent the probability of delivery by a specific time as "90% confident" unless that is the actual forecast.

For generated answers, distinguish source-supported statements, assumptions, missing evidence and explicitly unresolved claims. Do not attach numerical probabilities unless the product has a defensible calibrated measure for the claim. Source count, token probability, evaluator agreement and factual accuracy are different quantities. If the result contract provides only qualitative limitations, show them plainly.

StateUseful wordingAvoid
Uncertain estimateEstimated range: 10:12–10:35; traffic may changeGuaranteed by 10:35
Evidence unavailableCould not check the supplier's latest termsNo exceptions exist
AbstentionNot enough evidence to answer reliablyA fabricated low score or blank success card
Disagreement unresolvedThe models disagree; review requestedMajority vote presented as truth
Expired predictionLast estimate at 10:00; refresh requiredCurrent estimate with no time label
Checked artifact with caveatsChecked against sources A and B; limitation X remainsVerified by AI as a universal assurance

Place important limitations near the claim or action that depends on them. A tooltip hidden behind a generic info icon is insufficient for a decision-blocking limitation. Progressive disclosure can provide details and provenance without overwhelming every user. Use domain terminology the intended user understands, with units and concrete next steps. For high-consequence actions, use explicit review or hold, not only a colored uncertainty indicator.

6. Corrections, supersession and withdrawal#

Use distinct lineage semantics:

  • A correction repairs a material error in a previously issued result, for the defined task or context.
  • A supersession replaces a result with a newer approved artifact, for example because fresh observations or a new context are available; the old result may have been valid when issued.
  • A withdrawal marks an artifact no longer eligible for use and may have no replacement.
  • A user edit creates a separate revision or annotation with its own actor and provenance, not a rewrite of what the model originally said.

Do not edit historical output silently. Preserve original identity and authorized history, link replacement to predecessor, and give the user an exact reason and material diff. A correction can itself be superseded or corrected. Prevent lineage cycles and missing predecessors. A current-pointer update must be fenced by the expected predecessor or generation; two concurrent replacement proposals must not both claim currentness without resolution.

Loading diagram…

If a report originally listed a contractual renewal date as June 1 and a verified correction establishes July 1, display the specific changed field, old and new value where retention permits, reason, issue time and provenance. Do not merely replace the displayed date and claim the user always saw July 1. If the user exported r1, r2 cannot update a file already downloaded. Identify affected exports or approvals via receipts where supported and notify authorized users appropriately. An irreversible external action may require separately governed remediation, not just UI revision.

If a historical result contains private data now subject to deletion or revoked permission, preserving history does not justify continuing access. Apply current permissions and retention; show a minimal tombstone or unavailable-history notice where authorized. Do not expose restricted text through a diff, export or browser cache.

7. Worked user journey: revision-aware reporting#

Assume a fictional research product. A user requests a report based on dataset revision 17.

TimeEventVisible experience
10:00:00Request accepted as job-42Report accepted; processing
10:00:04Validated source list availableSources found; draft still pending
10:00:12Partial summaryDraft, not yet checked
10:00:21Report r1 committedReport ready, with explicit limitation
10:04:00Source error discoveredr1 withdrawn for affected use; correction pending
10:05:00Corrected r2 publishedCorrection notice, exact changed fields
10:07:00New data revision 18 availableNewer result r3; r2 remains history if permitted

If the user approved an export of r1 at 10:01, that approval is bound to r1 and its exact context. It does not silently authorize r2 or r3. If the action contract requires current evidence, a subsequent action must revalidate or request fresh approval. A server-side hold is required even if an old browser tab still displays an enabled button. The UI can explain "The report changed since you reviewed it. Review the corrected version before continuing." A new result is not a change to past receipts.

A second example: a structured extraction job processes ten invoices. Seven validated entries can be visible with status per invoice; three remain pending. An optional field may be unavailable without blocking an unrelated validated entry. An aggregate total that depends on all ten must not appear as the final total. If the product allows a provisional subtotal, label it "Subtotal for 7 of 10 validated invoices" and prevent actions that require the complete dataset. When a later correction affects invoice 4, update the aggregate as a new artifact with lineage.

8. Races, stale responses and resynchronization#

A common frontend race arises when request A starts, request B starts after the user changes a filter, B finishes first, then A finishes last. An unconditional setResult(A) overwrites the current view with the wrong result. Network cancellation can reduce wasted work but is not sufficient to prevent the race: A may already have committed or a callback may already be scheduled.

Use a logical active-request identity and a server-assigned scoped update cursor. A response handler checks the active job/context/selection before modifying the current slot. For event-driven updates use a defined stream epoch and sequence; apply contiguous deltas in order, ignore authenticated duplicates of already applied updates, and resynchronize on gaps or invalid transitions. For complete snapshots, a later version can replace the earlier projection if the server contract explicitly permits it. Do not skip a missing delta simply because a higher sequence arrived.

Loading diagram…

The snapshot and resume position must correspond to the same committed state. A common strategy is a server snapshot with watermark, then replay from that position; buffer incoming updates or use an atomic subscription protocol to avoid the gap between snapshot and subscription. SSE reconnection and Last-Event-ID are mechanisms, not a guarantee of durable replay: the server must actually retain and honor the cursor. If retention has expired, return a clear snapshot-required response. If snapshots cannot be obtained, retain only permitted historical data and mark current status unknown.

Use a reducer or equivalent state machine shared by the render and interaction layer. In React, functional state updates or a reducer can avoid stale closure bugs; clean up old subscriptions in effect cleanup and guard request identities independently. Do not bind task correctness to component mount lifetime. A tab closing may end local delivery without terminating an accepted durable job. Multi-tab state synchronization can notify other tabs of a changed pointer but server authorization and current state remain authoritative.

The client must not trust arbitrary injected events. Validate transport identity, authorization, schema, version, size, scope and lineage at the appropriate boundary. In production retain canonical event identity or digest to detect same-ID/different-content collisions; simple sequence ignoring cannot detect all conflicts.

9. Cancellation and retry: display intent separately from outcome#

"Stop generating" may mean stop rendering, request cancellation of execution, or cancel an entire durable workflow. Clarify the product's actual promise. Aborting a fetch or closing a stream prevents some local work; it does not prove remote inference stopped or committed effects were undone.

A durable cancellation request has its own status. While awaiting confirmation, display Cancel requested. If the server confirms cancellation before commitment, display Cancelled. If the result commits first, display Completed before cancellation and show the actual result, subject to policy. If the cancellation response is lost, resolve authoritative job status rather than assume cancellation succeeded.

ScenarioCorrect interaction
Local submission response lostResolve existing idempotency key or task receipt
User cancels while queuedRequest cancellation; wait for authoritative terminal result
Final result wins the raceShow completion, explain cancellation did not stop it
Disconnect during generationReconnect/status lookup for durable work; show unknown meanwhile
Terminal failure with permitted retryRetry as defined by existing logical intent or new attempt
User requests a different questionNew logical task and active selection; do not overwrite history

Retries must not accidentally start duplicate chargeable or side-effecting jobs. The client sends a stable operation key for the same intent and a new identity for a deliberately new task. The API defines idempotency and receipt retention (ASD-004). If an effect already happened, use the domain's remediation contract; do not label a cosmetic UI reset as undo.

A failure after useful partial content is different from a complete abstention. Preserve safely displayable provisional content if the product permits it and mark it incomplete. Clear or withhold unsupported content when required. The reference reducer below chooses to clear partial text on confirmed failure/cancellation; that is an explicit conservative fixture policy, not the only acceptable product behavior.

10. Tested implementation: a scoped result-state reducer#

The following standard-library Python model represents the pure update logic that a TypeScript reducer or other UI state machine could implement. A View is scoped to one selected logical job. Events are assumed to have already passed authenticated decoding and structural validation, with a contiguous sequence beginning at one. Partial updates contain complete replacement draft snapshots, not append-only token deltas. The authoritative server chooses terminal outcomes. Requesting cancellation sets a local interaction flag rather than a terminal state.

PYTHON
from dataclasses import dataclass, replace @dataclass(frozen=True) class View: scope: str job: str seq: int = 0 status: str = 'pending' result: str | None = None body: str = '' uncertain: bool = False cancel_requested: bool = False history: tuple[str, ...] = () @dataclass(frozen=True) class Event: scope: str job: str seq: int kind: str result: str | None = None body: str = '' uncertain: bool = False supersedes: str | None = None def apply(v, e): if (e.scope, e.job) != (v.scope, v.job): return v, 'IGNORED' if e.seq <= v.seq: return v, 'IGNORED' if e.seq != v.seq + 1: return v, 'RESYNC' active = v.status in {'pending', 'partial'} if e.kind == 'partial' and active and e.result is None: return replace(v, seq=e.seq, status='partial', body=e.body), 'APPLIED' if e.kind in {'final', 'abstained'} and active and e.result: return replace(v, seq=e.seq, status=e.kind, result=e.result, body=e.body, uncertain=e.uncertain, cancel_requested=False), 'APPLIED' if e.kind in {'cancelled', 'failed'} and active: return replace(v, seq=e.seq, status=e.kind, body='', cancel_requested=False), 'APPLIED' if (e.kind in {'corrected', 'superseded'} and v.status in {'final', 'abstained', 'corrected', 'superseded'} and e.supersedes == v.result and e.result and e.result not in (*v.history, v.result)): return replace(v, seq=e.seq, status=e.kind, result=e.result, body=e.body, uncertain=e.uncertain, history=(*v.history, v.result)), 'APPLIED' return v, 'RESYNC' def request_cancel(v): if v.status in {'pending', 'partial'}: return replace(v, cancel_requested=True) return v v = View('tenant-a', 'job-1') p = Event(v.scope, v.job, 1, 'partial', body='Draft') f = Event(v.scope, v.job, 2, 'final', 'r1', 'Answer', True) c = Event(v.scope, v.job, 3, 'corrected', 'r2', 'Correction', supersedes='r1') s = Event(v.scope, v.job, 4, 'superseded', 'r3', 'New evidence', supersedes='r2') w, status = apply(v, p) assert status == 'APPLIED' and w.status == 'partial' assert apply(w, p) == (w, 'IGNORED') assert apply(v, f) == (v, 'RESYNC') assert apply(w, replace(f, scope='tenant-b')) == (w, 'IGNORED') assert apply(w, replace(f, job='job-2')) == (w, 'IGNORED') assert request_cancel(w).cancel_requested x, status = apply(request_cancel(w), f) assert status == 'APPLIED' and x.status == 'final' and not x.cancel_requested assert x.uncertain and x.result == 'r1' assert apply(x, replace(p, seq=3)) == (x, 'RESYNC') assert apply(x, replace(c, supersedes='wrong')) == (x, 'RESYNC') y, status = apply(x, c) assert status == 'APPLIED' and y.history == ('r1',) and y.result == 'r2' assert apply(y, f) == (y, 'IGNORED') z, status = apply(y, s) assert status == 'APPLIED' and z.history == ('r1', 'r2') assert apply(z, replace(s, seq=5, supersedes='r3', result='r1')) == (z, 'RESYNC') assert request_cancel(z) == z k, status = apply(request_cancel(w), replace(f, kind='cancelled', result=None)) assert status == 'APPLIED' and k.status == 'cancelled' and not k.body assert apply(k, replace(f, seq=3)) == (k, 'RESYNC') assert apply(w, replace(f, kind='abstained'))[0].status == 'abstained' assert apply(w, replace(f, kind='failed', result=None))[0].status == 'failed' assert apply(View('tenant-a', 'job-2'), p)[1] == 'IGNORED' print('20 checks passed')

Observed local execution on Python 3.13.5:

20 checks passed

Twenty assertions cover the pending-to-partial transition, replayed update, missing sequence, cross-scope and cross-job rejection, local cancellation intent, final completion winning the cancellation race, uncertainty surviving finalization, rejection of late partial updates, mismatched predecessor, correction and supersession history, prevention of old artifact reuse in the lineage, cancellation after completion, confirmed cancellation, rejection of a final result after confirmed cancellation, abstention, failure and delayed event from a previously selected job.

This example uses status for a compact teaching projection that also labels a replacement as corrected or superseded. A production implementation should keep the current artifact's lifecycle separate from task execution; the older artifact is the superseded one while the new artifact is current. The fixture retains previous IDs, not the actual history payloads; authorized retrieval is separate. It does not model withdrawal without replacement, expiry, transport disconnect, progress fractions, notifications, actual event identity collisions, multiple jobs, malformed wire fields, snapshot recovery or remote cancellation. RESYNC is a request for recovery, not an implementation of that recovery. Its trusted inputs must not come directly from arbitrary client JSON. A production reducer should distinguish already authenticated exact duplicates from same-sequence conflicting data, validate artifact references and status payloads, and associate snapshot application with the same active view generation. It does not authenticate an actor, enforce a business action, run a browser, or establish real concurrency correctness. No server operations are executed.

The reducer processes each event in constant work apart from lineage membership and tuple copying on replacements, which are O(h) in historical ID count h. Bound client-side history or use a suitable persistent/indexed representation for long-lived histories while retaining durable server lineage. A complete UI also needs component rendering, transport cleanup, focus behavior and accessible announcement tests.

11. Accessibility and interaction design#

Use text labels plus iconography where useful; never communicate pending, failed, uncertain or corrected states by color alone. Ensure sufficient contrast, meaningful button names, keyboard navigation and visible focus. Use the actual semantic control (button, progress indicator, heading, list) rather than a clickable div without keyboard behavior.

WCAG 2.2 status-message guidance and WAI-ARIA provide mechanisms for conveying updates without forcing focus. Use a polite status region for meaningful progress and completion, with concise text such as "Report ready; one source was unavailable." An indeterminate progress bar must not claim an invented numeric value. When progress is measurable, provide the correct current and maximum values and an accessible label. For a significant blocking correction or error, announce it appropriately, reserving assertive interruption for events that genuinely need it. Avoid announcing every token, animation frame or countdown second; throttle and group meaningful changes.

Do not move focus whenever a new paragraph streams or a card status changes. Preserve reading position and user scroll; if the user is following the end of the stream, allow appropriate autoscroll, otherwise offer a new-content indication. Respect reduced-motion preferences. Make correction history and changed fields readable without relying on strikethrough or color alone. Keep the original and revised content explicitly labeled. If a dialog requires acknowledgment, manage focus and allow dismissal according to the actual risk and accessibility requirements. Do not use a modal merely because the model is uncertain.

Test at keyboard-only navigation, screen-reader use, zoom, narrow layouts, reduced motion, long translations, right-to-left locales and low connectivity. Automated accessibility tools can find some issues but cannot establish whether an announcement sequence is understandable or whether the user can distinguish a draft from a final result. Include actual assistive technology and representative user evaluation.

12. Notification design and user trust#

A durable job can finish while a user is away. Offer in-app status and an approved opt-in delivery mechanism (for example email or push) where appropriate. Notification content should be scoped to authorized recipients and disclose only information permitted on the channel. An email subject or lock-screen preview can leak private content. Prefer a safe summary and an authenticated link to the relevant job/version. Recheck access when the notification is opened.

Corrections deserve severity-based handling. A trivial formatting improvement can be shown in the history, whereas a material error affecting a prior decision may require a persistent in-app notice, a notification to authorized affected users and recorded acknowledgment according to the domain policy. Do not notify every minor token or revision. Deduplicate logical notifications by recipient, channel, result revision and notice type. A notification retry is not a new correction. Avoid promising that notification delivery proves the user read or understood it.

Trust comes from accurate expectations and recoverability rather than reassuring visual polish. Show what the AI can and cannot do, provide ways to inspect evidence, correct inputs, give feedback or seek review, and avoid presenting unresolved results as facts. A prominent "AI verified" badge is not proof. User edits and feedback should have explicit acknowledgment and provenance; feedback alone must not silently retrain the model or change an authoritative result.

Use separate records for notification intent, actual delivery/acknowledgment and the result revision. A correction notice that arrives after a newer version should link to the relevant historical event and current authorized state, not make the older version current again. Handle multiple updates with a concise grouped notification and exact history where appropriate.

13. Performance and operational scale#

Progress delivery can overwhelm browsers and servers when each token triggers a render or a durable write. Batch UI updates within a bounded display interval, coalesce intermediate draft snapshots where contract permits, and prioritize terminal, invalidation and correction events. Never coalesce away required deltas or critical status transitions without an equivalent complete snapshot. Keep a stable reducer cursor separate from the visual rendering frequency.

Suppose 2,000 active streams each generate 25 incremental updates/s. Offered update deliveries are 50,000/s for one subscriber per stream. Batching compatible updates into one visual refresh per 100 ms bounds visual updates to at most 20,000/s across all streams in this illustrative case, a 60% reduction versus rendering every update, assuming all streams remain active and batching preserves semantics. It does not automatically reduce upstream generation, broker traffic or network messages; server-side batching is a separate design. Do not delay an urgent invalidation behind an ordinary token batch.

For a polling alternative, 10,000 active clients polling every five seconds offer 2,000 requests/s before retries. If authorized job updates are rare, an event subscription or adaptive polling may reduce redundant requests; a subscription introduces connection and replay costs and must tolerate reconnection storms. Use jitter and capped backoff for retries, not synchronized polling on every browser focus. Always recheck current eligibility after sleep/resume, network recovery, tenant switch and before protected use.

Measure time from submission to acknowledged acceptance, first useful provisional content, final eligible result and correction-visible state separately. Track queue age and reconnect delay as distinct sources. A fast first token with a slow or missing validated final result is not sufficient product success.

14. Production validation and measurable outcomes#

Test the interface and server contract together, not only the model's outputs.

Test familyRepresentative checks
State machineAllowed transitions, unknown event type, final with caveat, abstention, withdrawal
OrderingA/B request race, duplicate, sequence gaps, stale snapshot, wrong job/scope
RecoveryDisconnect mid-stream, cursor expired, consistent snapshot, reload and multi-tab
CancellationCancel wins, commit wins, lost acknowledgment, duplicate request
CorrectionsPredecessor mismatch, lineage cycle, material diff, supersession and historical access
Action eligibilityOld approval, expired result, mandatory hold, revoked permission
Partial renderingOptional versus required evidence, invalid citation, incomplete total
AccessibilityMeaningful live-region announcements, keyboard, focus, reduced motion
SecurityForged scope, malicious generated markup, unauthorized history, cache isolation
ScaleBurst updates, render backpressure, reconnect storm and notification dedup

Use deterministic event sequences and randomized interleavings in reducer tests. A property worth checking is that an accepted current version never regresses due to an older event, except via an explicitly authorized new corrective artifact. Test the actual server transition and client resync protocol with delayed and duplicated network messages, browser automation, reloads and multiple sessions. Inject faults in an isolated environment: lost final event, delayed cancellation, malformed payload and dropped invalidation. Confirm the server rejects stale or unauthorized actions even if the UI is intentionally bypassed.

Render generated content safely. Treat HTML, Markdown links, file previews and structured data as untrusted; sanitize or use an appropriately restricted renderer, validate link destinations and enforce content security and access policy. No generated instruction should manipulate the application's state machine or trigger privileged controls. Test actual rendering and browser security, not only strings in a reducer fixture.

Monitor outcome metrics:

SignalPurpose
Time to durable acceptance / first useful content / final eligible resultSeparate responsiveness from actual completion
Unknown or stuck task rateDetect lost status and reconciliation issues
Stale updates ignored, sequence gaps and resync successDiagnose delivery and race conditions
Correction propagation delay and stale-action rejectionsBound exposure to invalid results
Uncertainty and abstention comprehensionCheck user understanding, not just clicks
Duplicate submission, cancellation disposition and orphaned jobsMeasure control reliability
Notification delivery, duplicate and acknowledgment rateCheck correction communication
Task success, review burden and accessibility findingsValidate the real interaction

Evaluate comprehension with realistic tasks: can users identify the current version, recognize an incomplete result, distinguish a correction from new evidence and choose the correct next step? A usability test might ask participants to review a report while a correction arrives, or to cancel a job whose final result races with their action. Measure correct interpretation and harmful reliance, not merely preference for visual appearance or increased click-through. Establish representative acceptance criteria with actual product and domain owners; do not extrapolate a small usability sample as universal behavior.

Use privacy-safe event telemetry, immutable result IDs and scoped provenance. Keep raw prompts, private content and sensitive notification payloads out of routine logs. A user switching tenant or losing permission must not see an old artifact during hydration, offline restore or reconnect.

15. Trade-offs and interview-ready answer#

Streaming increases responsiveness but can expose unverified content and complicate accessible reading, correction and replay. Holding content until checked improves control at the cost of perceived latency. A durable task history improves recovery but adds retention and privacy obligations. Immediate updates can interrupt a user who is reading; batching improves usability but should not defer critical invalidation. Strict version checks can require additional review, but prevent stale approval and silent data changes. A simple status enum is easy to implement, while separate execution, evidence and currentness dimensions avoid misleading state at the cost of explicit invariants.

In an interview, I would first define the user-visible contract for acceptance, progress, partial results, terminal outcomes and artifact currentness. I would keep authoritative task state and immutable versioned artifacts on the server, using a client projection with explicit lifecycle and separate evidence and interaction states. Pending work would show meaningful progress or an honest indeterminate indicator. Partial output would be labeled provisional and rendered only if appropriate; uncertainty, abstention and missing evidence would be communicated in domain terms.

I would correlate updates by authenticated scope, logical job and version, guard against stale responses, and resync on missing or conflicting updates. Cancellation would be a request until the authoritative outcome is known. Corrections and supersessions would create linked revisions, show material differences, notify affected authorized users and invalidate stale actions without rewriting history. The server would still recheck authorization and exact result eligibility. I would make status changes accessible, test realistic interleavings and recovery, and evaluate whether users understand what is current and safe to use.

The interface must convey the actual state of knowledge and commitment, not merely whether the model has stopped producing text.

References and research transparency#

Authorized offline research exception applied. The references below identify established human-AI interaction research, accessibility standards and technical specifications; live link availability, current contents and the Supabase changelog were not verified. Four meaningful Mermaid diagrams use standard triple-backtick fences and received structural review only. Parser execution and frontend rendering were not tested. The exact Python reducer ran locally using Python 3.13.5 and passed 20 assertions. No real browser, accessibility audit, network transport, concurrency/load test, model validation or notification service was exercised. All scenarios and performance figures are hypothetical.

Related questions

Explore other topics:Forward Deployed EngineeringMachine LearningMLOpsPython