Skip to content

[design·perf] Response-time budget by route — separate real-user latency from QA/test overhead #603

Description

@atomchung

Status

Discussion / measurement-first — M1 product-quality risk, not an active implementation front.

Owner ruling, 2026-07-30 and expanded 2026-07-31: every answer the product gives must arrive within a bounded, predictable time. The early experience of waiting 10–20 minutes for one review card is the anti-goal. The first budget must come from live measurement rather than an invented number.

This issue owns the cross-route response-time contract. It does not currently displace #610 or #661 from the execution queue.

Milestone

Current: M1 quality guard / measurement.

A response-time budget is required before the review route can be described as predictably usable, but this issue remains measurement-first until the first real-user and QA baselines identify where the time is spent.

Owning outcome

A user handing FOMO Kernel transaction history can understand how long it should take to receive the first useful review card, while maintainers can tell whether a slow run is caused by the product path or by the formal QA harness.

Current behavior / evidence

Decision — two lanes, two clocks

Lane A — real-user product latency

Measure the product lifecycle only. For a transaction-history review, record these timestamps live:

  1. Input accepted → first computed value visible: the transaction source is accepted until the user sees the first engine-computed diagnosis, question, or other route-defined visible value.
  2. Input accepted → private preview card delivered: the primary end-to-end product KPI for “交易记录到出卡.”
  3. Last required answer → private preview card delivered: the critical machine-only wait already implicated by [P2·investigation·perf] Attribute the 5-10 min machine wait after the user answers (post-answer LLM turns + preview retry loop) #236.
  4. Rule choice/skip submitted → final private card delivered: finalization latency.
  5. Human response time: reported separately and excluded from machine latency; it remains part of total elapsed journey time.

The primary budget must not use finalize completion alone as “card delivered.” Delivery requires observable presentation evidence; a generated file is not enough.

Lane B — QA/test operator latency

A QA run records the same product segments, tagged by evidence lane:

  • owner_live
  • agent_with_owner_verdict
  • agent_simulated

It also records a separate QA overhead clock for:

  • latest-main refresh / version gate;
  • isolated-root setup and isolate-check;
  • optional contract preflight;
  • receipt event writes;
  • receipt verification;
  • manifest/archive work;
  • privacy lint and public finding preparation.

QA overhead is useful for improving maintainer throughput, but it is never included in the user-facing response-time budget. An agent_simulated run is a performance/debug data point, not proof of real-user UX.

Measurement record

Each measured run should preserve, without private trade content:

  • tested main@SHA, client/host, route, and evidence lane;
  • transaction-history vs snapshot input;
  • coarse input-size bucket, never public transaction details;
  • cold/warm dependency state and whether price/FX lookup ran or degraded;
  • live segment durations above;
  • number of agent/LLM turns after the last user answer;
  • preview attempts, rejection count, and structured rejection reasons;
  • external lookup/tool-call count;
  • whether the first card was actually presented and by which delivery mode;
  • QA overhead durations, when applicable, in a separate block.

Timings must be recorded as events happen. No backfilled timestamp burst (#278).

Performance review rule

A change touching an active route must state and verify expected latency impact when it adds or expands any of the following:

  • network lookup;
  • agent/LLM or tool round trip;
  • required user question;
  • validator retry surface;
  • generated artifact or presentation step;
  • per-position/per-row work that can grow with input size.

Review the route budget at each owner-live acceptance campaign and before a release claim. A material regression reopens this owner even when correctness tests remain green.

First measurement slice

  1. Run one private owner_live transaction-history review on an explicitly frozen latest-main SHA and record the product timestamps live.
  2. Run one agent_simulated or formal-QA transaction-history review on the same route/host class and record product time and QA overhead separately.
  3. Compare the two traces to classify the dominant delay:
    • engine/network;
    • agent generation/context processing;
    • preview rejection/rewrite;
    • tool round trips;
    • QA-only ceremony.
  4. Post only de-identified segment durations and failure shapes here.
  5. Use the result to choose the next smallest fix; do not begin with broad instrumentation or a runtime timeout.

Interim guardrails already in force

Non-goals

  • No invented SLA number before measurement.
  • No runtime timer that truncates an answer mid-delivery in the first cut.
  • No weakening truth-critical gates to make the clock look better.
  • No treating test-drive or automated preflight timing as real-user acceptance.
  • No combining human think time, product machine time, and QA ceremony into one misleading total.

Acceptance criteria — first round

  • One owner_live transaction-history review records all product segments live.
  • One QA/test transaction-history review records the same product segments plus separate QA overhead.
  • The issue contains a de-identified comparison identifying the dominant latency source(s).
  • [P2·investigation·perf] Attribute the 5-10 min machine wait after the user answers (post-answer LLM turns + preview retry loop) #236 receives the post-last-answer attribution evidence if retries/generation remain material.
  • Owner rules an initial per-route budget for at least: input accepted → preview delivered; last answer → preview delivered; rule choice → final card delivered.
  • The approved budget lands in the owning route/reference documentation.
  • A repeatable milestone/release regression review is documented without requiring private data.

Dependencies

Privacy boundary

Real trades, holdings, amounts, dates, motives, answers, and private repository content stay local. Public evidence may include only route, SHA, host/evidence lane, coarse input-size classification, segment durations, retry/tool counts, delivery mode, and de-identified failure shape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions