From e134d292fdd91966f831e2f1b44a407f14dbb6de Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Mon, 26 Oct 2026 09:19:41 -0500 Subject: [PATCH] plan(skills): tighten contracts, seed safety, and governance in collaboration pilot - Pin 409 conflict detail string matching to backend commit d9c86e27 in workshop roster spec - Add absolute path anchoring and non-test database guardrails to QA seed script - Formalize three-stage owner approval sequence in pre-experiment baseline --- .../rtt-agency/pilot-spec-workshop-roster.md | 7 ++++--- .../pilot-verification-packet-roster.md | 17 +++++++++-------- ...xperiment-baseline-frontend-collaboration.md | 8 +++++--- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/01-plans/skills/rtt-agency/pilot-spec-workshop-roster.md b/01-plans/skills/rtt-agency/pilot-spec-workshop-roster.md index 0903c06..32d942e 100644 --- a/01-plans/skills/rtt-agency/pilot-spec-workshop-roster.md +++ b/01-plans/skills/rtt-agency/pilot-spec-workshop-roster.md @@ -55,10 +55,11 @@ On the day of the workshop, Jasmin or her assistant stands at reception. As part - **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, which the client must differentiate by inspecting `response.detail`: - 1. *Already Checked-In Conflict (`detail` indicates attendee already checked in)*: 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` indicates cupo máximo / capacity reached)*: Occurs during walk-in registration when `occupied_count >= max_capacity`. The client must display an explicit capacity error alert (*"El taller ha alcanzado su cupo máximo (X)"*), keep the modal form state intact for operator decision, and **never** optimistically increment attendance or report success. + 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 diff --git a/01-plans/skills/rtt-agency/pilot-verification-packet-roster.md b/01-plans/skills/rtt-agency/pilot-verification-packet-roster.md index 4fe15c5..9d22ef6 100644 --- a/01-plans/skills/rtt-agency/pilot-verification-packet-roster.md +++ b/01-plans/skills/rtt-agency/pilot-verification-packet-roster.md @@ -20,7 +20,7 @@ Prior to executing test scenarios, verify that both services are running on the | Component | Target Directory | Verified Commit Hash | Start Command | Active Port | | :--- | :--- | :--- | :--- | :--- | -| **Backend API** | `armonia/armonia-api` | `d9c86e27d926bab3287857ccc9b53ec4fbcec91b` | `DATABASE_URL=file:test_armonia.db uv run uvicorn app.main:app --port 8000` | `http://localhost:8000` | +| **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` | --- @@ -36,11 +36,13 @@ from datetime import datetime, UTC from zoneinfo import ZoneInfo from pathlib import Path -db_filename = 'test_armonia.db' -if Path(db_filename).exists(): - Path(db_filename).unlink() +# 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:{db_filename}' +os.environ['DATABASE_URL'] = f'file:{abs_db_path}' from app.core.config import settings settings.database_url = f'file:{db_filename}' @@ -105,10 +107,9 @@ async def seed_and_verify(): assert codes == {'ADS-1001', 'ADS-1002'}, f'Preflight 3 Failed: Missing expected codes {codes}' # Preflight 4: File existence & non-empty database target - p = Path(db_filename) - assert p.exists() and p.stat().st_size > 0, 'Preflight 4 Failed: Database file missing or empty' + 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', p.resolve()) + print('✅ Preflight assertions passed: 100% verified test database ready at', abs_db_path) asyncio.run(seed_and_verify()) " diff --git a/01-plans/skills/rtt-agency/pre-experiment-baseline-frontend-collaboration.md b/01-plans/skills/rtt-agency/pre-experiment-baseline-frontend-collaboration.md index a7a0b47..0b33eed 100644 --- a/01-plans/skills/rtt-agency/pre-experiment-baseline-frontend-collaboration.md +++ b/01-plans/skills/rtt-agency/pre-experiment-baseline-frontend-collaboration.md @@ -237,9 +237,11 @@ During and after the pilot, the following operational metrics will be recorded: - **Gitea Port & Auth**: Remote operations use port `2223` with scoped SSH keys (`anneux` for Anne; `kiskaadee` for Owner). - **Branch Protection**: No direct commits to `main` in `armonia-dashboard`. All work occurs in ephemeral worktrees. -### 7.2 Preconditions Before Pilot Execution -1. Owner review and explicit approval of this baseline document. -2. Formulation and approval of the `workshop-roster` Specification Contract and Verification Packet. +### 7.2 Explicit Multi-Stage Approval Sequence Before Pilot Execution +Committed drafts in the vault establish documentation readiness and version control, not binding project authorization. Formal progression requires three distinct Project Owner approvals: +1. **Approval of Operating Model & Scope Boundaries (`COLLABORATION-PLAN.md`)**: Confirms role authorities, scope containment, commit discipline, escalation paths, and decision reservations. +2. **Approval of Specification & Verification Contracts (`SPEC-WORKSHOP-ROSTER.md` & `VERIFICATION-PACKET-ROSTER.md`)**: Confirms acceptance criteria, exact API error contracts (409 disambiguation), status mappings, seed data, and pass/fail scenarios. +3. **Formal Authorization for Implementation**: Explicit owner greenlight to spawn the isolated worktree (`feat/anne/workshop-roster`) and delegate Phase 3 execution to Anne Droid. ### 7.3 Deferred Decisions (Explicitly Postponed) - **Repository Architecture**: Whether to create `rtt-agency` or maintain personas within `skills`.