plan(skills): tighten contracts, seed safety, and governance in collaboration pilot
Brain Structural Validation / Validate Markdown Structure & Links (push) Successful in 7s

- 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
This commit is contained in:
kiskaadee committed 2026-10-26 09:19:41 -05:00
1 parent 1148cc19c8
commit e134d292fd
3 files changed
+18 -14

No files matched your search

@@ -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)`. - **Capacity Display**: Formatted as `Ocupación: {occupied_count} / {max_capacity} ({attended_count} presentes)`.
- **409 Conflict Disambiguation & Reconciliation Contract**: - **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`: 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` 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. 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` 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. 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. - **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 ### 2.2 Status Terminology Mapping Table
@@ -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 | | 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` | | **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 zoneinfo import ZoneInfo
from pathlib import Path from pathlib import Path
db_filename = 'test_armonia.db' # Deterministic absolute path anchoring
if Path(db_filename).exists(): abs_db_path = (Path.cwd() / 'test_armonia.db').resolve()
Path(db_filename).unlink() 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 from app.core.config import settings
settings.database_url = f'file:{db_filename}' 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}' assert codes == {'ADS-1001', 'ADS-1002'}, f'Preflight 3 Failed: Missing expected codes {codes}'
# Preflight 4: File existence & non-empty database target # Preflight 4: File existence & non-empty database target
p = Path(db_filename) assert abs_db_path.exists() and abs_db_path.stat().st_size > 0, 'Preflight 4 Failed: Database file missing or empty'
assert p.exists() and p.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()) asyncio.run(seed_and_verify())
" "
@@ -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). - **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. - **Branch Protection**: No direct commits to `main` in `armonia-dashboard`. All work occurs in ephemeral worktrees.
### 7.2 Preconditions Before Pilot Execution ### 7.2 Explicit Multi-Stage Approval Sequence Before Pilot Execution
1. Owner review and explicit approval of this baseline document. Committed drafts in the vault establish documentation readiness and version control, not binding project authorization. Formal progression requires three distinct Project Owner approvals:
2. Formulation and approval of the `workshop-roster` Specification Contract and Verification Packet. 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) ### 7.3 Deferred Decisions (Explicitly Postponed)
- **Repository Architecture**: Whether to create `rtt-agency` or maintain personas within `skills`. - **Repository Architecture**: Whether to create `rtt-agency` or maintain personas within `skills`.