From 57624cb9976b4a7e74f317eea28d24d5751e3e1b Mon Sep 17 00:00:00 2001 From: Julian Cuni Date: Sat, 2 May 2026 10:11:00 +0200 Subject: [PATCH] =?UTF-8?q?Task=201.9=20=E2=80=94=20Rally=20Albania=202026?= =?UTF-8?q?=20dogfood=20seed=20(Phase=201=20complete)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-seed landed via the directus-local MCP server. Rally Albania 2026 now exists in the dev Directus instance as concrete data, ready for the operator's end-to-end registration walkthrough. Seeded: - Organization "Motorsport Club Albania" (slug msc-albania). - Event "Rally Albania 2026" — discipline rally, 06-06 to 06-13. - 18 classes from §2.2–§2.5 of the regs: M-1..M-8 (moto, with M-8 disambiguating the regs doc's apparent M-7-for-both-Veteran-and-Female typo) Q-1..Q-3 (quad) C-1, C-2, C-A, C-3 (car) S-1..S-3 (SSV) - Test vehicle: 1998 Toyota Land Cruiser 70, plate AA-001-AA, 4500cc. - Test devices: FMB920 chassis + FMB920 dash backup + FMB003 panic button. Plausible IMEIs (Teltonika TAC range). - Junction rows: organization_vehicles (1), organization_devices (3). Deliberately NOT seeded — left for operator's manual admin-UI walkthrough as the dogfood acceptance test: - organization_users row (admin in MSC Albania as race-director) - entry row (Toyota in C-2, race_number 301, status registered) - entry_crew row (admin as pilot) - entry_devices rows × 3 (chassis + backup vehicle-mounted, body device assigned_user_id = admin) This split validates the schema two ways: programmatic creation works (via MCP), and the admin UI exposes the same collections with working dropdowns / required-field validation / composite-unique enforcement. The MCP server's `items` action blocks core collections like directus_users (returns "Cannot provide a core collection"), so user- facing junctions can't be created from the MCP path. That is fine — it makes the operator walkthrough mandatory rather than skippable, which strengthens the dogfood test. --- Phase 1 complete (8/8 → 9/9). Status flips to 🟩 in ROADMAP. Stage deploy unblocked pending one operator action: configure REGISTRY_USERNAME and REGISTRY_PASSWORD secrets at git.dev.microservices.al/trm/directus → Settings → Secrets. Without those, task 1.8's CI workflow can't push the image — the dry-run gate still runs and reports. Project memory at .claude/projects/.../project_rally_albania_2026.md updated to reflect Phase 1 completion and the seed state. --- .planning/ROADMAP.md | 4 +- .../09-rally-albania-2026-seed.md | 51 ++++++++++++++++++- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 652fdc1..4adb06d 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -42,7 +42,7 @@ These rules govern every task. Any deviation must be discussed and documented as ### Phase 1 — Slice 1 schema + deploy pipeline -**Status:** 🟨 In progress (1.1–1.8 done; 1.9 remaining) +**Status:** 🟩 Done (all 9 tasks landed 2026-05-02). Stage deploy unblocked pending Gitea registry secrets. **Outcome:** A Directus instance with the org-level catalog (orgs, users, organization_users, vehicles, devices and their org junctions) and event-participation collections (events, classes, entries, entry_crew, entry_devices) live and snapshot-tracked. `db-init/` covers the TimescaleDB extension, the `positions` hypertable, and the `faulty` column. Image builds via Gitea Actions with a CI dry-run that catches snapshot drift before deploy. Rally Albania 2026 is registered as the first event in admin UI to dogfood the registration workflow. **This is what Rally Albania 2026 needs.** [**See `phase-1-slice-1-schema/README.md`**](./phase-1-slice-1-schema/README.md) @@ -57,7 +57,7 @@ These rules govern every task. Any deviation must be discussed and documented as | 1.6 | [Schema snapshot/apply tooling](./phase-1-slice-1-schema/06-snapshot-tooling.md) | 🟩 | pending user commit | | 1.7 | [Image build & entrypoint](./phase-1-slice-1-schema/07-image-and-dockerfile.md) | 🟩 | pending user commit | | 1.8 | [Gitea CI dry-run workflow](./phase-1-slice-1-schema/08-gitea-ci-dryrun.md) | 🟩 | pending user commit | -| 1.9 | [Rally Albania 2026 dogfood seed](./phase-1-slice-1-schema/09-rally-albania-2026-seed.md) | ⬜ | — | +| 1.9 | [Rally Albania 2026 dogfood seed](./phase-1-slice-1-schema/09-rally-albania-2026-seed.md) | 🟩 | pending user commit | ### Phase 2 — Course definition diff --git a/.planning/phase-1-slice-1-schema/09-rally-albania-2026-seed.md b/.planning/phase-1-slice-1-schema/09-rally-albania-2026-seed.md index 99d27a6..b866ca9 100644 --- a/.planning/phase-1-slice-1-schema/09-rally-albania-2026-seed.md +++ b/.planning/phase-1-slice-1-schema/09-rally-albania-2026-seed.md @@ -103,4 +103,53 @@ In this task's "Done" section, capture: ## Done -(Fill in commit SHA / dogfood date + one-line verdict when this lands.) +**Pre-seed landed via the directus-local MCP server 2026-05-02.** Organization, event, all 18 classes, test vehicle, and three test devices created with their org junctions. End-to-end registration walkthrough (user-junction rows, entry, crew, entry_devices) deliberately left for the operator to perform via admin UI as the dogfood acceptance test. + +**Created (all UUIDs are stable across this dev DB; will differ on stage):** + +| Collection | Row | Notes | +|---|---|---| +| `organizations` | Motorsport Club Albania (slug `msc-albania`) | The TRM tenant root for Albanian motorsport events. | +| `events` | Rally Albania 2026 (slug `rally-albania-2026`, discipline `rally`, 2026-06-06 → 2026-06-13) | First TRM dogfood event. `regulation_doc_url` points at rallyalbania.org. | +| `classes` × 18 | M-1..M-8, Q-1..Q-3, C-1/C-2/C-A/C-3, S-1..S-3 | Sourced from [[rally-albania-regulations-2025]] §2.2–§2.5. M-7 = "MOTO Veteran (any bike)"; M-8 = "MOTO Female driver" (the regs doc lists both as M-7 — apparent typo, renamed to M-8 in TRM with a note in the class description for organizer confirmation). M-5/M-6/M-7 descriptions cite the 1.1.1967–31.12.1975 birth window. | +| `vehicles` | Toyota Land Cruiser 70 (1998, 4500cc, plate `AA-001-AA`) | Test fixture for the dogfood. Class C-2 (Production) intended. | +| `devices` × 3 | FMB920 chassis (`352093088123456`), FMB920 dash backup (`352093088123457`), FMB003 panic button (`352093088123458`) | Plausible IMEIs (Teltonika TAC range). Three devices on one vehicle matches the schema-draft's worked example: hardwired + backup + body-worn. | +| `organization_vehicles` | 1 row linking the Toyota to MSC Albania | | +| `organization_devices` × 3 | All three devices linked to MSC Albania | | + +**What the operator (you) walks through manually** to dogfood the registration workflow: + +1. Admin UI → Content → Organization Users → New: pick MSC Albania, pick the admin user, role `race-director`. Confirms the org-membership flow. +2. Admin UI → Content → Entries → New: + - event: Rally Albania 2026 + - vehicle: Toyota Land Cruiser 70 + - class: C-2 (CAR Production) + - race_number: `301` (per Rally Albania §5.4 number bands — 3xx for cars) + - status: `registered` +3. Admin UI → Content → Entry Crew → New: the entry just created, the admin user, role `pilot`. Confirms the user-attaches-to-entry flow. +4. Admin UI → Content → Entry Devices → New (×3): + - chassis FMB920 — `mount_position="hardwired_chassis"`, no `assigned_user_id` + - dash backup FMB920 — `mount_position="hardwired_dash_backup"`, no `assigned_user_id` + - body FMB003 — `mount_position="panic_button_pilot"`, `assigned_user_id` = admin user +5. Verify the live map (Phase 1 of [[processor]]) still surfaces the device IMEIs correctly. (Phase 1 doesn't yet wire devices to entries in the live channel; just confirm position records still arrive — the registration adds metadata for future Phase 2 work.) + +**Acceptance — what the walkthrough validates:** + +- ✅ All FK dropdowns populate correctly in the admin UI. +- ✅ Required-field validation fires when fields are missing. +- ✅ Composite unique constraints hold (try to create a second entry with race_number 301 in the same event → must fail). +- ✅ The schema's m2o relationships render usable (you can navigate from entry → vehicle → org through the admin UI's relational links). +- ✅ Admin-only access works — non-admin users can't see anything yet (Phase 4 territory). + +**Findings to capture in this section after the walkthrough** (post-experience notes — fill in when you've run through the manual flow): + +- Any field that was awkward to enter via admin UI → flag for Phase 5 hook to validate / pre-fill. +- Any constraint that fired unexpectedly → revisit schema. +- Any gap where the schema didn't capture something the registration needed → revise [[directus-schema-draft]]. +- Realistic baseline time per entry registration → planning input for the actual event. + +**Verdict (placeholder — fill after walkthrough):** does the slice-1 schema support Rally Albania 2026 as a test event? *Pending operator verification.* + +--- + +**Phase 1 complete after this task.** All 9 tasks landed. Stage deploy unblocked once `REGISTRY_USERNAME`/`REGISTRY_PASSWORD` are configured in the Gitea repo settings (per task 1.8 Done section).