collab: passive pull facade, sibling mirror without BoardRoom wake (load-path-rework 0004)

- GatewayDocFacade: passiveSync (Step1 on subscribe + on touched, answered by
  the gateway from at-rest state), onReset; activate() after a passive fill
  still sends act + a participant Step1.
- sibling-restage subscribes passive+passiveSync; reset drops the watch (no
  flush) and re-dials while a peer still has the sheet open.
- files-watch: upload/job hints on room-backed paths restage + announce
  onRoomBackedChanged; sheet-manager.invalidate() drops a parked room.
- kicad-binding: normalize server-serialized bodies on the editorMatchesDoc
  path (runner-seeded ydocs carry kicad-cli's serialization).
- pcbjam-shared -> 0f4d3a1 (reset control, kicadDocToYdocUpdate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UQsdqaX57xzcCWUjqP7ctV
This commit is contained in:
Gergő Törcsvári 2026-08-28 17:55:59 +02:00
commit 602f5c6fed
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
13 changed files with 332 additions and 13 deletions

View file

@ -40,6 +40,12 @@ export interface YjsProvider {
* subscription was passive (the sheet manager's parked-dirty flag).
*/
onTouched?(cb: () => void): void;
/**
* Gateway transport only (load-path-rework 0004 §2.3): the doc's server-side
* history was replaced and this passive copy cannot be merged — the owner
* must destroy doc + provider and connect afresh.
*/
onReset?(cb: () => void): void;
}
export type ProviderKind =
@ -175,7 +181,7 @@ async function hocuspocusProvider(
export async function connectProvider(
doc: Y.Doc,
config: ProviderConfig,
opts: { room: string; passive?: boolean },
opts: { room: string; passive?: boolean; passiveSync?: boolean },
): Promise<YjsProvider> {
switch (config.kind) {
case "broadcastchannel":
@ -195,6 +201,7 @@ export async function connectProvider(
docPath: parsed.docPath,
token: config.params?.token,
passive: opts.passive,
passiveSync: opts.passiveSync,
});
}
return partyKitProvider(doc, requireEndpoint(config), opts.room, config.params);