perf(graph): use coherent offline Concept detail snapshot for Graph roundtrip (#740)

Merged
FO
17h ago
+82-0

Summary

Follow-up to #740, #753 and the guarded cache-reader merged in #760. Only the Concept detail navigation route opts into the existing preferCacheWhenOffline flag; the prksOfflineDetailFetch helper forwards it without changing defaults. Online, reconnecting, unrecognized cache entries and cache misses use the existing server-first behavior. The route retains PRKS_CONCEPTS_DOMAIN, prksIsConceptShape, pending create/deletion logic, route ownership, Graph selection and existing unavailable-state checks.

The Node helper/route contract checks the opt-in and the default server-first read. No Graph assertions were removed; no shared offline-runtime code was changed.

Completed same-runner A/B

GitHub Actions run 39144040444 passed an excluded warm-up for each exact SHA plus three alternating successful measured Chromium trials per SHA (baseline 570239c, candidate initial head 5024f41).

Profiled phaseBaseline medianCandidate medianChange
Full test27.260s22.928s-4.332s (-15.9%)
Concept roundtrip3.187s1.387s-1.800s
Concept detail enter0.969s0.038s-0.931s
Concept detail return1.117s0.068s-1.049s
Position control roundtrip3.162s3.292s+0.130s
Uncached Concept destination2.042s2.144s+0.102s
Uncached Graph3.033s0.994s-2.039s

These are single-test profiling measurements, not total E2E-suite savings. The Position control and uncached destination remain within a narrow range; the Concept navigation change accounts for the targeted gain. All full-test real-browser assertions passed.

The temporary A/B workflow has been removed from the PR diff after collection. The P2 finding requesting removal is resolved. The measured results are recorded in #740 and docs/e2e-performance.md.

Merge requirements

  • Meaningful positive same-runner Concept navigation result
  • Real Chromium A/B passes without weakening unavailable/Graph assertions
  • Remove temporary profiling workflow
  • Resolve outstanding review finding
  • Record evidence and safety limits in #740
  • Full exact-head final CI passes (including unit/API, packaged E2E, full E2E and security checks)
  • Explicit maintainer merge approval

Summary by cubic

Opts the Concept detail route into the existing guarded cache-first offline read, so an offline cached Concept renders without waiting on a known-failing detail fetch. Online and reconnecting reads stay server-first, and the temporary A/B workflow used to validate it has been removed, with results recorded in docs/e2e-performance.md (4.3s, 15.9%, faster Graph navigation test; 1.8s faster Concept roundtrip).

  • prksOfflineDetailFetch forwards preferCacheWhenOffline; all other callers keep the server-first default.
  • The route keeps its coherence domain, shape guard, and offline/unavailable handling.
  • Route source and read-through tests lock in the opt-in and confirm default reads stay server-first.