perf(graph): reuse coherent offline Person detail in Graph navigation (#740)
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 phase | Baseline median | Candidate median | Delta |
|---|---|---|---|
| Complete Graph test | 16.592s | 15.168s | -1.424s (-8.6%) |
| Person roundtrip | 3.158s | 2.048s | -1.110s |
| Person enter | 1.050s | 0.031s | -1.019s |
| Person return | 1.043s | 0.922s | -0.121s |
| Concept control | 1.352s | 1.160s | -0.192s |
| Position control | 1.150s | 1.366s | +0.217s |
| Argument control | 1.233s | 1.100s | -0.133s |
| Stance control | 1.200s | 1.150s | -0.050s |
| Uncached Concept | 2.148s | 2.013s | -0.135s |
| Uncached Graph | 1.048s | 1.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
preferCacheWhenOfflineguard; 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.