Data + Policy
Ownership & visibility rules
Single reference for structural parents, link semantics, and the visibility ceiling before wiring Supabase RLS.
- Keep structural parent/child rules consistent when adding presets
- Document when to use owns[] vs references[] vs belongs_to
- Clarify the visibility ceiling (child ≤ parent) for policy work
Structural
Section hierarchy
Sections can own other sections, sessions, resources, assignments, and discussions.
- Use structural.allowedChildren to limit what the UI shows beneath a given section.
- Week/Module sections default to allowedChildren = ["section","session","resource","assignment","discussion"].
- Workshop-day preset narrows children to ["session","resource","discussion"].
- seed -> sessionParents map takes precedence.
- When pulling from Supabase/Convex, structural.parentId stores the slug-level alias; dbId stays in meta.dbId.
- Assignments carry due dates, not sessions.
- Studio sessions optionally inherit section visibility ceiling.
Links
- Example: Resource belongs to Week 5 (structural.parentId=week5) but can reference Session IDs under linking.references.
- Discussion attaches_to Section/Session/Assignment via structural parent.
- Use for playlists, prep packs, resource dumps.
- Preset builder will eventually emit join maps for collections separately from section ownership.
Visibility
- Section visibility is the ceiling. Sessions/resources/discussions default to inherit unless explicitly narrower.
- Field intel resources inherit members-level by default, even if Section is public.
- Supabase provider remaps db UUIDs back to slugs using meta.slug so inheritsFrom remains human-readable.
- In future, we can add secret threads by setting access.visibility='private' regardless of parent.