Skip to content

fix(brain): drop sent-mail quotes from replaced company-sheet facts - #114

Draft
Caezarr wants to merge 2 commits into
fix/review-20261118from
fix/review-20261120
Draft

Caezarr wants to merge 2 commits into
fix/review-20261118from
fix/review-20261120

Conversation

@Caezarr

@Caezarr Caezarr commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Stacked on #107 (merge order: #94 → #95 → #104 → #107 → this; #91 and #93 are independent).

Problem (review of 20/11, GDPR / data minimization)

A company-sheet fact that gets replaced (superseded: the owner approves another version of the same topic, or answers Orbi's question on it) kept up to 3 verbatim quotes (≤ 240 chars each) of the owner's sent mail for the life of the workspace — including candidates the owner never reviewed. Each new sent-mail reading also merged fresh quotes into it (same-statement dedup). The owner could not erase them: a superseded fact can no longer be rejected (409). The privacy page only said quotes of a rejected fact are erased.

Fix

  • supersedeTopic clears quotes, like rejection already does.
  • planCandidate never merges into a superseded fact; a statement that only exists as superseded is skipped (superseded_before), not proposed again.
  • Migration 018-superseded-fact-quotes.sql clears quotes already stored on superseded rows. brain_facts has FORCE RLS, so the owner lifts it for this one UPDATE inside the migration transaction and restores it.
  • Privacy page (§ 2 and § 5 retention table) and docs/product/company-brain.md updated.

Verification

  • 2 new tests fail on the old code, pass now.
  • Disposable Postgres 16, migrations 001–018 applied by a non-superuser owner (no BYPASSRLS): without lifting FORCE the owner sees 0 rows (proves it is needed); after 018 the superseded fact has [], the candidate keeps its quote, relforcerowsecurity is back to true.
  • tsc --noEmit, pnpm test (1171 tests), pnpm lint (1 known warning in the landing), next build --webpack OK.

Ops: migration 018 must be run on Supabase prod (with 016/017 still pending there).


Generated by Claude Code

A fact superseded on the same topic (the owner approved another version,
or answered Orbi's question on it) kept up to three verbatim quotes of the
owner's sent mail for the life of the workspace, unreviewed candidates
included, and every new sent-mail reading merged fresh quotes into it.
The owner could not erase them: a superseded fact can no longer be
rejected. The privacy page only covered quotes of rejected facts.

- supersedeTopic clears quotes, as rejection already does
- planCandidate never merges into a superseded fact; a statement that is
  only superseded is skipped (not proposed again)
- migration 018 clears quotes stored on superseded rows (FORCE RLS lifted
  for that one UPDATE inside the migration transaction, then restored)
- privacy page and company-brain.md describe the new rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
orbis Ready Ready Preview Nov 20, 2026 5:40am UTC

This branch was successfully deployed

1 active deployment
Preview — e65f91b0 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants