From db3dbba2942a242cadb52d24e3b40804f9e3ecec Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Sun, 16 Aug 2026 14:50:34 +0200 Subject: [PATCH] No fixture seed, no event host, and the edit affordance stops lying Three changes the product model asked for. The fixture seed no longer writes anything into a connected wallet, by any route. `bootstrapWallet` is the single enforcement point -- both call sites funnel through it -- so the switch cannot be walked around by a screen or a bridge. The fixtures, the seeding code, the demo path and the rendering tests are untouched; a unit test now fails if a document is created after all. An event has no host. The domain says so -- the meeting point has a host, the event is only the anchor -- while the shape carried `hostName`/`hostInitials` and every created event was written with the fabricated `'Moi'` / `'MD'`. Gone from the shape, the ORM bindings, the type, the adapters, the writes and the screens. `fp:MeetingPoint.host` stays: that one is real. Regenerating the ORM revealed the committed bindings had drifted from what the generator emits -- stylistic, verified predicate by predicate, plus the loss of the `Fp` prefix. The prefix cannot be restored at the generator: the name comes from the shape IRI, and those IRIs are the persisted RDF classes. Aliased at the three import sites instead, so nothing downstream moved and the DOM `Event` and `Notification` types are never shadowed. Write rights are ownership, read from the list The contract leaves no other reading -- only an owner writes, and no call adds a writer -- so `listMyEntityDocs('public')` is what says which events are mine. The hard-coded `isOwner = true` is replaced by a three-state answer, and the UNKNOWN state renders neither a pencil nor a greyed one: a disabled look-alike invites a dead click. Two adversarial passes refuted the first attempt and both defects are fixed. A latched boolean denied an owner their own event forever once a listing had missed it; the ruling is now rebuilt rather than accumulated, so a later listing overturns an earlier one. Residual, deliberate and commented: "not mine" is inferred from absence, and the reactive read and the listing are separate mechanisms, so a freshly arrived event is ruled out for the window between them. Closing it needs a timer, which the doctrine forbids. --- .project/concepts/app-architecture/_debt.md | 2 + .project/concepts/bdd-testing/_debt.md | 8 + .project/concepts/data-layer/_debt.md | 6 + .../event/screens/CreateEventScreen.tsx | 7 - .../event/screens/EventDetailScreen.tsx | 36 +++- .../event/screens/MeetingPointsScreen.tsx | 2 - src/shared/context/FestipodDataContext.tsx | 148 +++++++++++++- src/shared/data/seedData.ts | 14 -- src/shared/data/shapeAdapters.ts | 2 - src/shared/data/types.ts | 8 +- .../shapes/orm/festipodShapes.schema.ts | 189 ++++++++++++++---- .../shapes/orm/festipodShapes.shapeTypes.ts | 38 ++-- .../shapes/orm/festipodShapes.typings.ts | 32 ++- src/shared/shapes/shex/festipodShapes.shex | 4 - src/shared/test-harness/harness-ng.tsx | 14 +- src/shared/test-harness/harness.tsx | 8 +- src/shared/utils/autoSeed.ts | 25 ++- src/shared/utils/ngBootstrap.test.ts | 44 ++++ src/shared/utils/ngBootstrap.ts | 12 +- 19 files changed, 472 insertions(+), 127 deletions(-) create mode 100644 .project/concepts/bdd-testing/_debt.md create mode 100644 src/shared/utils/ngBootstrap.test.ts diff --git a/.project/concepts/app-architecture/_debt.md b/.project/concepts/app-architecture/_debt.md index 6863127..8a46cc7 100644 --- a/.project/concepts/app-architecture/_debt.md +++ b/.project/concepts/app-architecture/_debt.md @@ -7,3 +7,5 @@ - TOUCHED src/shared/context/FestipodDataContext.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) - TOUCHED src/modules/event/screens/EventDetailScreen.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) - TOUCHED src/modules/user/screens/UpdateProfileScreen.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/modules/event/screens/CreateEventScreen.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/modules/event/screens/MeetingPointsScreen.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) diff --git a/.project/concepts/bdd-testing/_debt.md b/.project/concepts/bdd-testing/_debt.md new file mode 100644 index 0000000..d1c19a8 --- /dev/null +++ b/.project/concepts/bdd-testing/_debt.md @@ -0,0 +1,8 @@ +# Doc-debt — bdd-testing + +> Presence of a block = doc to update. Processed → delete the block; no blocks left → delete this file. +> One block = one "big change": `why` + `files` + `verify` (leaves to review). + +## Raw markers (consolidate into blocks, then delete) +- TOUCHED src/shared/test-harness/harness-ng.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/shared/test-harness/harness.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) diff --git a/.project/concepts/data-layer/_debt.md b/.project/concepts/data-layer/_debt.md index 8de5f5c..ebc6818 100644 --- a/.project/concepts/data-layer/_debt.md +++ b/.project/concepts/data-layer/_debt.md @@ -6,3 +6,9 @@ ## Raw markers (consolidate into blocks, then delete) - TOUCHED src/shared/context/FestipodDataContext.tsx @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) - TOUCHED src/shared/utils/currentPrincipal.ts @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/shared/shapes/shex/festipodShapes.shex @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/shared/utils/autoSeed.ts @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/shared/utils/ngBootstrap.ts @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/shared/utils/ngBootstrap.test.ts @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/shared/data/types.ts @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) +- TOUCHED src/shared/data/shapeAdapters.ts @2026-08-16 (session 0b064e8b-1717-421f-a20e-a4318ad217b1) diff --git a/src/modules/event/screens/CreateEventScreen.tsx b/src/modules/event/screens/CreateEventScreen.tsx index 3134d5d..076ea3f 100644 --- a/src/modules/event/screens/CreateEventScreen.tsx +++ b/src/modules/event/screens/CreateEventScreen.tsx @@ -101,8 +101,6 @@ export function CreateEventScreen() { // truth (and every other viewer) was 0. participantCount: 0, themes: ['Social'], - hostName: 'Moi', - hostInitials: 'MD', }); } catch (err) { console.error('[CreateEvent] createEvent failed:', err); @@ -238,11 +236,6 @@ export function CreateEventScreen() { {ev.date} · {ev.location} - {ev.hostName && ( - - Relayé par {ev.hostName} - - )}