Milestone v1 (v2.0.0): Mokosh — Session Capture #1

Merged
strategy155 merged 297 commits from gsd/phase-04-harden-clean-up-optional into main 2026-05-31 15:34:17 +00:00
Showing only changes of commit c6e8101860 - Show all commits

View File

@@ -29,13 +29,30 @@ export interface Message<T = unknown> {
} }
// Типы сообщений в long-lived port (offscreen ↔ SW; D-17 / Plan 04 / D-13) // Типы сообщений в long-lived port (offscreen ↔ SW; D-17 / Plan 04 / D-13)
//
// Option C (debug session empty-archive-port-race) extends the surface:
// - 'PONG' completes the health-probe loop: offscreen pings, SW echoes,
// offscreen tracks last-pong time. Replaces the 290 s pre-emptive
// `setTimeout` reconnect (whose race window weaponised the upstream
// silent-skip in createArchive — see the bisect notes in the debug
// session for full lineage).
// - REQUEST_BUFFER + BUFFER carry an architectural `requestId` so the
// SW can match a response to the in-flight request that issued it.
// This retires the silent-cross-talk failure mode where a stale
// BUFFER from a prior request would route into a newer Promise.
export type PortMessageType = export type PortMessageType =
| 'PING' | 'PING'
| 'PONG'
| 'REQUEST_BUFFER' | 'REQUEST_BUFFER'
| 'BUFFER'; | 'BUFFER';
export interface PortMessage { export interface PortMessage {
type: PortMessageType; type: PortMessageType;
// Per-request correlation id (Option C). The SW generates a uuid for
// each REQUEST_BUFFER call and only resolves on BUFFER responses that
// echo the same id. PING/PONG do not carry a requestId — they are
// pure liveness signals.
requestId?: string;
// Wire-format (D-12 base64 transfer + D-13 segment lifecycle): // Wire-format (D-12 base64 transfer + D-13 segment lifecycle):
// segments travel as TransferredVideoSegment[] because // segments travel as TransferredVideoSegment[] because
// chrome.runtime.Port JSON-serializes payloads across extension // chrome.runtime.Port JSON-serializes payloads across extension