Skip to content

release: Persona A integration + Tec21 calendar + hydration fix#17

Merged
danieldiazde merged 8 commits into
mainfrom
dev
May 9, 2026
Merged

release: Persona A integration + Tec21 calendar + hydration fix#17
danieldiazde merged 8 commits into
mainfrom
dev

Conversation

@danieldiazde
Copy link
Copy Markdown
Owner

@danieldiazde danieldiazde commented May 9, 2026

Mergea a main todo lo que está en dev:

Persona A integration (PR #15)

  • 53 planes de estudio JSON (data/planes/)
  • scripts/seed-planes.ts
  • lib/google/calendar.ts, lib/ical/parser.ts
  • POST /api/canvas/sync, /api/calendar/sync, /api/calendar/create
  • GET /api/planes y /api/planes/[clave]
  • Build fix: node-ical como serverExternalPackages

Tec21 calendar awareness (PR #18)

  • lib/tec21/calendar.ts: bloques 1-3 + Semanas Tec
  • profiles.semestre_inicio (date) por usuario
  • Onboarding step 2 con date picker
  • Prompt de Gemini con reglas del calendario y eventos por fuente (canvas/google)
  • Inferencia de materias desde títulos de Canvas

Hydration fix (PR #16)

  • suppressHydrationWarning en para extensiones del browser

🤖 Generated with Claude Code

danieldiazde and others added 5 commits May 9, 2026 14:03
- Install @google/genai SDK (gemini-2.5-flash)
- lib/gemini/client.ts: singleton Gemini client
- lib/gemini/prompts.ts: coach prompt with few-shot examples + structured output schema
- lib/scheduling/conflicts.ts: conflict detector with ±30m/1h/2h shift resolver
- api/gemini/test: smoke-test endpoint
- api/insights/generate: full pipeline — profile + materias + eventos → Gemini → conflict resolve → cache
- api/insights/current: read cached weekly insight
- api/profile/setup: save profile + materias_inscritas to Supabase
- README: sync schema to actual Supabase tables (fecha_inicio/fecha_fin, insights table)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Selectively brings in non-conflicting work from feat/a-data-foundation, adapting
imports to use our existing supabase helpers instead of the duplicate refactor.

Brought over as-is:
- 53 study plan JSONs in apps/frontend/data/planes/ (generaciones 19 y 26)
- apps/frontend/scripts/seed-planes.ts (uses service-role client, no app code)
- apps/frontend/src/lib/ical/parser.ts (Canvas iCal parser via node-ical)

Brought over with import adaptation (createClient -> getSupabaseServer):
- apps/frontend/src/lib/google/calendar.ts (read+write Google Calendar)
- apps/frontend/src/app/api/canvas/sync/route.ts
- apps/frontend/src/app/api/calendar/sync/route.ts
- apps/frontend/src/app/api/calendar/create/route.ts (powers ApplyBlocks button)

New (Persona A's branch did not include these):
- apps/frontend/src/app/api/planes/route.ts (list carreras from DB)
- apps/frontend/src/app/api/planes/[clave]/route.ts (single plan from DB)

Other:
- Add node-ical dependency
- Recover the dashboard column-name fix that was lost in PR #11's partial merge

Deliberately NOT brought in (would break our flow):
- Persona A's lib/supabase/{server,browser}.ts refactor (renames our helpers)
- Persona A's auth/callback (skips onboarding, redirects to non-existent /login)
- Persona A's profile/setup/route.ts (replaced by ours, which already matches schema)
- @google/generative-ai (deprecated package, we use @google/genai)

Also recovers commit f304883 (Gemini insights engine) which was missing from
PR #11's merge to dev for unknown reasons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Next's webpack bundle serializer mangles node-ical's BigInt usage during
"Collecting page data", causing `TypeError: g.BigInt is not a function`
on /api/canvas/sync. Treating it as an external Node module fixes the build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: integrate Persona A's data foundation (selective cherry-pick)
Browser extensions (ColorZilla, Grammarly, etc.) inject attributes like
cz-shortcut-listen onto <body> after SSR. Adding suppressHydrationWarning
silences the cosmetic hydration mismatch without masking real bugs since
it only applies to the body element itself.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@supabase
Copy link
Copy Markdown

supabase Bot commented May 9, 2026

This pull request has been ignored for the connected project jwqffychkaczvknfgzbd because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

danieldiazde and others added 3 commits May 9, 2026 14:28
The model was using ISO calendar weeks instead of the Tec21 academic calendar,
and only saw materias from materias_inscritas. Two fixes:

1. Tec21 calendar awareness
   - New lib/tec21/calendar.ts: given a semester start date, computes current
     block (1/2/3), week within block (1-5), and whether it's Semana Tec.
   - Stored per-user in profiles.semestre_inicio (depends on enrollment period).
   - Onboarding step 2 adds a date input for the semester start date.
   - Prompt updated with the 5+1+5+1+5 block pattern and rules about Semana Tec
     (no regular study blocks; project focus) and end-of-block urgency.

2. Canvas-aware context
   - Eventos passed to Gemini now include `fuente` (canvas/google/...).
   - Prompt rules: canvas events are deadlines and weigh heavily; google events
     are calendar blocks to avoid.
   - Materias inferred from Canvas event titles via clave regex
     (e.g. "TC2025 - Tarea 3"). If a clave appears in canvas events but not in
     materias_inscritas, it's added to context with `inferida: true` and the
     model is instructed to flag the discrepancy.

DB migration:
  ALTER TABLE profiles ADD COLUMN IF NOT EXISTS semestre_inicio date;

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(layout): suppress hydration warning on body
feat(ai): Tec21 calendar awareness + Canvas-aware materias
@danieldiazde danieldiazde changed the title release: integrate Persona A's data foundation release: Persona A integration + Tec21 calendar + hydration fix May 9, 2026
@danieldiazde danieldiazde merged commit 9525e17 into main May 9, 2026
3 checks passed
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.

1 participant