Home

# Briefing and Workshop Builder (spec, Nov 19)

Pre-builds a briefing, workshop or presentation for a leader from a preset, the way Build Your Brand and the Training
Course pre-build for leaders. Night Glass (Faction Glass dark theme). Preview only, nothing live.

## Pattern copied
- Build Your Brand (`web/src/brand`, `docs/crm/BRAND_BUILDER.md`): a step flow, PRESETS (`brand/lib/workflow/preferences.ts`),
  one website module under `web/src/roundtable/mods/<name>`, saved per member through a `*_store` table and security
  definer functions, content rules built in.
- Training groups builder: a leader-only builder gated by role (`RTTgBuilder.allowed()`).

## Flow (mock: `docs/crm/mocks/briefing-builder.html`)
1. Kind: Briefing, Workshop, Presentation. Choice buttons auto-advance.
2. Audience: team leaders, MGAs heading a branch, new agents. Auto-advance.
3. Preset topic: training groups explained, weekly production huddle, onboarding kickoff, recruiting night,
   call review clinic, goal and schedule optimizer. Auto-advance.
4. Length (slider + number box) and group size (slider + number box).
5. Result: sections with minutes that always add up, talk points, skip / add back, locked lines byte for byte, handout copy. Present opens a full-screen slide deck (arrow keys, space, Esc) built from the kept sections, ending on the locked and illustration lines. Draft only, Julian sends.
   locked lines copied byte for byte, handout copy. Draft only, Julian sends.

## Rules baked in
- Pay figures only from the optimizer preset, always with "Illustration, not a promise of income. Results vary.",
  hidden while Presenting is on. Counts only, no agent names beside money.
- The training groups preset carries the locked license line byte for byte. No replacement or plan update language.
- Practice data only. No em dashes. Nothing under 14px, taps 44px.

## Build later (needs Julian's yes, then Matteo at go-live)
- "RGA" in the database check means the 1st level: the website owner account or a NAF-KET 1st-level owner (public.home_scope_all).
- Who can open it (Julian, Nov 19, 2:25 AM ET: "SA GA MGA RGA"): RGA (1st level) yes, MGA heading a branch yes, GA yes,
  SA yes. Agent not named, so no (Julian can add). Contracting team no, VA no. Each person sees only their own saved drafts.
- The briefing_store build decides who sees what: Opus builds it, an independent Fable review follows, SQL must be
  reversible (backs up what it replaces), and it merges only through Matteo.
- Look: mock is Night Glass. Overnight pick (JG MP council, provisional, Nov 19 night, undoable): the real module wears the live CRM look (UI_RULES.md). Julian can change it.
- Real module + `briefing_store` table (own rows only, RLS, definer functions), AI fill through `brand/ai`-style op,
  preset text reviewed by Julian (no invented facts: unknown is TBD), role gate (leaders only).
- Mock gaps: the optimizer figure is a placeholder formula; preset talk points are stubs.
- Closing slide: no "Never replace an AIL policy" line in the module (Julian said no, Nov 19). Only the illustration line appears, on the optimizer preset. The protected-text lock is unchanged.

## Built on the branch (Nov 19, not live)
- SQL: `supabase/migrations/20270204100000_briefing_store.sql` (table + `briefing_allowed/get/list/set/del`, RGA, MGA, GA, SA only,
  own rows only, ends with `sql_run_mark`). Undo: `docs/crm/BRIEFING_BUILDER_UNDO.sql` (renames the table, keeps rows).
- Website: `web/src/roundtable/mods/briefing` (builder + Present), ops `briefing/*`, `JG.briefing`, mock + Supabase backends,
  test `briefing-mock.test.ts` (passes). NOT done: a typecheck and the module's browser
  test (no node_modules in this container), the SQL has not been run anywhere.
- Menu: My Business > Briefing Builder (page `briefing`, overnight pick, JG MP council, provisional, Nov 19). Hidden unless the access op sets RT_ACCESS.briefing (it tries the database check, so Agents, the Contracting team and VAs never see it; a VA's menu is built before that call). The database still refuses on every call.