docs: document intentional PUBLIC_WORKSPACE_OWNER_ID upload quarantine#515
Merged
Merged
Conversation
Anonymous "public" uploads pool under the non-null PUBLIC_WORKSPACE_OWNER_ID and are deliberately excluded from anonymous viewing (withOwnerReadScope) and RAG retrieval (null-owner sentinel) until an operator reviews and promotes them to owner_id IS NULL via scripts/promote-public-documents.ts. This is the documented public-workspace model (TEN-N3 in docs/tenancy-defense-in-depth-review.md). Add clarifying comments so the behavior is not mistaken for a bug and "fixed" in a way that exposes unvetted anonymous uploads to logged-out visitors or the clinical answer corpus. Comments only; no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Contributor
📝 WalkthroughWalkthroughDocumentation-only changes clarify that pooled anonymous uploads are quarantined for moderation, excluded from anonymous viewing and RAG retrieval, and must be explicitly promoted before inclusion. ChangesPublic upload quarantine
Estimated code review effort: 1 (Trivial) | ~2 minutes Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (9 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
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
Comments-only change (16 insertions, 1 deletion) documenting an intentional design so it isn't mistaken for a bug later:
src/lib/public-api-access.ts— expand thewithOwnerReadScopedoc comment: anonymous callers see only the public corpus (owner_id IS NULL); thePUBLIC_WORKSPACE_OWNER_IDupload pool is deliberately excluded (moderation quarantine).src/app/api/upload/route.ts— comment explaining anonymous "public" uploads pool under a non-nullPUBLIC_WORKSPACE_OWNER_IDand stay out of anonymous viewing and RAG retrieval until an operator promotes them viascripts/promote-public-documents.ts.Why
While verifying that all Database/RAG document images are viewable without a login, the
PUBLIC_WORKSPACE_OWNER_IDpool looked like a visibility gap. On investigation it is the documented public-workspace model (TEN-N3 indocs/tenancy-defense-in-depth-review.md): unreviewed anonymous uploads are quarantined until promoted. These comments prevent a future "fix" that would expose unvetted anonymous uploads to logged-out visitors or the clinical answer corpus.Verification context (no change in this PR)
Live check confirmed 12,202 / 12,202 document/RAG images are already anonymous-visible (parent
owner_id IS NULL, committed generation), and anonymous production fetches return the images end-to-end. Owned/private docs still 404 for anon. This PR changes no behavior.Clinical governance preflight
N/A — comments only, no behavioral change to ingestion, answer generation, search/ranking, source rendering, document access, privacy, or production config.
prettier --checkandeslintpass on both files.🤖 Generated with Claude Code