From c150c70f5ae1c225e6110d4d570376f24aca8d35 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Mon, 19 Oct 2026 00:09:22 -0500 Subject: [PATCH] docs(roadmap): add workspace ROADMAP.md, tuxedo todo.txt, and git-commit handoff rules - Add cross-repository engineering ROADMAP.md (Milestones M0-M5) synchronized with Gitea milestones and issues. - Add root todo.txt formatted for tuxedo and todo.sh tracking completed M0 tasks and prioritized (A)-(C) backlog. - Codify the Immediate git-commit Handoff Rule and Section 5 Live Task Tracking in root AGENTS.md. - Link ROADMAP.md and todo.txt from the organization profile README.md. --- AGENTS.md | 15 +++++++-- README.md | 2 ++ ROADMAP.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ todo.txt | 18 +++++++++++ 4 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 ROADMAP.md create mode 100644 todo.txt diff --git a/AGENTS.md b/AGENTS.md index 97418ef..c61a847 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,6 +8,7 @@ For operational context & ecosystem topology: [See README](./README.md) ## 1. System Discovery & Single Source of Truth (SSOT) Do not assume architectural requirements or business logic rules. You must explicitly read the dedicated documentation inside each repository before modifying or writing code: +- **Trajectory & Active Work (`ROADMAP.md` & `todo.txt`):** Read the root [`ROADMAP.md`](./ROADMAP.md) and [`todo.txt`](./todo.txt) to verify the current milestone and active task priorities before starting work. - **Repository Technical Blueprint:** Read the local `AGENTS.md` inside the target sub-repository (`armonia-api/`, `armonia-dashboard/`, or `armonia-landing/`) for repository-specific architecture, Nix `devShell` setup, and verification commands. - **Product Requirements & Domain Model:** Review `docs/SRS.md` in the relevant repository. - **System Topography:** Review `docs/architecture.md`. @@ -34,8 +35,9 @@ Before writing, modifying, or refactoring any code, you must execute the followi - **Chores/Refactors:** `chore/` (e.g., `chore/bump-dependencies`) ### Commit & Push Policy -- **Main Protection:** **NEVER** commit or push changes directly to the `main` branch. +- **Main Protection:** **NEVER** commit or push changes directly to the `main` branch of sub-repositories (`armonia-api`, `armonia-dashboard`, `armonia-landing`). - **Format:** Follow the [Conventional Commits](https://conventionalcommits.org) specification. +- **Immediate `git-commit` Handoff Rule (Anti-Accumulation):** Never let verified changes accumulate across multiple tasks or milestones in a dirty working tree. Immediately after completing and verifying a deliverable (and marking it done in `todo.txt`), invoke the `git-commit` skill (`/git-commit`) to slice, review, and commit the changes atomically, followed by `commit-logger`. - **NixOS SSH Push Rule:** Prefix Git network push/pull operations with bypass flags to account for Nix store symlinks: ```bash GIT_SSH_COMMAND="ssh -F /dev/null" git push @@ -62,7 +64,7 @@ Each sub-repository provides its own Nix `devShell` (`flake.nix` + `.envrc`) and ## 4. Gitea Organization & CLI (`tea`) Protocol -All repositories are hosted inside the private Gitea instance. Do not make unauthenticated external requests; always leverage the pre-configured `tea` CLI. +All repositories are hosted inside the private Gitea instance (`armonia-del-ser`). Do not make unauthenticated external requests; always leverage the pre-configured `tea` CLI. ### Core Commands - **List Repository Issues:** `tea issues list --repo armonia-del-ser/` @@ -74,3 +76,12 @@ All repositories are hosted inside the private Gitea instance. Do not make unaut 1. **Traceability:** Reference the working Gitea issue number in branch headers and commit message footers (e.g., `Refs: #1`). 2. **Secret Safety:** Never print or parse credentials, and never expose paths matching `~/.config/tea/config.yml` on terminal logs. +--- + +## 5. Live Task Tracking (`todo.txt`) & Roadmap Synchronization + +For multi-step engineering milestones and deliverables across the workspace: +- **Standard `todo.txt` Format:** Maintain a comment-free, header-free [`todo.txt`](./todo.txt) at the workspace root formatted for `tuxedo` and `todo.sh` (`~/Config/home/shell/todo.sh`). +- **Syntax & Metadata:** Prioritize deliverables using `(A)`, `(B)`, `(C)` priorities, project tags (`+api`, `+dashboard`, `+landing`, `+workspace`), contexts (`@arch`, `@db`, `@auth`, `@gcal`, `@ui`, `@git`, `@test`), and issue references (`issue:armonia-api#6`). +- **Immediate Completion Sync:** Keep `todo.txt` and [`ROADMAP.md`](./ROADMAP.md) synchronized with code reality. When a deliverable is implemented and verified, mark it completed (`x YYYY-MM-DD ...`) immediately before handing off to `git-commit`. Never leave verified work marked as pending or untracked. + diff --git a/README.md b/README.md index 080509d..887b058 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ The project is structured into decoupled repositories with concrete roles: | **`armonia-dashboard`** | `armonia-dashboard/` | Administrative mobile-first operational control surface for operators to review, follow-up, and acknowledge payments, authorize delayed-payment exceptions, release slots, and track packages. | Cloudflare Pages ($0 free tier) | [Vite+](https://viteplus.dev/), [Tailwind](https://tailwindcss.com/), [HTMX](https://htmx.org/), [Biome](https://biomejs.dev/) | | **`armonia-landing`** | `armonia-landing/` | Public client-facing landing page, catalog showcase, and self-service reservation portal. | Cloudflare Pages ($0 free tier) | [Vite+](https://viteplus.dev/), [Tailwind](https://tailwindcss.com/), [HTMX](https://htmx.org/), [Biome](https://biomejs.dev/) | +> 🗺️ **Engineering Trajectory & Active Tasks:** See [`ROADMAP.md`](./ROADMAP.md) and [`todo.txt`](./todo.txt). + ```mermaid flowchart TD CV[Clients / Visitors] --> AL[armonia-landing] diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000..2706194 --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,90 @@ +# 🗺️ Armonía del Ser — Ecosystem Engineering Roadmap + +This document is the authoritative cross-repository engineering roadmap for **Armonía del Ser** ([`armonia-del-ser`](https://gitea.roadtotech.me/armonia-del-ser)). It reconciles the operational discovery baseline, current codebase state across [`armonia-api`](https://gitea.roadtotech.me/armonia-del-ser/armonia-api), [`armonia-dashboard`](https://gitea.roadtotech.me/armonia-del-ser/armonia-dashboard), and [`armonia-landing`](https://gitea.roadtotech.me/armonia-del-ser/armonia-landing), and the active deliverables tracked in [`todo.txt`](./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`](https://gitea.roadtotech.me/armonia-del-ser/armonia-api/issues/1) | 🔄 **In Progress (Finalizing PRs)** | Operational discovery, SRS v1.1, ADRs `0001`–`0005`, hierarchical `AGENTS.md`, per-repo Nix `devShell`s (`flake.nix`), and `.profile` org repo. | +| **M1** | **Core API MVP & Working-Tree Convergence** | `armonia-api` | [`armonia-api#3`](https://gitea.roadtotech.me/armonia-del-ser/armonia-api/issues/3) | 🎯 **Up Next (Immediate)** | Commit & PR existing verified orthogonal state engine, 48h follow-up queue, Google OAuth + Turso allowlist; add `GET /availability` and Group Roster API (`/rosters`). | +| **M2** | **SQLModel + Repository Refactor & Mutation Audit** | `armonia-api` | [`armonia-api#6`](https://gitea.roadtotech.me/armonia-del-ser/armonia-api/issues/6) | ⏳ **Planned** | Decouple routers from raw SQL via `SQLModel` (`app/models/`), `app/repositories/`, and `app/services/`; add `pytest-mock` I/O isolation and `mutmut` boundary audits. | +| **M3** | **Google Calendar Pull + Push Coordination** | `armonia-api` | [`armonia-api#4`](https://gitea.roadtotech.me/armonia-del-ser/armonia-api/issues/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`](https://gitea.roadtotech.me/armonia-del-ser/armonia-dashboard/issues/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`](https://gitea.roadtotech.me/armonia-del-ser/armonia-landing/issues/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 +- [x] Conduct operational discovery with Jasmin and assistant (`armonia-api#1`). +- [x] Author SRS v1.1, system architecture, and ADRs `0001`–`0005`. +- [x] Restructure `AGENTS.md` hierarchy across workspace root and sub-repositories. +- [x] Provision per-repository NixOS `devShell`s (`flake.nix` + `.envrc` + `flake.lock`). +- [x] Track workspace root as `armonia-del-ser/.profile` on Gitea. +- [ ] Commit and open PRs for `AGENTS.md` + `flake.nix` in `armonia-dashboard` and `armonia-landing`. + +### Milestone M1: Core API MVP Convergence (`armonia-api#3`) +- [x] Implement orthogonal booking & payment state engine (`booking_status`, `payment_arrangement`, `payment_status`). +- [x] Implement 48-hour follow-up visibility queue (`GET /bookings/follow-up-queue`), delayed-payment authorization, and deliberate slot release (`RELEASED`). +- [x] Implement Google OAuth2 login/callback + Turso `admin_allowlist` & `admin_audit_log`. +- [ ] Slice, commit (`git-commit`), and open PR for the uncommitted `feat/operational-truth-mvp` work in `armonia-api`. + +### 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/`. +- [ ] 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`). + +### 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): + - Google OAuth login & session guard. + - 48-Hour Payment Follow-Up Queue with 1-tap `wa.me` links, Acknowledge Payment, Authorize Delayed Payment, and Release Slot actions. + - Agenda & Google Calendar sync health indicator (`SYNCED` vs `FAILED` retry). + - Multi-session package counter (`8 de 10`) & Group Workshop Roster check-in. + +### Milestone M5: 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. diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..3787991 --- /dev/null +++ b/todo.txt @@ -0,0 +1,18 @@ +x 2026-10-18 (A) Conduct operational discovery with Jasmin and assistant and document SRS v1.1 and ADRs 0001-0005 +api @arch issue:armonia-api#1 +x 2026-10-18 (A) Restructure AGENTS.md hierarchy across workspace root and sub-repositories +workspace @arch +x 2026-10-18 (A) Provision and verify per-repository NixOS flake.nix and .envrc devShells +workspace @infra +x 2026-10-18 (A) Initialize workspace root as armonia-del-ser/.profile repository on Gitea +workspace @git +(A) Slice and commit pending AGENTS.md, README.md, and flake.nix changes in armonia-dashboard and open PR +dashboard @git +(A) Slice and commit pending AGENTS.md, README.md, and flake.nix changes in armonia-landing and open PR +landing @git +(A) Slice and commit pending orthogonal state engine, OAuth allowlist, AGENTS.md, and flake.nix changes in armonia-api and open PR +api @git issue:armonia-api#3 +(B) Add sqlmodel, sqlalchemy-libsql, pytest-mock, and mutmut dependencies to armonia-api/pyproject.toml +api @db issue:armonia-api#6 +(B) Define SQLModel table models in armonia-api/app/models/ and configure portable engine in app/db/database.py +api @db issue:armonia-api#6 +(B) Extract raw SQL queries from FastAPI routers into armonia-api/app/repositories/ and domain logic into app/services/ +api @arch issue:armonia-api#6 +(B) Isolate external I/O with pytest-mock and run mutmut boundary audit on armonia-api/app/services/ +api @test issue:armonia-api#6 +(B) Implement GET /availability endpoint with mandatory buffer collision filtering in armonia-api +api @backend issue:armonia-api#3 +(B) Implement Group Workshop Roster API (GET /rosters, POST /rosters/quick-checkin) in armonia-api +api @backend issue:armonia-api#3 +(C) Implement live Google Calendar API Pull-on-Read and Push-on-Write synchronization in armonia-api/app/services/calendar.py +api @gcal issue:armonia-api#4 +(C) Scaffold Vite+, Tailwind, HTMX, and Biome project structure in armonia-dashboard +dashboard @ui issue:armonia-dashboard#1 +(C) Implement 48-hour follow-up queue, payment acknowledgment, and agenda views in armonia-dashboard with Anne Droid +dashboard @ui issue:armonia-dashboard#1 +(C) Scaffold Vite+, Tailwind, HTMX, and Biome project structure in armonia-landing +landing @ui issue:armonia-landing#1 +(C) Implement public service catalog, slot picker, and SPEI WhatsApp handoff in armonia-landing with Anne Droid +landing @ui issue:armonia-landing#1