fix(reliability): bound collaborative field metadata - #228
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Review (head 5fb2f5b)
No blocking fail-closed or contract defect on this exact three-file collaborative-boundary repair. The implementation order matches the claimed contracts:
editable/hideToolbaraccept only omitted defaults or exact runtime booleans; truthy strings such as"false"throw the stated payload-redactedRangeErrors before they can change edit authority or toolbar visibility.fieldis type-checked and length-bounded at 1,024 UTF-16 code units beforetrim(); rejected contents are not reflected in diagnostics.- The new tests prove the hostile cases. Existing collaboration tests still cover omitted
field→default, whitespace-only emptiness, and real boolean read-only / hidden-toolbar behavior.
Keep this Draft unmerged while #118 owns the exact v0.6.0 source identity at main@e8109ec. This comment is not a qualifying independent approval and does not transfer predecessor CI or review evidence.
Residual risks (out of this PR)
- Standalone
CwlEditorstill forwards runtimeeditable/hideToolbarwithout the same boolean gate. A deserialized"false"on the non-collaborative surface can still enable editing. That is a separate buyer-visible integrity gap, not a defect of this collaborative-only lane. - Public
fielddocs still describe the fragment name only. Hosts learn the 1,024-unit ceiling at runtime.
Next action: leave #228 Draft until current-head required checks and an independent last-push approval land after #118; do not expand this PR to the standalone editor surface.
Sent by Cursor Automation: Fix Issues


Closes #227.
Closes #264.
Scope and ownership
This Draft is the canonical single-writer lane for
src/collaboration/CollaborativeCwlEditor.tsx. It owns bounded/type-safe Yjs XML fragmentfieldmetadata, exact runtime validation for inheritededitable/hideToolbarbooleans, and component-local containment of host-owned awareness getter/listener failures used only for accessible presence presentation. Provider transport, room/document authorization, tenancy, durable persistence, credentials, network lifecycle, model policy, retention, deployment, durable audit, and Yjs document authority remain host-owned.TDD lineage
94261deacae25983b76a409c990e2a8a8a0cb692: hosted CI31521818066/ build-test93880430700reached the dedicated public regressions.cf39f9e5b5c2e1b0c6b9c91d49b5d841ccdff674: hosted CI31583307152/ build-test94071206726failed exactly because invalid runtimeeditable/hideToolbarvalues were accepted.0970e5cd70dd15ed8a9fde5e03cdf70ea75d3579: a provider whose firstawarenessread passes configuration and whose second read throws a private sentinel is accepted by configuration but the production predecessor directly rereadsprovider.awarenessfor presence counting, so the new SSR regression deterministically fails before the repair. The immediate source repair superseded hosted RED generation; no hosted RED is claimed.fbe4d3ae34e1c5e0d080ef9076a4f0ebd539faa7: presentation-only awareness reads are isolated through a local fail-closed helper, yielding the existing zero-presence fallback instead of leaking the host getter failure.5b7a67e64cd837008d85a6375685c239205c0dca: realistic browser regressions require host-ownedawareness.on('change', ...)and cleanupoff(...)failures not to escape the component. The production predecessor invokes both directly, so the assertions deterministically fail; the immediate repair superseded hosted RED generation and no hosted RED is claimed.8834f15bfc5006c041afeea2fb696498ffdd1106: contains listener registration and cleanup failures without weakening valid provider behavior, presence counting, Yjs document authority, or host lifecycle ownership.Current exact boundary
Protected shipped truth and frozen
v0.6.0source candidate are independently resolved asmain@3b38ead2d00f44eb578d0689087b9293b3dabe1e. Current exact Draft head is8834f15bfc5006c041afeea2fb696498ffdd1106onfix/collaboration-field-runtime-boundary-227.Fresh exact comparison resolves protected main as the merge base, reports 10 ahead / 0 behind, and limits the delta to five branch-owned paths:
src/collaboration/CollaborativeCwlEditor.fieldBoundary.test.tsx;src/collaboration/CollaborativeCwlEditor.providerAwarenessFailure.test.tsx;src/collaboration/CollaborativeCwlEditor.providerListenerFailure.test.tsx;src/collaboration/CollaborativeCwlEditor.runtimeState.test.tsx;src/collaboration/CollaborativeCwlEditor.tsx.Current behavior
fieldmust be a string no longer than 1,024 UTF-16 code units before trimming and remains nonblank after normalization;editableandhideToolbaraccept only exact runtime booleans;changelistener registration or cleanup failures are contained at the component boundary rather than leaking private provider values through render/unmount; andThese provider-failure changes do not replace the broader awareness-module hardening owned separately by Draft #167. They repair only this PR's component-owned direct host interactions and should compose with #167 after the protected release boundary permits source-owner-aware reconciliation.
Exact-current-head evidence
For unchanged exact head
8834f15bfc5006c041afeea2fb696498ffdd1106at the latest fresh refetch:32220059531: completed / success;32220059565: completed / success;32220059557: completed / success;COMMENTEDreview only, therefore 0 qualifying approvals;No predecessor check or review evidence transfers to a moved head. Automated checks/model/status evidence is not approval.
Governance and integration boundary
Keep this PR Draft/unmerged while #118 owns exact protected
v0.6.0tag/publication/provenance/digest operational acceptance and while qualifying independent latest-push approval plus every then-applicable governance/workflow gate remain incomplete. Before any lifecycle transition, refetch the unchanged head, protected main, ancestry/mergeability, live rules/permissions when available, formal reviews/threads, and every applicable repository/central workflow. Do not transfer predecessor evidence, weaken gates, self-approve, move protected main, or fabricate tag/release identity.