Skip to content

2026-07-17 — XP-138 sessions read-path Promise.all

  • packages/service/src/sessions/get-session.ts — student resolveSesiPriceEstimate + tutor resolvePriceOrigin now fire together via Promise.all on the deps.db pool (genuine two-connection parallelism). Tutor-origin ternary preserved.
  • packages/service/src/sessions/preview-freeze-delta.ts — approve-audit metadata SELECT + freezeSesiPricing live re-resolve now parallel inside the existing read-only tx.
  • packages/service/src/sessions/substitute-candidates.ts — candidate-list query + system-wide availability_recorded EXISTS flag now parallel on the pool.
  • Behavior-preserving reorder only, no new tests: identical output/response shape, guarded by the existing sessions unit + integration suites (XP-132 substitute flow stays green).
  • File 2’s pair shares ONE tx connection, so its win is postgres-js pipelining, not true concurrency (smaller than the pool-based wins in files 1 & 3) — accepted, matches the ticket’s “run independent reads in parallel” intent.
  • preview-freeze-delta runs inside a read-only db.transaction; the assertSessionTransition guard still runs BEFORE the parallel pair, so a bad-status session short-circuits before either query fires. freezeSesiPricing confirmed write/lock-free (no .for("update")) — required to keep preview from taking a row lock (sesi-concurrency-row-lock.md).

None. No canonical doc (plans/ARCHITECTURE.md, plans/scope/*.md, .claude/rules/*.md) changed.