Build hosted realtime collaboration foundations - #318
Conversation
* Fix signup isolation and identity races * Add open beta signup entitlement
* release: prepare beta86 * Document beta86 signup safeguards
* fix: canonicalize editor authorization redirects * test: preserve editor link ordering
|
Phase 3 progress pushed through
Collaboration remains deliberately unadvertised and unreachable from HTTP/WebSockets. Phase 4 ticket exchange, transport, post-commit delivery/revocation disconnect, headless two-client conformance, and then Editor live mode remain required before end-to-end collaboration can be tested or enabled. |
# Conflicts: # CHANGELOG.md # scripts/deploy-editor-dev.mjs # services/server/src/db.test.ts
Additional adversarial LAB campaignCurrent Editor head: Confirmed and fixed:
Live evidence after fixes:
Qualification:
Blocked/inconclusive: automated member editor->viewer acceptance could not reach the owner management surface because the ordinary browser session entered the LAB login redirect flow. The role mutation was never issued, so membership remained unchanged. Read-only Editor acceptance remains open. |
Same-site LAB and two-account presence acceptanceCurrent head: LAB origin migration
Confirmed presence defects and fixes
Readiness-order defect found during two-account setupHosted collaboration capability grants depended on whether
Exact deployments
Qualification and LAB evidence
|
Follow-up adversarial presence reviewA late independent review found one residual edge: a semantically changed awareness snapshot could reconfigure CodeMirror from raw absolute offsets while local durable updates were still pending, replacing the correctly mapped decoration. The same commit also makes the Tokio watch borrow drop explicit before acquiring the awareness-room mutex/sending, and documents v1 awareness snapshots as recipient-relative in both protocol implementations. Collaboration-enabled Editor tests are now 314/314; protocol tests 56/56; Editor/protocol typechecks, Rust check/format, and architecture pass. Exact Editor deployment: |
Status
Draft stacked on #317. Implements the provider-neutral CRDT profile, secure hosted transport foundations, and a private experimental shared browser room client through Phase 9. Collaboration remains disabled by default (
MDBASE_CONNECT_HOSTED_COLLABORATION_ENABLED=false), unadvertised in readiness, absent from stable public SDK exports, and not yet integrated into the Editor.Implemented
RecordDocument.body, LF-only admission, stable record rooms, epochs, and durable authority ownershiprecords.collaborate, v6 signed authorization, and exact opt-in membership/grant/replica capability ceilings while preserving prior contractsParticipant Nidentities, collection/user-derived palette colors, post-Sync membership, bounded room/replica caps, sliding rate limits, TTL hide/reappearance semantics, drain linearization, and no SQL/outbox/log persistence@mdbase-dev/connectwith exact current-authorization, proof, scope, capability, epoch, URL, no-store, and TOCTOU validation; stable package exports remain unchanged@mdbase-dev/connect-collaborationhosted room provider owning Y.Doc/Y.Text, strict binary protocol, bounded durable-Ack queue, epoch-bound reconnect, handshake/watchdog/backoff, heartbeat, TTL awareness refresh, immutable snapshots, flush, and cleanupValidation
cargo test --locked -p mdbase-connect-hosted-provider --lib— 145 passed, 11 ignored (environment-gated)cargo test --locked -p mdbase-connect-protocol collaboration_awareness— 11 passedcargo clippy --locked -p mdbase-connect-hosted-provider --all-targets -- -D warningscargo fmt --all -- --checkpnpm --filter @mdbase-dev/connect-protocol build/test/typecheck— 56 tests passedpnpm --filter @mdbase/connect-server test/typecheck— 372 tests passedpnpm --filter @mdbase-dev/connect test/typecheck/test:public-api— 275 tests; root, advanced, crypto, packed, and browser API boundaries unchangedpnpm --filter @mdbase-dev/connect-collaboration build/typecheck/test— 27 tests passedpnpm check:architectureandpnpm check:workspace-pinsRemaining gates
LAB acceptance progress
maininto the collaboration branch before continuing acceptance, retaining beta.86 signup/isolation changes and resolving the combined control-plane migration ledger and Cargo locks.8805db67adds bounded shared-provider recovery: at most three fresh-ticket attempts, one combined handshake/policy budget, same-epoch pinning, pending-update retention, fail-closed authorization errors, and a continuously connected 30-second rearm gate. LAB then passed convergence and reload while transparently recovering the observed 1008 policy closes.dc8a2d56makes experimental LAB sharing create and change member policies with collaboration enabled while flag-off builds retain the ordinary sharing payload.82bb55f2–b04b7c93add a 250 ms awareness safety cadence, merge unsent Yjs updates, cap durable sends at 25/second, preserve immutable replay envelopes across reconnect, bound oversized coalesced envelopes, and retain the live editor key after fail-closed termination.b04b7c93Editor locally to the LAB candidate alias. LAB then passed 30- and 100-keystroke bursts, two-profile 100-keystroke bidirectional convergence, long-document scroll/focus stability, exact baseline restoration, and reload persistence. The status returned to exactLive; no terminal state, focus loss, page scroll, console error, or lost text was observed.