test(e2e): isolate offline Argument revision reads vs durable enqueue (#740)

Merged
FO
19h ago
+188-4

Evidence and scope

The original Argument rename profile #39103351420 showed ~2s spent in each offline updateArgument write. PR #757 adds profiling-only, temporary browser-side timing wrappers for durable operation lookup, acknowledged revision/base retrieval (with scoped revision-state and entity cache reads), and durable enqueue. The existing update, assertions and revision/conflict safety rules are unchanged; no production code change.

A P3 review finding identified that the original wrapper could count other cache reads. The instrumentation now only records reads of the edited Argument id while its acknowledged-base acquisition is active, requires exactly one completed invocation for every expected stage, and fails on incompatible parent/child timings. All browser wrappers restore in finally. Ordinary E2E is unchanged; measurements run only when profiling is requested.

Measurements

Corrected scope-checked Chromium run #39136910046 passed 1 excluded warm-up + 3 measured runs, with median test wall 15.839s.

StepTarget medianResponse median
Complete write1.767s1.986s
Acknowledged base (inclusive)1.762s1.981s
Revision-state read0.876s0.988s
Argument-record read0.888s0.957s
Durable enqueue/refresh0.002s0.002s

The previous less strictly scoped run #39104403107 showed a similar distribution but is not treated as final evidence. The next target is two sequential offline read-through attempts in acknowledged-base retrieval, not durable queue writing. Any production optimization must preserve freshness/domain-invalidation fences and acknowledged revision safety, and be measured via a separate same-runner A/B.

The temporary PR-only workflow was removed after the experiment, so the final diff retains only the manual workflow_dispatch profiler, test instrumentation, contract coverage, and documentation.

Acceptance

  • Profile passed with validated exact-id/one-call scoped timings.
  • Temporary workflow deleted.
  • Reviewer measurement-validity finding addressed.
  • Findings recorded in #740.
  • Final-head CI green and no unresolved review threads.
  • No production changes, weakened offline safeguards or unauthorized merge.

Explicit maintainer approval is required before merge.


Summary by cubic

Tracks where the ~2s offline Argument rename cost comes from with an opt-in E2E probe, confirming the acknowledged-base cache reads dominate while durable IndexedDB enqueue is negligible. No production behavior changes.

  • Active only under PRKS_E2E_PROFILE=1; ordinary E2E runs the same updateArgument path untimed.
  • Times the operations snapshot, acknowledged base, revision/record cache reads, and durable enqueue, requiring exactly one completed sample per stage with cache reads matched to the edited Argument id and scoped to the base lookup.
  • The corrected run (#39136910046) shows base ~1.76s/1.98s split between revision reads ~0.88s/0.99s and record reads ~0.89s/0.96s; enqueue is ~0.002s — pointing to sequential offline read-through attempts during base acquisition.
  • Invalid or missing samples fail the profiler; a unit regression confirms samples are opt-in and reject non-finite or negative values.
  • The temporary PR-only probe workflow has been removed, so there is no permanent CI cost.