perf(graph): prefer coherent offline Position detail during Graph navigation (#740)

Merged
FO
16h ago
+32-0

Scope and review

This PR builds on #760 and #761 by enabling the existing coherence-guarded preferCacheWhenOffline option solely for the Position detail route. Regular Position index/online reads stay server-first. The detail route preserves PRKS_POSITIONS_DOMAIN, prksIsPositionShape, pending create/delete and Argument/name projection, and all existing Graph/offline assertions. A Node contract locks scope and guards. The shared runtime, revision and durable writer semantics are unchanged.

Verified same-runner performance

Chromium A/B workflow run #39150807553 completed one excluded warm-up per revision plus three alternating passing measured trials per revision on the same runner, comparing master 3dde16b to candidate ffe07c3.

PhaseBaseline medianCandidate medianDelta
Full Graph test22.568 s20.228 s-2.340 s (-10.4%)
Position roundtrip3.356 s1.300 s-2.056 s
Position entry1.009 s0.020 s-0.989 s
Position return1.160 s0.057 s-1.103 s
Argument control roundtrip3.386 s3.307 s-0.079 s
Uncached Concept destination2.072 s2.023 s-0.049 s
Uncached Graph1.061 s1.034 s-0.027 s

Figures apply only to this profiled Graph test, not the whole E2E suite; nested phases should not be added to their inclusive parents. No assertions, disabled/synthetic network cases, or isolation boundaries were removed.

Temporary profiling workflow removed from the final PR diff after recording the evidence in #740. All initial-head CI jobs passed including six-shard Full and packaged E2E, Python unit/API and safety/static checks. Codex automated review was blocked by a usage limit, not an identified code defect. No open review threads; manually inspected changed files.

Acceptance

  • Controlled 3+3 real Chromium same-runner A/B with meaningful Position gain
  • Preserve default server-first and guarded offline invalidation behavior
  • Remove one-off profiling workflow
  • Update tracker #740
  • Verify exact-final-head normal CI
  • Merge with maintainer authorization (already given conditionally)

Summary by cubic

Reduces Position detail latency during Graph navigation by letting a warmed Position snapshot render from cache when the runtime is confirmed offline, instead of waiting on a known-failing network request. Only the Position detail route opts into the existing offline guard; online reads, cache misses, index warming, and unknown data keep their existing server-first behavior, and the route retains its domain, shape validation, pending-create/deletion tombstones, and pending projections. A browser selftest locks the opt-in so the Position index and regular reads stay cache-warming and server-first.

Rollout

  • The temporary A/B workflow comparing this branch against pre-change master has been removed; the diff now contains only the position-route change and its selftest.