perf(graph): reuse coherent offline Person detail in Graph navigation (#740)

Merged
FO
13h ago
+74-0

Purpose

Continues #740 after merged #760–#763. Only the Person detail route opts into existing preferCacheWhenOffline; a warm, coherent cached Person can render immediately when confirmed offline. The People index stays server-first (online cache warming retained); online/reconnecting detail fetches, cache misses, changed/blocked domains and invalidated entries also use the normal fail-closed/server-first path. PRKS_PEOPLE_DOMAIN, prksIsPersonShape, route ownership, pending Person create/delete/profile/Work overlays, and cached portrait/thumbnail suppression remain.

A Node contract checks the route opt-in, validators, lifecycle hooks, projection and media safeguards, and excludes People index from the opt-in. The existing real Chromium Graph test retains all navigation and offline-unavailable assertions. No shared offline runtime code or durable writer logic changed.

Verified A/B

Run 39161854813 passed excluded warm-ups + three measured alternating browser trials per SHA, on one runner, baseline master 6f9564a vs candidate 293ef4e.

Profiled phaseBaseline medianCandidate medianDelta
Complete Graph test16.592s15.168s-1.424s (-8.6%)
Person roundtrip3.158s2.048s-1.110s
Person enter1.050s0.031s-1.019s
Person return1.043s0.922s-0.121s
Concept control1.352s1.160s-0.192s
Position control1.150s1.366s+0.217s
Argument control1.233s1.100s-0.133s
Stance control1.200s1.150s-0.050s
Uncached Concept2.148s2.013s-0.135s
Uncached Graph1.048s1.133s+0.085s

These medians apply only to this profiled Graph E2E, not to total suite execution. Nested intervals overlap and must not be summed. The temporary branch-specific benchmark workflow has been removed from the final PR diff, and the results documented in docs/e2e-performance.md and #740.

Acceptance

  • Controlled same-runner A/B with all real-browser assertions, positive measured Person result
  • Keep People shape/domain/queue, cache-provenance and online-warming protections
  • Remove one-off measurement workflow
  • Record results and limitations in tracker/docs
  • Final-head Full E2E, packaged E2E, unit/API and security/static/lint gates green
  • No unresolved review findings or conflicts
  • Maintainer explicitly approves merge

No agent-initiated merge.


Summary by cubic

Makes the Person detail route read from a coherent offline cache snapshot during Graph navigation, so offline detail visits no longer force the slow server-first roundtrip that measured ~3.3 seconds versus ~1.2–1.4 seconds for other cached entities.

  • Person detail opts into the existing preferCacheWhenOffline guard; confirmed-offline reads use cached values, while online and cache-missing reads still go to the server.
  • People index reads and the shared runtime are unchanged and still warm the offline cache.
  • Adds a Node contract test asserting the Person detail opt-in boundaries and that People index stays server-first.
  • The same-runner A/B was already run and recorded a ~1.1 second Person roundtrip gain; the one-off workflow was removed, so no permanent CI cost or E2E coverage was reduced.