Files
.profile/ROADMAP.md

12 KiB
Raw Permalink Blame History

🗺️ Armonía del Ser — Ecosystem Engineering Roadmap

This document is the authoritative cross-repository engineering roadmap for Armonía del Ser (armonia-del-ser). It reconciles the operational discovery baseline, current codebase state across armonia-api, armonia-dashboard, and armonia-landing, and the active deliverables tracked in todo.txt.


🎯 Governing Architectural & Operational Invariants

  1. Separated Booking & Payment Truth (ADR-0002): Every booking tracks three orthogonal axes (booking_status, payment_arrangement, payment_status). Prepayment is the default (PREPAID_DEFAULT); delayed-payment exceptions (DELAYED_ALLOWED) are explicitly authorized and audited without falsifying payment_status.
  2. Deliberate Slot Release & 48-Hour Visibility (ADR-0002): Bookings never expire automatically on a background timer. At 48 hours prior to scheduled_at, unacknowledged bookings surface in GET /bookings/follow-up-queue so Jasmin's assistant can follow up via WhatsApp and either acknowledge payment, authorize delayed payment, or deliberately release the slot (RELEASED).
  3. Mandatory 1-on-1 Buffer Times (ADR-0003): Individual consultations enforce a post-session buffer interval (duration_minutes + buffer_minutes) to prevent appointment overruns.
  4. Server-Enforced Google OAuth + Turso Allowlist (ADR-0005): OAuth secrets and session signing keys live strictly in armonia-api. Every administrative request verifies the operator's email against Turso's admin_allowlist table and logs mutations in admin_audit_log.
  5. Infrastructure-Agnostic Layered Backend (armonia-api#6): FastAPI routers (app/routers/) act as pure HTTP transport, delegating domain rules to app/services/ and persistence to app/repositories/ backed by SQLModel + sqlalchemy-libsql (sqlite:///local.db locally, sqlite+libsql:// on Turso Cloud).
  6. Zero-Cost Infrastructure ($0/month): armonia-api runs scale-to-zero on Google Cloud Run with Turso free-tier edge SQLite; armonia-dashboard and armonia-landing deploy as static edge bundles on Cloudflare Pages.

📊 Milestone Overview

Milestone Title Target Repo(s) Gitea Issue(s) Status Summary
M0 Discovery, Architecture & Governance .profile, all repos armonia-api#1 ✅ Completed Operational discovery, SRS v1.1, ADRs 0001–0005, hierarchical AGENTS.md, per-repo Nix devShells (flake.nix), and .profile org repo.
M1 Core API MVP & Working-Tree Convergence armonia-api armonia-api#3 ✅ Completed Merged orthogonal state engine, 48h follow-up queue, delayed-payment exceptions, slot release, and Google OAuth + Turso allowlist (PR #7).
M2 SQLModel + Repository Refactor & Mutation Audit armonia-api armonia-api#6 🎯 Current / Up Next Decouple routers from raw SQL via SQLModel (app/models/), app/repositories/, and app/services/; add pytest-mock I/O isolation, mutmut boundary audits, GET /availability, and Group Roster API (/rosters).
M3 Google Calendar Pull + Push Coordination armonia-api armonia-api#4 ⏳ Planned Complete live Google Calendar API adapter (app/services/calendar.py), on-demand pull reconciliation during availability/agenda reads, and recoverable push sync (POST /bookings/{id}/sync-calendar).
M4 Admin Dashboard Control Surface armonia-dashboard armonia-dashboard#1 ⏳ Planned Scaffold Vite+ + Tailwind + HTMX + Biome mobile-first operator UI (48h follow-up queue, 1-tap payment acknowledgment, delayed-payment authorization, slot release, package & roster views).
M5 Public Landing & Self-Service Portal armonia-landing armonia-landing#1 ⏳ Planned Scaffold public service catalog, conflict-free slot picker (GET /availability), SPEI ADS-XXXX instructions, and 1-tap wa.me receipt handoff.

🔍 Issue Alignment Audit (Gitea Issues vs. Code Reality)

During our workspace audit on 2026-10-18, we identified three areas where original issue descriptions or working trees drifted from current reality:

  1. Uncommitted Working-Tree Accumulation (M0 / M1):
    • armonia-api (feat/operational-truth-mvp) currently holds 1,249+ lines of verified, passing code (orthogonal state engine, 48h follow-up queue, Google OAuth + Turso allowlist, CalendarService push/retry scaffold, and ADR-0005) alongside the new AGENTS.md and flake.nix.
    • armonia-dashboard (chore/operational-truth-docs) and armonia-landing (chore/agents-and-devshell) hold uncommitted AGENTS.md, README.md, and flake.nix updates.
    • Resolution: Before writing any new feature code, slice and commit the pending changes in all three repositories via /git-commit and open/merge their PRs.
  2. Stale Original Issue Bodies vs. Revised Comments (armonia-api#3, armonia-dashboard#1):
    • The original issue bodies still mention the superseded PENDING_PAYMENT 2-hour auto-expiration and static X-Admin-Key auth, whereas the 2026-10-18 15:10 comments specify the approved orthogonal model (RESERVED / RELEASED, PREPAID_DEFAULT / DELAYED_ALLOWED, AWAITING_ACKNOWLEDGMENT / ACKNOWLEDGED) and Turso admin_allowlist.
    • Remaining unimplemented items in armonia-api#3:
      • GET /availability endpoint (returning open slots factoring in duration_minutes + buffer_minutes).
      • Group Workshop Roster API (GET /rosters, POST /rosters/quick-checkin + attended tracking for $50 MXN workshops).
  3. Architecture Ordering (M2 before M3):
    • Extracting app/models/ (SQLModel), app/repositories/, and app/services/ (armonia-api#6) before expanding armonia-api with GET /availability, /rosters, and live Google Calendar pull-on-read (armonia-api#4) prevents writing more raw SQL in routers only to rewrite it later.

🛠️ Detailed Milestone Breakdown

Milestone M0: Discovery, Architecture & Workspace Governance

  • Conduct operational discovery with Jasmin and assistant (armonia-api#1).
  • Author SRS v1.1, system architecture, and ADRs 0001–0005.
  • Restructure AGENTS.md hierarchy across workspace root and sub-repositories.
  • Provision per-repository NixOS devShells (flake.nix + .envrc + flake.lock).
  • Track workspace root as armonia-del-ser/.profile on Gitea.
  • Commit and open PRs for AGENTS.md + flake.nix in armonia-dashboard (PR #3) and armonia-landing (PR #3).

Milestone M1: Core API MVP Convergence (armonia-api#3)

  • Implement orthogonal booking & payment state engine (booking_status, payment_arrangement, payment_status).
  • Implement 48-hour follow-up visibility queue (GET /bookings/follow-up-queue), delayed-payment authorization, and deliberate slot release (RELEASED).
  • Implement Google OAuth2 login/callback + Turso admin_allowlist & admin_audit_log.
  • Slice, commit (git-commit), and open PR for feat/operational-truth-mvp in armonia-api (PR #7).

Milestone M2: SQLModel + Repository Refactor & Mutation Testing (armonia-api#6)

  • Add sqlmodel, sqlalchemy-libsql, pytest-mock, and mutmut to armonia-api/pyproject.toml.
  • Define SQLModel table entities in app/models/ and configure app/db/database.py for Turso/SQLite portability.
  • Extract all SQL queries from app/routers/ into app/repositories/ and pure business logic into app/services/.
  • Isolate external I/O in tests using pytest-mock and run mutmut audit against app/services/ (100% kill score, ADR 0006).
  • Implement GET /availability and Group Roster API (GET /rosters, POST /rosters/quick-checkin) cleanly on top of the new service/repository layers (armonia-api#3).
  • Decouple auth adapter for proxy-headers (Authelia/LLDAP) and add multi-stage container build (Dockerfile).

Milestone M3: Google Calendar Pull + Push Coordination (armonia-api#4)

  • Implement real Google Calendar REST integration in app/services/calendar.py (with pytest-mock test coverage).
  • Implement Pull-on-Read schedule reconciliation during GET /availability and agenda reads.
  • Verify end-to-end Push-on-Write status transitions ([PAGO PENDIENTE], [PAGO DIFERIDO], [CONFIRMADO], event deletion on RELEASED/CANCELLED) and manual retry (POST /bookings/{id}/sync-calendar).

Milestone M4: Mobile-First Admin Dashboard (armonia-dashboard#1)

  • Initialize Vite+ (vp), Tailwind CSS, HTMX, and Biome in armonia-dashboard.
  • Delegate to Anne Droid (feat/anne/*) to implement the 5-state resilient operator views (>= 44x44px touch targets):
    • 48-Hour Payment Follow-Up Queue with 1-tap wa.me links, Acknowledge Payment, and immediate visual feedback (PR #4).
    • Agenda & buffer indicator (15-min buffers rendered visually).
    • Accessible toasts, inline micro-modals, agenda date filter, and sticky mobile nav (PR #5).
    • Multi-session package counter (8 de 10) & Group Workshop Roster check-in view.

Milestone M5: Operator Intake, Client Directory & Dynamic Identity (armonia-dashboard#6, armonia-dashboard#7)

  • Replace static header span with dynamic operator identity pill from GET /auth/me.
  • Implement global "+ Nueva Cita" intake modal with service selector and WhatsApp confirmation handoff.
  • Connect client autocomplete search in intake modal against GET /clients?search=.
  • Add interactive card actions on Agenda: "Mover Cita" (reschedule) and "Marcar Concluida" (complete).
  • Add Client Directory view with search, notes editing, and active package counter (Sesión 8 de 10).

Milestone M6: Clients CRUD & Booking Lifecycle (armonia-api#12, armonia-api#13)

  • Implement GET /clients, POST /clients, GET /clients/{id}, PATCH /clients/{id}, and DELETE /clients/{id}.
  • Implement client 360 profile returning consultation history, active packages, and clinical notes.
  • Implement POST /bookings/{id}/reschedule with collision & 15-min buffer protection and calendar sync.
  • Implement POST /bookings/{id}/complete to transition status to COMPLETED and update package sessions.

Milestone M7: Public Landing & Self-Service Portal (armonia-landing#1)

  • Initialize Vite+ (vp), Tailwind CSS, HTMX, and Biome in armonia-landing.
  • Delegate to Anne Droid (feat/anne/*) to implement the holistic landing page & self-service booking flow:
    • Service catalog cards (PRESENCIAL & ONLINE).
    • Live conflict-free slot picker consuming GET /availability.
    • Reservation confirmation with ADS-XXXX folio, SPEI CLABE instructions, and 1-tap WhatsApp receipt handoff.