fix(decopilot): scope live deck/page preview to the writing chat#3928
Open
viktormarinho wants to merge 1 commit into
Open
fix(decopilot): scope live deck/page preview to the writing chat#3928viktormarinho wants to merge 1 commit into
viktormarinho wants to merge 1 commit into
Conversation
The deck watcher emitted `data-deck-updated` for every `decks/`|`pages/` change in the org-wide `home` volume change feed since the run-start cursor, with no provenance check. Because decks/pages live in a flat org-global namespace shared across every chat and member, another chat's or member's file (e.g. a "Sales Dashboard") surfaced in your live preview and persisted as a chip. Fix by provenance (no UX change): stamp the writing thread on org-fs file entries (`org_fs_entry.thread_id`, migration 110) from the deck-buffer, and emit only entries this run produced — exact thread match, falling back to same-user scope for unstamped bash/slides write-backs (which still blocks cross-member leaks). `putFile` keeps the existing stamp via COALESCE so the mount's vfs write-back echo doesn't null it out. Residual: same-user-two-chats for `slides-create` (bash) decks still falls back to user scope, since those reach org-fs via the async mount write-back decoupled from the dispatch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this contribution about?
The live deck/page preview leaked across chats: the deck watcher emitted
data-deck-updatedfor everydecks//pages/change in the org-widehomevolume change feed since the run-start cursor, with no provenance check — so another chat's (or another member's) file, e.g. a "Sales Dashboard", surfaced in your preview and persisted as a chip. Decks/pages live in a flat org-global namespace shared across every chat and member, which made the org-wide change feed leak. This fixes it by provenance (no UX change): each org-fs file entry is now stamped with the writing chat (org_fs_entry.thread_id), the deck-buffer stamps it fromctx.metadata.threadId, and the watcher emits only entries this run produced — exact thread match, falling back to same-user scope for unstamped bash/slides-createwrite-backs (which still blocks cross-member leaks).putFilepreserves the stamp viaCOALESCEso the mount's vfs write-back echo doesn't null it out.How to Test
deck-paths.test.ts→matchOwnDeckEntry.)Migration Notes
Adds migration
110-org-fs-thread-id.ts— a nullablethread_idcolumn onorg_fs_entry. Backwards-compatible (existing rows are null and fall back to same-user scoping). Runbun run --cwd=apps/mesh migrate.Known residual: same-user-two-chats for
slides-create(bash) decks still falls back to user scope, since those reach org-fs via the async mount write-back decoupled from the dispatch.Review Checklist
Summary by cubic
Scopes the live deck/page preview to the current chat to stop cross-thread leaks. Org-fs writes are stamped with a
thread_id, and the watcher emits only entries from this run (thread match) or same-user fallback for unstamped writes.Bug Fixes
thread_idtoorg_fs_entry(migration 110).ctx.metadata.threadId.matchOwnDeckEntry(thread match, or same-user for unstamped bash/slides-createwrites).thread_idon upsert usingCOALESCEto avoid nulling on mount echo.Migration
bun run --cwd=apps/mesh migrate.slides-createstill falls back to user scope.Written for commit b67282d. Summary will update on new commits.