ARCH-NB-002 — Model kernel and Spark readiness once per runtime
| Field | Value |
|---|---|
| Status | Open; deployed inconsistency observed and source-verified |
| Architecture state | Deployed behavior; shared runtime model absent |
| Severity | High |
| Affected surface | Multiple cells, Run All, multiple tabs, refresh, rename, and kernel replacement |
| Components | sparqd/oqullus; Jupyter Server, Enterprise Gateway, and Spark provide runtime state |
| Associated issue | oqullus #520 |
Where the problem appears
Run several cells while the kernel is starting or Spark is initializing, then repeat from two tabs and across refresh or kernel replacement.
Concrete observed case
Starting-kernel and initializing-Spark states appear on individual cells even though they describe one shared runtime. The readiness probe is deduplicated, but every waiting cell projects its own initialization state. Different tabs can consequently disagree.
Expected condition
One authoritative record per session and kernel exposes server, connection, kernel, and Spark readiness. Cells keep only their execution state and a shared wait reason. A changed kernel invalidates readiness.
Cause and evidence
Reviewed source stores preparation and initialization in cell execution metadata, caches Spark readiness in browser memory by notebook path, and holds kernel state separately per tab rather than by kernel identity.
Why it matters
Conflicting readiness messages hide the actual runtime state, obscure startup failure, and can allow a replacement kernel to inherit stale readiness.
Existing controls and workarounds
One readiness request is reused within the current browser owner scope. Users can wait for one cell to finish initialization before running others, but tabs and refresh still lack an authoritative shared state.
Alternatives considered
- Recommended: one observable runtime record keyed by session and kernel ID.
- Keep per-cell state and synchronize it — rejected because lifecycle state does not belong to a cell.
- Key readiness only by notebook path — rejected because rename and kernel replacement invalidate that key.
Component involvement
sparqd/oqullusowns the shared runtime store, subscriptions, queue state, and invalidation.- Jupyter Server and Enterprise Gateway provide authoritative session/kernel state; Spark readiness completes the runtime state.
Reproduction and verification
Follow NB-S014.
Resolution conditions
Close when cells and tabs agree on one runtime, startup probes run once per kernel, refresh rehydrates it, and replacement invalidates old readiness.
Validation and blockers
The inconsistency and source model are known. A controlled cold-start, multi-tab, refresh, and replacement sequence is still required.