9 Commits
Author SHA1 Message Date
kiskaadee b8af53adb3 Merge pull request 'docs(todo): track structured error codes for 409 responses (armonia-api#15)' (#10) from docs/todo-m5-roster-error-codes into main 2026-10-29 13:54:35 -05:00
kiskaadee 97922a73d9 docs(todo): add m5 backend structured error code task (armonia-api#15) 2026-10-29 13:54:24 -05:00
kiskaadee c4532a1799 Merge pull request 'docs(pilot): record qa scorecard evidence and complete m4 workshop roster in roadmap and todo' (#9) from docs/m4-roster-tracking-and-qa-evidence into main 2026-10-29 13:43:48 -05:00
kiskaadee 187aad6f96 docs(pilot): record qa scorecard evidence and complete m4 workshop roster in roadmap and todo 2026-10-29 13:43:26 -05:00
kiskaadee ab02870dce chore(git): ignore ephemeral agent worktrees in .worktrees/
Prevent ephemeral agent worktrees created under .worktrees/ from being tracked by git.
2026-10-26 21:32:47 -05:00
kiskaadee 2f76184b37 Merge pull request 'docs(pilot): fix database url reference in workshop roster verification script' (#8) from docs/fix-roster-verification-packet-path into main 2026-10-26 09:34:56 -05:00
kiskaadee a7f7799362 docs(pilot): fix database url reference in workshop roster verification script
Replace undefined `db_filename` with `abs_db_path` in `settings.database_url` assignment, ensuring the standalone verification runner cleanly anchors to the isolated test database path.
2026-10-26 09:31:14 -05:00
kiskaadee 070dfd21d5 Merge pull request 'docs(pilot): ratify group workshop roster collaboration plan, spec, and qa packet' (#7) from docs/workshop-roster-pilot into main 2026-10-26 09:20:53 -05:00
kiskaadee 2d76328655 docs(pilot): ratify group workshop roster collaboration plan, spec, and qa packet
- add multi-agent collaboration plan establishing orchestrator, anne droid,
  and independent qa boundaries
- define functional specification contract for group workshop roster quick check-in
- provide frozen environment verification packet with test personas for blind qa
2026-10-26 09:19:14 -05:00
28 changed files with 797 additions and 1 deletions

No files matched your search

+3
View File
@@ -12,3 +12,6 @@ raw_feedback.md
.idea/ .idea/
*.swp *.swp
.direnv/ .direnv/
# Ephemeral agent worktrees
.worktrees/
+1 -1
View File
@@ -81,7 +81,7 @@ During our workspace audit on `2026-10-18`, we identified three areas where orig
- [x] 48-Hour Payment Follow-Up Queue with 1-tap `wa.me` links, Acknowledge Payment, and immediate visual feedback (PR #4). - [x] 48-Hour Payment Follow-Up Queue with 1-tap `wa.me` links, Acknowledge Payment, and immediate visual feedback (PR #4).
- [x] Agenda & buffer indicator (15-min buffers rendered visually). - [x] Agenda & buffer indicator (15-min buffers rendered visually).
- [x] Accessible toasts, inline micro-modals, agenda date filter, and sticky mobile nav (PR #5). - [x] 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. - [x] Multi-session package counter (`8 de 10`) & Group Workshop Roster check-in view (PR #9).
### Milestone M5: Operator Intake, Client Directory & Dynamic Identity (`armonia-dashboard#6`, `armonia-dashboard#7`) ### Milestone M5: Operator Intake, Client Directory & Dynamic Identity (`armonia-dashboard#6`, `armonia-dashboard#7`)
- [x] Replace static header span with dynamic operator identity pill from `GET /auth/me`. - [x] Replace static header span with dynamic operator identity pill from `GET /auth/me`.
+256
View File
@@ -0,0 +1,256 @@
# Independent QA Evidence Scorecard: Group Workshop Roster Quick Check-in
> **Status:** Ratified & Frozen
> **Evaluation Date:** 2026-10-27
> **Evaluator:** Independent QA Specialist (Phase 4 Verification)
> **Governing Verification Contract:** [`VERIFICATION-PACKET-ROSTER.md`](file:///home/kiskaadee/Projects/active/armonia/docs/pilot/VERIFICATION-PACKET-ROSTER.md)
> **Release Authority:** None (Independent verification report submitted to Orchestrator)
---
## 1. Information Barrier Compliance Declaration
In strict compliance with QA Operational Invariant #1:
- Verification was conducted entirely via black-box interaction with the live frontend UI (`http://localhost:5173`) and running backend API (`http://localhost:8000`).
- Zero inspection of implementation source code (`src/` in dashboard, backend route implementations), pull request discussions, or developer self-audit was performed.
- All evaluation criteria were derived solely from the ratified Gate 2 Verification Packet.
---
## 2. Test Environment & Runtime Verification
| Component | Target URL / Port | Runtime Process | Database Target |
| :--- | :--- | :--- | :--- |
| **Frontend UI** | `http://localhost:5173` | Vite v8.3.4 (PID 1520429) | N/A (Consumes Backend API) |
| **Backend API** | `http://localhost:8000` | FastAPI / Uvicorn (PID 1535519) | SQLite (`test_armonia.db`) |
| **Headless Engine**| Chrome 155.0.8059.84 | Playwright / Chromium Driver | Linux x86_64 |
Preflight assertions formally confirmed:
1. `circulo-cacao-presencial` initialized with `max_capacity = 15`.
2. Today's session anchored at 18:00 hrs local business time (`2026-10-26`).
3. Seed attendees: Elena Gómez (`ADS-1001`, `RESERVED`, `ACKNOWLEDGED`, `attended: false`) and Carlos Méndez (`ADS-1002`, `RESERVED`, `AWAITING_ACKNOWLEDGMENT`, `attended: false`).
4. Preflight API check returned `occupied_count: 2`, `attended_count: 0`.
---
## 3. Executive Scorecard: Acceptance Criteria & Scenario Matrix
| Scenario & Criterion | Acceptance Criterion Description | Verified Persistence | Final Verdict |
| :--- | :--- | :--- | :---: |
| **Scenario 1 (`AC-1`)** | Navigation via top bar updates URL to `#rosters`, sets `aria-selected="true"`, renders workshop card at 18:00 hrs with `Ocupación: 2 / 15 (0 presentes)`. | N/A (Read) | **`PASS`** |
| **Scenario 2 (`AC-1`, `AC-2`)** | Roster lists Elena Gómez (`ADS-1001`, `REGISTRADO`, `PAGADO`) and Carlos Méndez (`ADS-1002`, `REGISTRADO`, `PENDIENTE`); direct WhatsApp links (`wa.me/...`) rendered. | N/A (Read) | **`PASS`** |
| **Scenario 3 (`AC-3`)** | Pre-paid Check-in for Elena Gómez: POST HTTP 200 (`paid_cash: false`), badge updates to `ASISTIÓ`, counter updates to `Ocupación: 2 / 15 (1 presentes)`, accessible toast displayed. | **F5 Reload & Backend API** | **`PASS`** |
| **Scenario 4 (`AC-4`)** | Cash Collection Check-in for Carlos Méndez: Checkbox checked, POST HTTP 200 (`paid_cash: true`), badge updates to `ASISTIÓ`, payment updates from `PENDIENTE` to `PAGADO`, counter to `2 presentes`. | **F5 Reload & Backend API** | **`PASS`** |
| **Scenario 5 (`AC-5`)** | Walk-In Registration: Modal opens, cash toggle defaults to checked (`true`), submit button prevents double-submission under rapid double-click, exactly 1 record created (`Lucía Vega`), counter to `3 / 15 (3 presentes)`. | **F5 Reload & Backend API** | **`PASS`** |
| **Scenario 6A (`AC-6`)** | 409 Conflict Disambiguation (Already Checked-In): Out-of-band check-in triggers HTTP 409; UI catches error, displays toast (*"El asistente ya contaba con asistencia registrada"*), reconciles row to `ASISTIÓ` without application crash. | UI State Reconciled | **`PASS`** |
| **Scenario 6B (`AC-6`)** | 409 Conflict Disambiguation (Capacity Reached): At capacity limit, walk-in returns HTTP 409 (`"El taller ha alcanzado su cupo máximo..."`); UI displays explicit alert, preserves form inputs, blocks insertion. | Form Data Preserved | **`PASS`** |
| **Scenario 7 (`AC-6`)** | Network Outage & Actionable Retry: Backend shutdown triggers error banner (*"No se pudieron cargar los talleres. Verifica tu conexión."*) with "Reintentar" button; backend restoration + clicking "Reintentar" recovers session card seamlessly without page reload. | Actionable Recovery | **`PASS`** |
| **Scenario 8 (`AC-7`)** | Mobile Ergonomics & Accessibility Tree: Viewport 375x812 displays zero horizontal scroll overflow; all check-in buttons, toggles, and modal inputs have touch bounding boxes $\ge 44 \times 44$ px; keyboard tab navigation exhibits visible focus outlines; toast container possesses `role="status"` and `aria-live="polite"`. | Viewport & A11y Tree | **`PASS`** |
---
## 4. Consequential Mutation Verification Audit
Every state-mutating scenario was validated through a three-stage assertion cycle:
1. **In-Session Reactive DOM Verification**: Immediate visual badge transitions and counter updates.
2. **Browser Reload Persistence (`F5`)**: Hard refresh to verify local cache re-hydration and state permanence.
3. **Out-of-Band Backend API Query**: Direct `GET /rosters?date_from=2026-10-26&date_to=2026-10-26` with Bearer auth token.
### Mutation Audit Table
| Scenario | Target Attendee | State Mutation Verified | F5 Reload Result | Backend API Read Payload Verification | Verdict |
| :--- | :--- | :--- | :--- | :--- | :---: |
| **Scenario 3** | Elena Gómez (`ADS-1001`) | `attended: false` $\rightarrow$ `true` | Badge: `ASISTIÓ`<br/>Counter: `1 presentes` | `{"booking_code": "ADS-1001", "attended": true}`<br/>`"attended_count": 1` | **`PASS`** |
| **Scenario 4** | Carlos Méndez (`ADS-1002`) | `attended: false` $\rightarrow$ `true`<br/>`payment_status: "AWAITING_ACKNOWLEDGMENT"` $\rightarrow$ `"ACKNOWLEDGED"` | Badge: `ASISTIÓ`<br/>Badge: `PAGADO`<br/>Counter: `2 presentes` | `{"booking_code": "ADS-1002", "attended": true, "payment_status": "ACKNOWLEDGED"}`<br/>`"attended_count": 2` | **`PASS`** |
| **Scenario 5** | Lucía Vega (Walk-In) | New booking created<br/>`attended: true`<br/>`payment_status: "ACKNOWLEDGED"` | Attendee listed<br/>Counter: `3 / 15 (3 presentes)` | `{"client_name": "Lucía Vega", "attended": true, "payment_status": "ACKNOWLEDGED"}`<br/>`"occupied_count": 3, "attended_count": 3` | **`PASS`** |
| **Scenario 6A** | Elena Gómez (`ADS-1001`) | Duplicate check-in rejected with 409 Conflict | Badge reconciles to `ASISTIÓ` | `{"booking_code": "ADS-1001", "attended": true}` | **`PASS`** |
| **Scenario 6B** | Sofía Castro (Walk-In) | Rejected with 409 Conflict (Capacity reached) | No attendee added<br/>Counter remains `2 / 2` | Attendee `"Sofía Castro"` is absent from backend API roster | **`PASS`** |
---
## 5. Observable Evidence Dossier & Artifact Citations
All visual evidence has been captured using headless Google Chrome and stored under `/home/kiskaadee/Projects/active/armonia/docs/evidence/qa/`:
### Visual Evidence Index
1. **Scenario 1 — Navigation, Hash & Capacity Overview:**
- Evidence file: [`scenario_1_navigation_capacity.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_1_navigation_capacity.png)
- Highlights: URL hash `#rosters`, tab `aria-selected="true"`, card title "Círculo de Cacao (Presencial)", time 18:00 hrs, counter `Ocupación: 2 / 15 (0 presentes)`.
2. **Scenario 2 — Roster Rendering & WhatsApp Direct Links:**
- Evidence file: [`scenario_2_roster_badges.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_2_roster_badges.png)
- Highlights: Elena Gómez (`ADS-1001`, `REGISTRADO`, `PAGADO`), Carlos Méndez (`ADS-1002`, `REGISTRADO`, `PENDIENTE`), direct WhatsApp anchor links `wa.me/525511112222` and `wa.me/525533334444`.
3. **Scenario 3 — Pre-paid Check-in & Persistence:**
- Action Screenshot: [`scenario_3_prepaid_checkin.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_3_prepaid_checkin.png)
- Reload Screenshot: [`scenario_3_persistence_reload.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_3_persistence_reload.png)
- HTTP Request: `POST http://localhost:8000/rosters/quick-checkin`
```json
{"booking_id": "b1111111-1111-1111-1111-111111111111", "paid_cash": false}
```
- HTTP Response: `HTTP 200 OK`
```json
{
"walk_in": false,
"attendee": {
"booking_id": "b1111111-1111-1111-1111-111111111111",
"booking_code": "ADS-1001",
"booking_status": "COMPLETED",
"payment_status": "ACKNOWLEDGED",
"attended": true
},
"payment_id": null
}
```
4. **Scenario 4 — Cash Collection Check-in & Payment Transition:**
- Action Screenshot: [`scenario_4_cash_checkin.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_4_cash_checkin.png)
- Reload Screenshot: [`scenario_4_persistence_reload.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_4_persistence_reload.png)
- HTTP Request: `POST http://localhost:8000/rosters/quick-checkin`
```json
{"booking_id": "b2222222-2222-2222-2222-222222222222", "paid_cash": true, "notes": "Cobro en puerta"}
```
- HTTP Response: `HTTP 200 OK`
```json
{
"walk_in": false,
"attendee": {
"booking_id": "b2222222-2222-2222-2222-222222222222",
"booking_code": "ADS-1002",
"payment_status": "ACKNOWLEDGED",
"attended": true
},
"payment_id": "f69f2d53-1cc5-423a-87b7-0b693a6718ef"
}
```
5. **Scenario 5 — Walk-In Registration & Double-Submission Defense:**
- Modal Open Screenshot: [`scenario_5_walkin_modal.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_5_walkin_modal.png)
- Registered Roster Screenshot: [`scenario_5_walkin_registered.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_5_walkin_registered.png)
- Reload Screenshot: [`scenario_5_persistence_reload.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_5_persistence_reload.png)
- Double-Submission Test: Button disabled immediately upon initial click; rapid second click was ignored/blocked. Exactly 1 POST response received.
- Result: Lucía Vega added with `ASISTIÓ` and `PAGADO`. Capacity updated to `3 / 15 (3 presentes)`.
6. **Scenario 6 — 409 Conflict Disambiguation:**
- Case 6A Screenshot: [`scenario_6a_conflict_already_checked_in.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_6a_conflict_already_checked_in.png)
- API 409 Payload: `{"detail": "This attendee has already checked in."}`
- UI Feedback: Toast notification `"El asistente ya contaba con asistencia registrada"`.
- Case 6B Screenshot: [`scenario_6b_conflict_capacity_reached.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_6b_conflict_capacity_reached.png)
- API 409 Payload: `{"detail": "El taller ha alcanzado su cupo máximo (2) para esta sesión."}`
- UI Feedback: Explicit error banner inside modal; modal inputs (`Sofía Castro`, `525512345678`) preserved; attendee list unaffected.
7. **Scenario 7 — Network Outage & Actionable Retry:**
- Error Banner Screenshot: [`scenario_7_backend_down_error.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_7_backend_down_error.png)
- Seamless Recovery Screenshot: [`scenario_7_retry_success.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_7_retry_success.png)
- UI Behavior: Displays `"No se pudieron cargar los talleres. Verifica tu conexión."` and "Reintentar" button. Upon clicking "Reintentar" after server restart, the session card re-hydrated without browser reload.
8. **Scenario 8 — Mobile Ergonomics & Accessibility:**
- Mobile 375px Roster Screenshot: [`scenario_8_mobile_375px.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_8_mobile_375px.png)
- Mobile Walk-in Modal Screenshot: [`scenario_8_mobile_modal_375px.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_8_mobile_modal_375px.png)
- Keyboard Focus Screenshot: [`scenario_8_keyboard_focus.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_8_keyboard_focus.png)
- Touch Target Dimensions:
- `Registrar Asistencia` button: `313.0px x 44.0px`
- `+ Registrar Asistente Sin Cita` button: `313.0px x 44.0px`
- Cash toggle wrapper (`.cash-toggle-label`): `313.0px x 44.0px`
- Modal Name input (`#walkin-name`): `295.0px x 44.0px`
- Modal Phone input (`#walkin-phone`): `295.0px x 44.0px`
- Modal Email input (`#walkin-email`): `295.0px x 44.0px`
- Modal Cash checkbox label: `295.0px x 44.0px`
- Modal Submit button: `191.8px x 54.0px`
- Modal Cancel button: `93.2px x 54.0px`
- Modal Close button: `44.0px x 44.0px`
- A11y Tree: Toast container has `role="status"` and `aria-live="polite"`.
---
## 6. Console Log Audit & Defect Summary
- **Total Uncaught JavaScript Exceptions:** **0**
- **Console Errors Observed:** Zero uncaught runtime errors.
- **Contract Frictions or Anomalies:** None. The API contracts for quick check-in (`POST /rosters/quick-checkin`) and roster retrieval (`GET /rosters`) match the ratified specification in all respects, including idempotency behavior, cash attribution, capacity enforcement, and date boundary formatting.
---
## 7. QA Verdict & Conclusion
The implementation of the **Group Workshop Roster Quick Check-in** feature on branch `feat/anne/workshop-roster` satisfies 100% of the acceptance criteria defined in `VERIFICATION-PACKET-ROSTER.md` (`AC-1` through `AC-7`).
**Formal QA Verdict: `ALL SCENARIOS PASS` (8 / 8 PASS, 0 FAIL, 0 BLOCKED).**
---
## 8. Phase 4.1 Targeted Regression Addendum
**Execution Date:** 2026-10-27
**Scope:** Targeted live browser DOM regressions for adversarial HTML/XSS input sanitization and out-of-band 409 counter consistency.
### 8.1 Test 1: Adversarial HTML / XSS Input Regression (Live Browser DOM)
- **Test Target:** Walk-In Registration modal form input handling (`#walkin-name`) and DOM projection.
- **Input Payload:** `Lucía <img src=x onerror="window.__xss_triggered=true"> "Vega" & Co.`
- **Phone:** `525598765432`
- **Initial Baseline:** `Ocupación: 2 / 15 (0 presentes)`.
#### Live DOM & Post-F5 Reload Observations
| Checkpoint | Expected Behavior | Live DOM Measurement | Post-F5 Reload Measurement | Verdict |
| :--- | :--- | :--- | :--- | :---: |
| **XSS Breakout Prevention** | `window.__xss_triggered === undefined` (zero script execution) | `null` / `undefined` | `null` / `undefined` | **`PASS`** |
| **HTML Element Injection** | Zero `<img>` elements rendered inside `.roster-attendee-row` | `0` `<img>` tags found | `0` `<img>` tags found | **`PASS`** |
| **Name Text Content** | Exact string preserved via text node assignment | `Lucía <img src=x onerror="window.__xss_triggered=true"> "Vega" & Co.` | `Lucía <img src=x onerror="window.__xss_triggered=true"> "Vega" & Co.` | **`PASS`** |
| **Attribute Escaping** | `.btn-wa-link[aria-label]` intact, not truncated by double quotes | `Contactar a Lucía <img src=x onerror="window.__xss_triggered=true"> "Vega" & Co. por WhatsApp` | `Contactar a Lucía <img src=x onerror="window.__xss_triggered=true"> "Vega" & Co. por WhatsApp` | **`PASS`** |
| **Backend API Invariant** | Direct `GET /rosters` returns exact payload without mutation | `client_name`: exact string stored and returned in JSON | Persistent across server restarts | **`PASS`** |
- **Screenshot Evidence:** [`scenario_9_xss_sanitization.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_9_xss_sanitization.png)
- **Verdict: `PASS`**.
---
### 8.2 Test 2: Live Out-of-Band 409 Counter Consistency (Single vs. Multi-Mutation)
#### Case 2A: Single Out-of-Band Check-in
1. Session initialized to `Ocupación: 2 / 15 (0 presentes)`.
2. Out-of-band API check-in executed for Elena Gómez (`ADS-1001`, `b1111111-1111-1111-1111-111111111111`).
3. Authoritative server state via `GET /rosters`: `occupied_count: 2, attended_count: 1`.
4. In the open, unrefreshed browser window, user clicked "Registrar Asistencia" on Elena's row.
5. Server returned `HTTP 409 Conflict` (`{"detail": "This attendee has already checked in."}`).
6. **Observed DOM Results:**
- `#capacity-counter-0`: `Ocupación: 2 / 15 (1 presentes)`.
- **Consistency with Server:** **100% Consistent** (`1 presentes` in DOM matches server `attended_count: 1`).
- Elena's row reconciled to `ASISTIÓ` status badge.
- Screenshot Evidence: [`scenario_6a_regression_single_oob.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_6a_regression_single_oob.png).
- **Verdict: `PASS`**.
#### Case 2B: Concurrent Multi-Attendee Out-of-Band Staleness Check & Re-verification
##### Initial Evaluation (Commit `9191899` - Phase 4.1): `FAIL`
1. Session initialized to `Ocupación: 2 / 15 (0 presentes)`.
2. Out-of-band API check-ins executed for **both** Elena Gómez (`ADS-1001`) AND Carlos Méndez (`ADS-1002`, `paid_cash: true`).
3. Authoritative server state via `GET /rosters`: `occupied_count: 2, attended_count: 2`.
4. In the open, unrefreshed browser window, user clicked "Registrar Asistencia" on Elena's row.
5. Server returned `HTTP 409 Conflict`.
6. **Initial Observed DOM Results:**
- `#capacity-counter-0`: `Ocupación: 2 / 15 (1 presentes)` (diverged from server `attended_count: 2`).
- Carlos Méndez's row: Remained visually stale as `REGISTRADO` with active check-in button and `PENDIENTE` badge.
- Historical Screenshot: [`scenario_6a_regression_multi_oob.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_6a_regression_multi_oob.png).
7. **Verdict:** **`FAIL`** (Defect: Divergence between post-409 reconciled UI state and authoritative server state; client only performed local isolated increment rather than full authoritative reconciliation).
##### Phase 4.2 Targeted Live Re-verification (Updated Application): `PASS`
Following implementation of full authoritative roster reconciliation on 409 Conflict, Case 2B was re-evaluated under strict, falsifiable pass/fail criteria without pressing `F5` or clicking `Actualizar`:
| Assertion | Verification Checkpoint | Live DOM Measurement | Server Authoritative State | Assertion Verdict |
| :--- | :--- | :--- | :--- | :---: |
| **Assertion 1** | Capacity counter text matches authoritative server count | `Ocupación: 2 / 15 (2 presentes)` | `occupied_count: 2, attended_count: 2` | **`PASS`** |
| **Assertion 2** | Elena's row reflects checked-in state | Badge: `ASISTIÓ`<br/>Button: `✓ Asistió` (disabled) | `attended: true` | **`PASS`** |
| **Assertion 3** | Carlos's row reflects concurrent out-of-band check-in | Badge: `ASISTIÓ`<br/>Badge: `PAGADO`<br/>Button: `✓ Asistió` (disabled) | `attended: true`<br/>`payment_status: "ACKNOWLEDGED"` | **`PASS`** |
- **Re-verification Screenshot:** [`scenario_6a_regression_multi_oob_v2.png`](file:///home/kiskaadee/Projects/active/armonia/docs/evidence/qa/scenario_6a_regression_multi_oob_v2.png)
- **Phase 4.2 Re-verification Verdict:** **`PASS`** (All 3 strict criteria satisfied; zero DOM staleness or counter divergence).
---
### 8.3 Post-Regression Preflight State Restoration
- SQLite test database (`test_armonia.db`) was cleaned and reseeded to the baseline preflight state via `reset_db.py`.
- Final state confirmed: `occupied_count: 2`, `attended_count: 0`, attendees: `ADS-1001` and `ADS-1002`.
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

+104
View File
@@ -0,0 +1,104 @@
---
type: plan
status: ratified
project: armonia-dashboard
pilot: group-workshop-roster
date: 2026-10-26
tags: [collaboration-plan, pilot, governance, anne-droid, qa]
---
# Project Collaboration Plan: Group Workshop Roster Pilot
> **Status:** Ratified Operating Contract (Gates 1 & 2 Approved)
> **Target System:** `armonia-dashboard`
> **Pilot Simplification Note:** For this pilot, the Orchestrator synthesizes both the requirements and the UX proposal. This is a deliberate pilot simplification to test the workflow without premature agent proliferation; it does **not** demonstrate that Requirements Engineering and UX Design are interchangeable in the permanent agency architecture.
---
## 1. Active Role Roster & Authority Boundaries
```mermaid
sequenceDiagram
autonumber
actor PO as Project Owner
participant ORCH as Orchestrator
participant ANNE as Anne Droid (Frontend)
participant QA as Independent QA
PO->>ORCH: 1. Approve Collaboration Plan & Spec Contract
ORCH->>ANNE: 2. Delegate approved spec + API contract
Note over ANNE: Worktree: ../armonia-dashboard-anne-roster<br/>Implements views, styles, unit tests<br/>Documents contract friction if blocked
ANNE->>ORCH: 3. Open Draft PR & Freeze Anne Self-Audit
Note over ORCH,QA: Information Barrier: QA has ZERO access<br/>to Anne's code diff, PR text, or self-audit
ORCH->>QA: 4. Dispatch Running URL + Verification Packet ONLY
Note over QA: Executes Scenarios 1 to 8<br/>Verifies UI, persistence (F5), a11y, mobile
QA->>ORCH: 5. Submit QA Evidence Scorecard (Pass/Fail per AC)
ORCH->>PO: 6. Present PR Diff + Anne Audit + QA Scorecard
alt All Criteria Pass & Evidence Verified
PO->>ANNE: 7a. Authorize PR Merge into main
else Defects / Gaps Detected
PO->>ORCH: 7b. Issue Revision Directive (routed per Escalation Protocol)
end
```
| Role | Operational Scope for This Pilot | Autonomous Authority | Strict Boundary / Prohibited |
| :---------------------------- | :------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- |
| **Project Owner** | Final business authority, requirement sign-off, risk acceptance, conflict adjudication, and release approval. | All consequential product and architectural decisions. | N/A |
| **Orchestrator** | Synthesizes specification; monitors handoffs; verifies precondition gates; routes escalation friction. | Workflow sequencing, contract packaging, QA test dispatching. | **Cannot** modify acceptance criteria, relax invariants, waive QA defects, or approve PR merges. |
| **Anne Droid (Frontend)** | Implements frontend views, styles, and component tests against the approved contract. | Component modularity, state architecture, styling tokens, local unit tests, implementation decomposition, and commit sequencing. | **Cannot** commit to `main`, modify business logic, silently mock API endpoints, merge PRs, or **modify/refactor existing working features outside the assigned scope**. |
| **Independent QA Specialist** | Validates running application against acceptance criteria using the Verification Packet. | Pass/Fail/Blocked verdicts per criterion backed by browser evidence. | **Cannot** waive acceptance criteria, inspect Anne's code/self-audit, or make release decisions. |
### 1.1 Scope Containment & Non-Regression Invariant
When tasked with implementing a new feature (Feature C, e.g. Workshop Roster):
1. **Preserve Existing Capabilities**: Existing views and features (Features A and B: Follow-up Queue, Daily Agenda, Client Directory, Nueva Cita modal) must continue to function without behavioral, visual, or test regressions. All existing test suites (`pnpm exec vp test`) must pass 100%.
2. **Beyond Automated Tests (Targeted Workflow Checks)**: Because existing automated tests may not cover every edge in Queue or Agenda, Anne's self-audit must execute targeted smoke checks of those existing workflows (e.g. verifying that the 48h queue loads and the Nueva Cita modal still opens without errors).
3. **Additive Isolation & Justified Integration**: Feature C must reside in dedicated, isolated files (e.g., `src/components/WorkshopRoster.ts`). Edits to shared integration points (`main.ts`, `api.ts`, `types.ts`, `style.css`) should be strictly additive by default. If an unavoidable non-additive integration edit is required, Anne must document and justify it in her frozen self-audit.
4. **No Opportunistic Refactoring**: Anne is strictly prohibited from rewriting, reorganizing, or reformatting existing working components unless explicitly instructed by the Specification Contract.
5. **Self-Audit Regression Gate**: Anne's frozen self-audit must explicitly prove that existing tabs still render correctly and that the git diff is tightly bounded to the assigned feature.
### 1.2 Incremental Implementation & Commit Discipline
Anne Droid owns the decomposition of the approved feature specification into coherent implementation increments. The Project Owner defines the required outcomes and acceptance criteria; the Orchestrator does not prescribe the implementation task sequence unless a specific dependency, risk, or contract constraint requires intervention.
1. **Engineer-Owned Decomposition**: Before writing code, Anne identifies a practical sequence of implementation increments based on the approved contract and existing architecture. The sequence is an engineering breakdown, not a source of new product requirements. Missing requirements or consequential scope changes must be escalated rather than resolved through implementation planning alone.
2. **Coherent Incremental Commits**: Anne commits completed increments as work progresses. Each commit must have a clear purpose, a reviewable diff, and a Conventional Commit message describing the change (e.g., `feat(roster): add API client and roster types`, `feat(roster): implement session card and capacity indicators`). Commits must reflect genuine progress rather than arbitrary file boundaries or retrospective subdivision of a completed feature.
3. **Intermediate Integrity**: Each commit should leave the branch in a coherent state and pass the checks relevant to its changes (`pnpm exec biome check .`, `vp check`). The completed feature must pass the full required test suite. Any temporary intermediate limitation must be intentional, documented in commit notes, and resolved before the PR is submitted for review.
4. **Scope and Regression Boundaries**: Incremental commits do not authorize opportunistic refactoring or unrelated behavior changes. Changes to existing features and shared integration points remain subject to the Scope Containment & Non-Regression Invariant.
5. **Traceability and Review**: Anne's frozen self-audit must summarize the implementation increments, map commits to acceptance criteria, explain any justified deviations from the initial breakdown, and document any known limitations. The Orchestrator may flag incoherent commits, excessive unrelated changes, or gaps in traceability, but may not dictate implementation details solely to enforce a preferred task sequence.
6. **Integrated Verification**: Commit-level checks do not replace feature-level acceptance testing or independent QA. The complete pull request remains subject to the approved Specification Contract, Verification Packet, regression requirements, and Project Owner's release decision.
### 1.3 Clarification on QA Failure Routing & Final Acceptance
- **QA owns its findings and supporting evidence**, not the release decision.
- If QA reports a failure on an acceptance criterion, the Orchestrator routes the defect back to Anne (for an implementation bug) or to the relevant specialist (for an API or requirement flaw).
- **The Orchestrator cannot waive a failure or convert a failed acceptance criterion into a pass.** Only the Project Owner has the authority to relax a requirement, accept a known risk, or authorize a PR merge.
---
## 2. Phase-by-Phase Handoff Matrix
| Phase | Acting Role | Required Input | Produced Output | Approval Gatekeeper |
| :------------------------------------ | :----------------------------------------- | :------------------------------------------- | :----------------------------------------------------------- | :------------------------------------------------ |
| **Phase 1: Operating Model** | Orchestrator | Pre-experiment baseline snapshot | `COLLABORATION-PLAN.md` | **Project Owner** (Signs off on roles) |
| **Phase 2: Contract Formulation** | Orchestrator (Requirements + UX synthesis) | API schema, M4 roadmap scope | `SPEC-WORKSHOP-ROSTER.md` + `VERIFICATION-PACKET-ROSTER.md` | **Project Owner** (Approves criteria & test data) |
| **Phase 3: Implementation** | Anne Droid | Approved spec + running API | `feat/anne/workshop-roster` PR + frozen `anne-self-audit.md` | **Anne Droid** (Freezes self-audit prior to QA) |
| **Phase 4: Independent Verification** | QA Specialist | Running build URL + Verification Packet ONLY | `qa-evidence-scorecard.md` | **QA Specialist** (Signs off on test evidence) |
| **Phase 5: Release & Post-Mortem** | Project Owner | PR diff + Anne Audit + QA Scorecard | Merge decision + Pilot evaluation log | **Project Owner** (Decides merge / rework) |
---
## 3. Explicit Change & Escalation Protocol
If any specialist encounters a blocking condition or contradiction, work halts at that boundary and routes strictly according to problem type:
```mermaid
flowchart LR
BLOCK["Friction Encountered"] --> CAT{Classify Problem}
CAT -->|"Contradictory / Missing Business Rule"| REQ["Orchestrator / Requirements"]
CAT -->|"Unworkable Interaction Flow"| UX["Orchestrator / UX"]
CAT -->|"API Schema Defect / Backend 500"| BE["Backend Owner / Issue Tracker"]
CAT -->|"Implementation Bug"| ANNE["Anne Droid (Worktree)"]
CAT -->|"Ambiguous / Broken Test Criterion"| QA["Requirements + QA Specialist"]
CAT -->|"Scope Trade-off or Scope Relaxation"| PO["Project Owner (Human Decision)"]
```
1. **API Friction Rule**: Anne must record a structured **Contract Friction Notice** on the PR rather than silently creating synthetic mock data or changing expected response shapes.
2. **Owner Escalation Rule**: Any trade-off affecting user workflows (e.g. omitting walk-in check-ins due to API constraints) requires an explicit choice from the Project Owner.
+193
View File
@@ -0,0 +1,193 @@
---
type: plan
role: specification-contract
status: approved
project: armonia-dashboard
feature: workshop-roster-checkin
milestone: M4
date: 2026-10-26
tags: [spec, frontend, requirements, ux, armonia-dashboard]
---
# Specification Contract: Group Workshop Roster Quick Check-in
> **Status:** Ratified Implementation Contract (Gate 2 Approved)
> **Contract Authority:** Binding implementation contract for `armonia-dashboard`.
> **Engineering Boundary:** This specification defines *what* the operator must accomplish and *how* states behave. The component breakdown, DOM composition, and styling implementation belong to Anne Droid's engineering judgment. Implementation must be strictly additive and isolated; existing features (Follow-up Queue, Daily Agenda, Client Directory, Nueva Cita) must remain undisturbed and 100% passing.
---
## 1. Domain Context & User Goals
In Armonía del Ser, group services (e.g., *Círculo de Cacao Presencial*, *Meditación con Cuencos*) take place with multiple attendees (up to 12–25 capacity).
**The Operator's Goal:**
On the day of the workshop, Jasmin or her assistant stands at reception. As participants arrive, the operator needs a mobile-first, high-density view to:
1. Confirm which group workshop session is active today and review capacity metrics.
2. Rapidly record digital attendance (1-tap check-in marking attendance and completing the booking).
3. Identify payment state at a glance: identify who is pre-paid (`PAGADO` via SPEI) versus who must pay on arrival (`PENDIENTE`).
4. Collect cash on-site and acknowledge payment in the same 1-tap check-in action.
5. Register and check in unexpected walk-in attendees without disrupting the session flow.
---
## 2. Precise Semantic Definitions & Status Mapping
### 2.1 The Two Workshop Counters
```
┌────────────────────────────────────────────────────────────────────────┐
│ Workshop Counter Semantics │
├─────────────────────┬──────────────────────────────────────────────────┤
│ Metric │ Business Meaning & Mutation Rules │
├─────────────────────┼──────────────────────────────────────────────────┤
│ occupied_count │ Total participants holding an active spot │
│ │ (status: RESERVED, COMPLETED, NO_SHOW). │
│ │ • Advance booking created: count increments. │
│ │ • Existing attendee checks in: count UNCHANGED. │
│ │ • Walk-in attendee registers: count increments. │
├─────────────────────┼──────────────────────────────────────────────────┤
│ attended_count │ Participants physically present & verified │
│ │ (booking_status: COMPLETED, attended: true). │
│ │ • Existing attendee checks in: count increments. │
│ │ • Walk-in attendee registers: count increments. │
└─────────────────────┴──────────────────────────────────────────────────┘
```
- **Capacity Display**: Formatted as `Ocupación: {occupied_count} / {max_capacity} ({attended_count} presentes)`.
- **409 Conflict Disambiguation & Reconciliation Contract**:
The backend issues `HTTP 409 Conflict` in two distinct business scenarios, verified against pinned backend commit `d9c86e27d926` in `armonia-api/app/routers/rosters.py`. The client must inspect `response.detail` (or error payload):
1. *Already Checked-In Conflict (`detail: "This attendee has already checked in."`)* (`app/routers/rosters.py#L196`): Indicates an idempotent duplicate submission. The client must reconcile by updating the attendee row to `ASISTIÓ`, disabling the check-in button, and showing an informative status toast (*"El asistente ya contaba con asistencia registrada"*). The client must never crash or treat this as a failed/unregistered state.
2. *Capacity Exceeded Conflict (`detail: "El taller ha alcanzado su cupo máximo ({max_cap}) para esta sesión."`)* (`app/routers/rosters.py#L332`): Occurs during walk-in registration when `occupied_count >= max_capacity`. The client must detect the capacity message (e.g. matching `cupo máximo`), display an explicit capacity error alert (*"El taller ha alcanzado su cupo máximo (15) para esta sesión"*), keep the modal form state intact for operator decision, and **never** optimistically increment attendance or report success.
- **Ordinary Network / 500 Failure**: Preserve the current UI state, do not change attendee status, and allow the operator to retry.
- **Technical Debt & Future Contract Note**: String matching on `response.detail` is a pilot accommodation to preserve backend immutability on `armonia-api`. A future M5 ADR will introduce structured machine-readable error codes (e.g. `{"error_code": "ATTENDEE_ALREADY_CHECKED_IN"}`).
### 2.2 Status Terminology Mapping Table
To prevent ambiguity between UI labels and backend persistence, all badge renderings must adhere to this mapping:
| UI Badge / Label | Visual Styling | Backend Entity | Persisted Status Field & Value |
| :--- | :--- | :--- | :--- |
| **`REGISTRADO`** | Slate/Neutral Pill | `Booking` | `booking_status: "RESERVED"`, `attended: false` |
| **`ASISTIÓ`** | Emerald/Green Pill | `Booking` | `booking_status: "COMPLETED"`, `attended: true` |
| **`PAGADO`** | Emerald/Green Pill | `Booking` & `Payment` | `payment_status: "ACKNOWLEDGED"` |
| **`PENDIENTE`** | Amber/Orange Pill | `Booking` | `payment_status: "AWAITING_ACKNOWLEDGMENT"` |
---
## 3. Resilient Error-Recovery Contract (The 5 States)
Every interactive view in this feature must explicitly handle the 5 states:
```mermaid
stateDiagram
[*] --> Loading: Switch to #rosters tab
Loading --> Empty: GET /rosters returns []
Loading --> Error_Roster: GET /rosters fails (Network/500)
Loading --> Roster_Ready: GET /rosters returns sessions
Error_Roster --> Loading: Tap "Reintentar"
Empty --> Loading: Change date picker
Roster_Ready --> Action_In_Flight: Tap Check-in or Submit Walk-in
Action_In_Flight --> Action_Error: POST fails (Timeout/Network)
Action_In_Flight --> Roster_Ready: POST succeeds (HTTP 200) -> Toast
Action_Error --> Roster_Ready: Toast error; row stays uncommitted
```
1. **Loading State**: Render skeleton placeholder cards for workshop sessions and attendee rows. Layout shift (CLS) must remain $\le 0.05$.
2. **Empty State**: If no group sessions exist for the selected date, display:
> *"No hay talleres grupales programados para esta fecha."*
The date selector remains interactive so the operator can navigate to adjacent days.
3. **Failed Roster Retrieval (Error with Retry)**: If `GET /rosters` fails (network down or server error), display an inline error banner:
> *"No se pudieron cargar los talleres. Verifica tu conexión."*
Accompanied by an explicit `<button class="btn btn-secondary">Reintentar</button>` that re-triggers the fetch without a full page reload.
4. **Action Failure & Conflict Recovery**:
- *Already-Checked-In Conflict (409)*: If the server reports the attendee is already checked in, the client reconciles state by updating the row to `ASISTIÓ`, disabling check-in, and displaying an informative notice (*"El asistente ya contaba con asistencia registrada"*).
- *Capacity Reached Conflict (409)*: If a walk-in is rejected because the session is full, the client reports the capacity limit (*"El taller ha alcanzado su cupo máximo"*), leaves the form open for operator decision, and does not record attendance.
- *Network / Server Error (5xx / Timeout)*: The client displays an accessible error toast, preserves the uncommitted attendee row state (no optimistic toggle), and keeps the action button enabled for immediate retry.
5. **Success Feedback State**: Upon successful check-in or walk-in:
- Immediate visual feedback on the row (`ASISTIÓ` badge).
- Display an accessible toast container equipped with `role="status"` and `aria-live="polite"` announcing: *"Asistencia registrada con éxito."*
---
## 4. Explicit Acceptance Criteria (AC)
### `AC-1`: Workshop Session Selection & Capacity Overview
- **Given** the operator navigates to the "Talleres" tab (URL hash `#rosters`),
- **When** the view loads for the selected date (default: today),
- **Then** it queries `GET /rosters?date_from=YYYY-MM-DD&date_to=YYYY-MM-DD`.
- **And** it displays the group session title, scheduled time, and a capacity counter formatted as `Ocupación: {occupied_count} / {max_capacity} ({attended_count} presentes)`.
### `AC-2`: Attendee Roster Display & Status Indicators
- **Given** an active workshop session with registered attendees,
- **When** the session roster renders,
- **Then** each attendee row displays: Client Name, Phone, Booking Code (`ADS-XXXX`), Attendance Status (`REGISTRADO` vs. `ASISTIÓ`), and Payment Status (`PAGADO` vs. `PENDIENTE`).
- **And** includes a 1-tap `wa.me` link pre-populated with the attendee's phone.
### `AC-3`: Existing Booking Check-in (Pre-paid)
- **Given** an attendee with `booking_status: "RESERVED"` and `payment_status: "ACKNOWLEDGED"`,
- **When** the operator taps the "Registrar Asistencia" button,
- **Then** the client sends `POST /rosters/quick-checkin` with payload `{"booking_id": "<id>", "paid_cash": false}`.
- **And** upon HTTP 200, the row immediately updates to `ASISTIÓ`, the check-in button disables, and `attended_count` increments by 1.
### `AC-4`: Existing Booking Check-in with Cash Payment Acknowledgment
- **Given** an attendee with `payment_status: "AWAITING_ACKNOWLEDGMENT"`,
- **When** the operator taps check-in with "Cobro en efectivo recibido" checked,
- **Then** the client sends `POST /rosters/quick-checkin` with payload `{"booking_id": "<id>", "paid_cash": true, "notes": "Cobro en puerta"}`.
- **And** upon HTTP 200, the row reflects both `ASISTIÓ` and `PAGADO` (`ACKNOWLEDGED`), and `attended_count` increments by 1 without full page reload.
### `AC-5`: Walk-in Attendee Quick Registration & Check-in
- **Given** an unregistered participant arrives at the workshop,
- **When** the operator taps "+ Registrar Asistente Sin Cita",
- **Then** a modal opens requesting: Full Name, Phone (WhatsApp), and Cash Payment toggle (defaults to `true` / checked, because walk-in reception is predominantly cash).
- **When** submitted, the client sends `POST /rosters/quick-checkin` with Mode 2 payload:
`{"service_id": "<id>", "scheduled_at": "<iso>", "client_name": "...", "client_phone": "...", "paid_cash": true}`.
- **And** upon HTTP 200, the modal closes, the attendee appears in the list as `ASISTIÓ` and `PAGADO`, and both `occupied_count` and `attended_count` increment by 1.
- **And** the modal submit button disables while in flight to prevent accidental double-click duplicate registrations.
### `AC-6`: Resilient Error Handling & Retry
- **Given** an error state (failed roster fetch or interrupted check-in),
- **Then** the UI exposes an actionable retry path without clearing existing form data or falsely marking attendees present.
### `AC-7`: Mobile Ergonomics & Keyboard Accessibility
- All interactive controls (Check-in buttons, Cash toggles, Walk-in trigger, Modal inputs) must have touch targets of at least **44x44px**.
- Roster rows must render cleanly at **375px** viewport width without horizontal scroll overflow.
- All interactive controls must support sequential keyboard focus (`Tab` / `Shift+Tab`) with visible `:focus-visible` outlines.
- Toast feedback must announce to assistive technology via `role="status"` and `aria-live="polite"`.
---
## 5. Navigation & Architectural Conventions
1. **Tab Identifier**: `rosters`
2. **URL Hash**: `#rosters`
3. **Navigation Label**: "Talleres"
4. **Header Integration**: Integrated into `OperatorDashboardApp.renderShell()` in `src/main.ts` alongside `#queue`, `#agenda`, `#clients`, and `#all`.
5. **Cash Toggle Default**: In the walk-in modal, the "Cobro en efectivo recibido" toggle defaults to **checked (`true`)**. *Rationale:* In-person workshop walk-ins overwhelmingly settle entrance fees in cash at reception. Operators may uncheck if the client provides immediate SPEI transfer verification.
---
## 6. API Contract Reference
The view interacts strictly with existing endpoints defined in `armonia-api`:
- **Endpoint 1:** `GET /rosters?date_from={YYYY-MM-DD}&date_to={YYYY-MM-DD}&service_id={optional}`
- *Response Shape:* `list[RosterSessionRead]` (see `app/schemas/roster.py`).
- **Endpoint 2:** `POST /rosters/quick-checkin`
- *Mode 1 (Existing Booking):*
```json
{ "booking_id": "uuid-str", "paid_cash": true, "notes": "Opcional" }
```
- *Mode 2 (Walk-In):*
```json
{
"service_id": "uuid-str",
"scheduled_at": "2026-10-25T18:00:00Z",
"client_name": "Nombre Cliente",
"client_phone": "525512345678",
"paid_cash": true
}
```
- *Response:* `QuickCheckinResponse` (`walk_in: bool`, `attendee: RosterAttendeeRead`).
- *Conflict Behavior:* HTTP 409 Conflict if attendee already completed or session at max capacity.
+238
View File
@@ -0,0 +1,238 @@
---
type: plan
role: verification-packet
status: approved
project: armonia-dashboard
feature: workshop-roster-checkin
date: 2026-10-26
tags: [qa, verification-packet, test-data, blind-testing]
---
# Verification Packet: Group Workshop Roster Quick Check-in
> **Status:** Ratified Verification Contract (Gate 2 Approved)
> **Notice to Independent QA Reviewer:** This packet contains **all** instructions, test personas, and expected observable criteria needed to verify the feature. You must evaluate the running application *without* inspecting the pull request discussion, implementation source code, or the implementer's self-audit.
---
## 1. Frozen Environment & Runtime Configuration
Prior to executing test scenarios, verify that both services are running on the specified commits:
| Component | Target Directory | Verified Commit Hash | Start Command | Active Port |
| :--- | :--- | :--- | :--- | :--- |
| **Backend API** | `armonia/armonia-api` | `d9c86e27d926bab3287857ccc9b53ec4fbcec91b` | `DATABASE_URL=file:test_armonia.db uv run python -m uvicorn app.main:app --port 8000` | `http://localhost:8000` |
| **Frontend UI** | `armonia/armonia-dashboard` | PR Branch (`feat/anne/workshop-roster`) | `pnpm exec vp dev --port 5173` | `http://localhost:5173` |
---
## 2. Tested & Verified Test Database Seed Script with Preflight Assertions
Run this command inside `armonia-api` using `uv run python`. It creates a clean disposable SQLite database (`test_armonia.db`), initializes default services, seeds the exact test records required for today's date, and **formally asserts all four preflight conditions** before completing:
```bash
cd /home/kiskaadee/Projects/active/armonia/armonia-api && uv run python -c "
import os, asyncio
from datetime import datetime, UTC
from zoneinfo import ZoneInfo
from pathlib import Path
# Deterministic absolute path anchoring
abs_db_path = (Path.cwd() / 'test_armonia.db').resolve()
assert abs_db_path.name.startswith('test_') and abs_db_path.name != 'local.db', 'Safety failure: refusal to touch non-test database'
if abs_db_path.exists():
abs_db_path.unlink()
os.environ['DATABASE_URL'] = f'file:{abs_db_path}'
from app.core.config import settings
settings.database_url = f'file:{abs_db_path}'
from app.db.init_db import init_schema_and_seed
from app.db.database import get_db
from fastapi.testclient import TestClient
from app.main import app
from app.core.auth import create_session_token
async def seed_and_verify():
# 1. Initialize schema and default services
await init_schema_and_seed()
async with get_db() as client:
# Preflight 1: Assert service exists with expected capacity of 15
res = await client.execute('SELECT id, name, price_mxn, max_capacity FROM services WHERE slug = \"circulo-cacao-presencial\" LIMIT 1;')
assert res.rows, 'Preflight 1 Failed: circulo-cacao-presencial service not found!'
cacao_id, cacao_name, price_mxn, max_capacity = res.rows[0]
assert max_capacity == 15, f'Preflight 1 Failed: Expected capacity 15, got {max_capacity}'
# Preflight 2: Calculate today's session instant at 18:00
tz = ZoneInfo(settings.business_timezone)
today = datetime.now(tz).date()
today_str = today.isoformat()
session_dt = datetime(today.year, today.month, today.day, 18, 0, 0, tzinfo=tz).astimezone(UTC).isoformat()
now = datetime.now(UTC).isoformat()
# Insert Elena Gómez (Prepaid SPEI: RESERVED + ACKNOWLEDGED)
client_elena = 'c1111111-1111-1111-1111-111111111111'
booking_elena = 'b1111111-1111-1111-1111-111111111111'
await client.execute('INSERT OR REPLACE INTO clients (id, full_name, phone_whatsapp, email) VALUES (?, ?, ?, ?);',
[client_elena, 'Elena Gómez', '525511112222', 'elena@example.com'])
await client.execute('''
INSERT OR REPLACE INTO bookings (
id, booking_code, service_id, client_id, scheduled_at, duration_minutes, buffer_minutes,
booking_status, payment_arrangement, payment_status, amount_mxn, created_at
) VALUES (?, ?, ?, ?, ?, 120, 0, 'RESERVED', 'PREPAID_DEFAULT', 'ACKNOWLEDGED', ?, ?);
''', [booking_elena, 'ADS-1001', cacao_id, client_elena, session_dt, price_mxn, now])
# Insert Carlos Méndez (Unpaid: RESERVED + AWAITING_ACKNOWLEDGMENT)
client_carlos = 'c2222222-2222-2222-2222-222222222222'
booking_carlos = 'b2222222-2222-2222-2222-222222222222'
await client.execute('INSERT OR REPLACE INTO clients (id, full_name, phone_whatsapp, email) VALUES (?, ?, ?, ?);',
[client_carlos, 'Carlos Méndez', '525533334444', 'carlos@example.com'])
await client.execute('''
INSERT OR REPLACE INTO bookings (
id, booking_code, service_id, client_id, scheduled_at, duration_minutes, buffer_minutes,
booking_status, payment_arrangement, payment_status, amount_mxn, created_at
) VALUES (?, ?, ?, ?, ?, 120, 0, 'RESERVED', 'PREPAID_DEFAULT', 'AWAITING_ACKNOWLEDGMENT', ?, ?);
''', [booking_carlos, 'ADS-1002', cacao_id, client_carlos, session_dt, price_mxn, now])
# Preflight 3: Endpoint level validation (assert endpoint returns exact expected session & attendees)
tc = TestClient(app)
headers = {'Authorization': f'Bearer {create_session_token(\"asistente@armoniadelser.mx\")}'}
r = tc.get(f'/rosters?date_from={today_str}&date_to={today_str}', headers=headers)
assert r.status_code == 200, f'Preflight 3 Failed: GET /rosters returned {r.status_code}'
data = r.json()
assert len(data) == 1, f'Preflight 3 Failed: Expected 1 session, got {len(data)}'
sess = data[0]
assert sess['occupied_count'] == 2 and sess['attended_count'] == 0, 'Preflight 3 Failed: Initial counts mismatch'
codes = {att['booking_code'] for att in sess['attendees']}
assert codes == {'ADS-1001', 'ADS-1002'}, f'Preflight 3 Failed: Missing expected codes {codes}'
# Preflight 4: File existence & non-empty database target
assert abs_db_path.exists() and abs_db_path.stat().st_size > 0, 'Preflight 4 Failed: Database file missing or empty'
print('✅ Preflight assertions passed: 100% verified test database ready at', abs_db_path)
asyncio.run(seed_and_verify())
"
```
---
## 3. Pre-Configured Test Attendee Personas
| Attendee Persona | Initial Persisted State | Expected Initial UI Rendering | Expected Post-Action State |
| :--- | :--- | :--- | :--- |
| **Elena Gómez** (`ADS-1001`) | `booking_status: "RESERVED"`, `payment_status: "ACKNOWLEDGED"`, `attended: false` | Badge: `REGISTRADO`<br/>Badge: `PAGADO` (Green)<br/>Action: "Registrar Asistencia" | After check-in: Badge updates to `ASISTIÓ`. Counter increments to `1 presente`. |
| **Carlos Méndez** (`ADS-1002`) | `booking_status: "RESERVED"`, `payment_status: "AWAITING_ACKNOWLEDGMENT"`, `attended: false` | Badge: `REGISTRADO`<br/>Badge: `PENDIENTE` (Amber)<br/>Action: Check-in + "Cobro efectivo" | After cash check-in: Badge updates to `ASISTIÓ` AND `PAGADO`. Counter increments. |
| **Walk-in: Lucía Vega** | Not in database initially | Not present in list | After registration: Appears in list as `ASISTIÓ` and `PAGADO`. Occupancy becomes `3 / 15`. |
---
## 4. Test Execution Scenarios & Concrete Pass/Fail Criteria
### Scenario 1: Navigation, Tab Hash & Capacity Overview (`AC-1`)
1. Open `http://localhost:5173` in a desktop browser.
2. Click the "Talleres" navigation button in the top navigation bar.
3. **Pass Criteria:**
- [ ] URL updates to `http://localhost:5173/#rosters`.
- [ ] "Talleres" tab button reflects active state (`aria-selected="true"`).
- [ ] Session card for "Círculo de Cacao (Presencial)" renders with time 18:00.
- [ ] Capacity counter displays exactly: `Ocupación: 2 / 15 (0 presentes)`.
### Scenario 2: Attendee Roster Display & Status Badges (`AC-2`)
1. Inspect the attendee table/list for the active workshop.
2. **Pass Criteria:**
- [ ] Elena Gómez is listed with booking code `ADS-1001`, status `REGISTRADO`, and payment pill `PAGADO`.
- [ ] Carlos Méndez is listed with booking code `ADS-1002`, status `REGISTRADO`, and payment pill `PENDIENTE`.
- [ ] Both rows display a clickable WhatsApp link (`wa.me/525511112222` and `wa.me/525533334444`).
### Scenario 3: Pre-paid Attendee Check-in & Persistence Verification (`AC-3`)
1. On Elena Gómez's row (`ADS-1001`), tap "Registrar Asistencia".
2. **Pass Criteria (UI & Persistence):**
- [ ] Network inspector shows `POST /rosters/quick-checkin` returned HTTP 200 with payload `{"booking_id": "...", "paid_cash": false}`.
- [ ] Elena's status badge updates from `REGISTRADO` to `ASISTIÓ`.
- [ ] Capacity summary updates to `Ocupación: 2 / 15 (1 presentes)`.
- [ ] An accessible toast announces: *"Asistencia registrada con éxito."*
- [ ] **Persistence Proof:** Refresh the browser page (`F5`). Upon reload, Elena still renders as `ASISTIÓ` and capacity remains `1 presente`.
### Scenario 4: Cash Check-in & Payment Status Transition (`AC-4`)
1. On Carlos Méndez's row (`ADS-1002`), trigger check-in with the "Cobro en efectivo recibido" checkbox checked.
2. **Pass Criteria (UI & Persistence):**
- [ ] Network inspector shows `POST /rosters/quick-checkin` returned HTTP 200 with `paid_cash: true`.
- [ ] Carlos's status badge updates to `ASISTIÓ`.
- [ ] Carlos's payment pill transitions from `PENDIENTE` to `PAGADO`.
- [ ] Capacity summary updates to `Ocupación: 2 / 15 (2 presentes)`.
- [ ] **Persistence Proof:** Refresh the browser page (`F5`). Carlos renders with both `ASISTIÓ` and `PAGADO`.
### Scenario 5: Walk-In Registration & Double-Submission Prevention (`AC-5`)
1. Click the "+ Registrar Asistente Sin Cita" button.
2. In the modal:
- Full Name: `Lucía Vega`
- Phone: `525598765432`
- Cash toggle: confirm it defaults to **checked (`true`)**.
3. **Double-Submission Test**: Rapidly click "Registrar y Marcar Asistencia" twice in succession.
4. **Pass Criteria:**
- [ ] Submit button disables immediately while the request is in flight.
- [ ] Exactly **one** walk-in record is created (network inspector shows only one successful registration; second click is ignored or blocked).
- [ ] Modal closes upon HTTP 200.
- [ ] Lucía Vega appears in the active attendee list with `ASISTIÓ` and `PAGADO`.
- [ ] Capacity counter updates to exactly `Ocupación: 3 / 15 (3 presentes)` (NOT `4 / 15`).
- [ ] **Persistence Proof:** Refresh the browser (`F5`). Exactly one Lucía Vega record remains persisted in the roster.
### Scenario 6: 409 Conflict Disambiguation & Reconciliation
1. **Case 6A (Already-Checked-In Idempotency)**: Trigger a duplicate check-in request via network replay or rapid re-tap for an already checked-in attendee (`ADS-1001`).
- **Pass Criteria:**
- [ ] Backend returns `HTTP 409 Conflict` (`"This attendee has already checked in."`).
- [ ] UI catches the 409, reconciles state, displays informative feedback (*"El asistente ya contaba con asistencia registrada"*), and ensures row reflects `ASISTIÓ` without unhandled application crash.
2. **Case 6B (Capacity Reached Conflict)**: When submitting a walk-in to a session at max capacity:
- **Pass Criteria:**
- [ ] Backend returns `HTTP 409 Conflict` (`"El taller ha alcanzado su cupo máximo"`).
- [ ] UI displays explicit capacity error alert; modal form data is preserved; row is **not** added to list.
### Scenario 7: Failed Roster Fetch & Actionable Retry (`AC-6`)
1. Temporarily stop the backend API process (`Ctrl+C` on uvicorn).
2. Switch dates or refresh the `#rosters` view.
3. **Pass Criteria:**
- [ ] Error banner renders: *"No se pudieron cargar los talleres. Verifica tu conexión."*
- [ ] A visible "Reintentar" button is displayed.
4. Restart the backend API process.
5. Click "Reintentar".
6. **Pass Criteria:**
- [ ] Roster reloads successfully without needing a browser reload.
### Scenario 8: Mobile Ergonomics & Accessibility Tree (`AC-7`)
1. Switch browser DevTools to Mobile Emulation: **375 x 812 px** (iPhone SE/X).
2. **Pass Criteria:**
- [ ] Zero horizontal scroll overflow on the table/cards.
- [ ] All check-in buttons, toggles, and modal inputs have minimum touch bounding boxes of **44 x 44 px**.
3. Navigate the view using only the keyboard (`Tab` and `Shift+Tab`).
4. **Pass Criteria:**
- [ ] Focus indicator is visibly highlighted on every active button and input.
- [ ] Toast notification container possesses `role="status"` and `aria-live="polite"`.
---
## 5. Evidence Capture & Scorecard Deliverable
The QA Specialist must produce `qa-evidence-scorecard.md` containing:
1. Formal table checking every criterion (`AC-1` to `AC-7`, Scenarios 1 to 8) with verdict: `PASS`, `FAIL`, or `BLOCKED`.
2. Captured screenshots attached:
- Desktop initial roster view.
- Mobile 375px view showing touch targets.
- Post-check-in state showing updated counter.
- Walk-in modal open state.
3. Browser console log confirming zero uncaught JavaScript exceptions.
4. If any test fails, record: Exact visual element, HTTP status, and response JSON payload.
---
## 6. Reset & Cleanup Procedure
To restore the test environment between verification passes:
```bash
# 1. Stop backend API (Ctrl+C)
# 2. Delete test database file
rm -f /home/kiskaadee/Projects/active/armonia/armonia-api/test_armonia.db
# 3. Re-run the seed script from Section 2
# 4. Restart backend API
```
+2
View File
@@ -17,8 +17,10 @@ x 2026-10-19 (A) Implement Dynamic Operator Identity Pill in Header from GET /au
x 2026-10-19 (A) Implement Nueva Cita modal with client autocomplete search and WhatsApp confirmation in armonia-dashboard +dashboard @ui issue:armonia-dashboard#6 x 2026-10-19 (A) Implement Nueva Cita modal with client autocomplete search and WhatsApp confirmation in armonia-dashboard +dashboard @ui issue:armonia-dashboard#6
x 2026-10-19 (A) Implement Agenda Card Reschedule & Complete actions and Client Directory View in armonia-dashboard +dashboard @ui issue:armonia-dashboard#7 x 2026-10-19 (A) Implement Agenda Card Reschedule & Complete actions and Client Directory View in armonia-dashboard +dashboard @ui issue:armonia-dashboard#7
(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) 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
(B) Return structured error_code (ALREADY_CHECKED_IN, CAPACITY_REACHED) in 409 conflict responses in armonia-api +api @backend issue:armonia-api#15
x 2026-10-19 (C) Scaffold Vite+, Tailwind, HTMX, and Biome project structure in armonia-dashboard +dashboard @ui issue:armonia-dashboard#1 x 2026-10-19 (C) Scaffold Vite+, Tailwind, HTMX, and Biome project structure in armonia-dashboard +dashboard @ui issue:armonia-dashboard#1
x 2026-10-19 (C) Implement 48-hour follow-up queue, payment acknowledgment, and agenda views in armonia-dashboard with Anne Droid +dashboard @ui issue:armonia-dashboard#1 x 2026-10-19 (C) Implement 48-hour follow-up queue, payment acknowledgment, and agenda views in armonia-dashboard with Anne Droid +dashboard @ui issue:armonia-dashboard#1
x 2026-10-19 (C) Polish operator dashboard UI with toasts, inline micro-modals, agenda date filter, and sticky mobile nav +dashboard @ui issue:armonia-dashboard#1 x 2026-10-19 (C) Polish operator dashboard UI with toasts, inline micro-modals, agenda date filter, and sticky mobile nav +dashboard @ui issue:armonia-dashboard#1
x 2026-10-29 (C) Implement Group Workshop Roster check-in view and multi-session package counter in armonia-dashboard with Anne Droid +dashboard @ui issue:armonia-dashboard#9
(C) Scaffold Vite+, Tailwind, HTMX, and Biome project structure in armonia-landing +landing @ui issue:armonia-landing#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 (C) Implement public service catalog, slot picker, and SPEI WhatsApp handoff in armonia-landing with Anne Droid +landing @ui issue:armonia-landing#1