@topy-ai/maggie 0.7.38 → 0.7.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README-zh-TW.md +82 -6
  2. package/README.md +99 -7
  3. package/bin/maggie.js +30 -3
  4. package/bundled-contracts/maggie-clone/interaction-state-v1.schema.json +26 -0
  5. package/bundled-contracts/maggie-content/provenance-v1.schema.json +20 -0
  6. package/bundled-contracts/maggie-design/brand-kit-v1.schema.json +18 -0
  7. package/bundled-contracts/maggie-design/browser-interactions-v1.schema.json +27 -0
  8. package/bundled-contracts/maggie-design/css-utility-evidence-v1.schema.json +10 -0
  9. package/bundled-contracts/maggie-design/dashboard-surface-v1.schema.json +11 -0
  10. package/bundled-contracts/maggie-design/progressive-enhancement-v1.schema.json +12 -0
  11. package/bundled-contracts/maggie-design/sample-surface-v1.schema.json +13 -0
  12. package/bundled-contracts/maggie-design/style-editing-v1.schema.json +35 -0
  13. package/bundled-contracts/maggie-media/image-generation-policy-v1.json +28 -0
  14. package/bundled-contracts/maggie-media/video-generation-policy-v1.json +40 -0
  15. package/bundled-contracts/maggie-media/video-job-v1.schema.json +20 -0
  16. package/bundled-contracts/maggie-media/video-playback-evidence-v1.schema.json +15 -0
  17. package/bundled-contracts/maggie-ops/npm11-preflight-v1.schema.json +17 -0
  18. package/bundled-contracts/maggie-scaffold/host-scaffold-v1.schema.json +25 -0
  19. package/bundled-contracts/maggie-seo/gsc-readiness-v1.schema.json +19 -0
  20. package/bundled-contracts/maggie-seo/privacy-origin-evidence-v1.schema.json +11 -0
  21. package/bundled-contracts/maggie-service-booking/delivery-provider-default-v1.json +8 -0
  22. package/bundled-contracts/maggie-service-booking/delivery-provider-v1.schema.json +16 -0
  23. package/bundled-contracts/maggiedash/booking-access-v1.json +5 -4
  24. package/bundled-contracts/maggiedash/booking-customer-surface-v1.json +12 -1
  25. package/bundled-contracts/maggiedash/booking-email-templates-v1.json +2 -0
  26. package/bundled-contracts/maggiedash/booking-host-adapter-v1.json +14 -2
  27. package/bundled-contracts/maggiedash/booking-runtime.v1.json +41 -0
  28. package/bundled-contracts/maggiedash/browser-session-v1.schema.json +18 -0
  29. package/bundled-contracts/maggiedash/content-overrides-v1.schema.json +19 -0
  30. package/bundled-contracts/maggiedash/execution-board.json +526 -26
  31. package/bundled-contracts/maggiedash/host-capabilities-v1.schema.json +10 -0
  32. package/bundled-contracts/maggiedash/public-session-cache-v1.schema.json +17 -0
  33. package/bundled-contracts/maggiedash/site-structure-v1.schema.json +13 -0
  34. package/bundled-references/browser-inspection.md +21 -0
  35. package/bundled-references/maggiedash-booking/ARCHITECTURE.md +218 -0
  36. package/bundled-references/maggiedash-booking/CURRENT-STATE.md +92 -0
  37. package/bundled-references/maggiedash-booking/DATA-FLOW.md +143 -0
  38. package/bundled-references/maggiedash-booking/DATA-MODEL.md +367 -0
  39. package/bundled-references/maggiedash-booking/DECISIONS.md +94 -0
  40. package/bundled-references/maggiedash-booking/EXECUTION-BOARD.json +2387 -0
  41. package/bundled-references/maggiedash-booking/HOST-ADAPTER.md +314 -0
  42. package/bundled-references/maggiedash-booking/ORAWELLNESS-INTEGRATION-AUDIT.md +227 -0
  43. package/bundled-references/maggiedash-booking/PAYMENT-GATEWAY.md +267 -0
  44. package/bundled-references/maggiedash-booking/PRD.md +228 -0
  45. package/bundled-references/maggiedash-booking/PROGRESS.md +2434 -0
  46. package/bundled-references/maggiedash-booking/QA-TEST-PLAN.md +235 -0
  47. package/bundled-references/maggiedash-booking/README.md +271 -0
  48. package/bundled-references/maggiedash-booking/RUNTIME-OPERATIONS.md +152 -0
  49. package/bundled-references/maggiedash-booking/SECURITY-COMPLIANCE.md +158 -0
  50. package/bundled-references/maggiedash-booking/SKILLS-AND-CLI.md +542 -0
  51. package/bundled-references/maggiedash-booking/STRIPE-INTEGRATION.md +129 -0
  52. package/bundled-references/maggiedash-booking/TASK-RUNBOOK.md +107 -0
  53. package/bundled-references/maggiedash-booking/TASKS.md +137 -0
  54. package/bundled-references/maggiedash-booking/USER-JOURNEYS.md +224 -0
  55. package/bundled-references/maggiedash-booking/diagrams/booking-dfd.excalidraw +1 -0
  56. package/bundled-references/maggiedash-booking/diagrams/booking-dfd.mmd +16 -0
  57. package/bundled-references/maggiedash-booking/diagrams/booking-dfd.png +0 -0
  58. package/bundled-references/maggiedash-booking/diagrams/booking-dfd.svg +1 -0
  59. package/bundled-references/maggiedash-booking/diagrams/booking-state-machine.mmd +19 -0
  60. package/bundled-references/maggiedash-booking/diagrams/booking-state-machine.png +0 -0
  61. package/bundled-references/maggiedash-booking/diagrams/booking-state-machine.svg +1 -0
  62. package/bundled-references/maggiedash-booking/diagrams/manager-journey.excalidraw +1 -0
  63. package/bundled-references/maggiedash-booking/diagrams/manager-journey.mmd +11 -0
  64. package/bundled-references/maggiedash-booking/diagrams/manager-journey.png +0 -0
  65. package/bundled-references/maggiedash-booking/diagrams/manager-journey.svg +1 -0
  66. package/bundled-references/maggiedash-booking/diagrams/payment-sequence.mmd +20 -0
  67. package/bundled-references/maggiedash-booking/diagrams/payment-sequence.png +0 -0
  68. package/bundled-references/maggiedash-booking/diagrams/payment-sequence.svg +1 -0
  69. package/bundled-references/maggiedash-booking/diagrams/system-context.excalidraw +1 -0
  70. package/bundled-references/maggiedash-booking/diagrams/system-context.mmd +10 -0
  71. package/bundled-references/maggiedash-booking/diagrams/system-context.png +0 -0
  72. package/bundled-references/maggiedash-booking/diagrams/system-context.svg +1 -0
  73. package/bundled-skills/maggie-blog/SKILL.md +12 -0
  74. package/bundled-skills/maggie-blog-bootstrap/SKILL.md +39 -0
  75. package/bundled-skills/maggie-booking/SKILL.md +112 -18
  76. package/bundled-skills/maggie-clone/SKILL.md +13 -0
  77. package/bundled-skills/maggie-deployment/SKILL.md +6 -0
  78. package/bundled-skills/maggie-design/SKILL.md +64 -3
  79. package/bundled-skills/maggie-ops/SKILL.md +12 -0
  80. package/bundled-skills/maggie-seo-geo/SKILL.md +45 -0
  81. package/bundled-skills/maggie-service-booking/SKILL.md +14 -0
  82. package/bundled-tools/clis/maggie_analytics.py +43 -1
  83. package/bundled-tools/clis/maggie_booking.py +161 -26
  84. package/bundled-tools/clis/maggie_browser_audit.py +99 -3
  85. package/bundled-tools/clis/maggie_clone.py +46 -1
  86. package/bundled-tools/clis/maggie_contracts.py +393 -0
  87. package/bundled-tools/clis/maggie_dash.py +22 -6
  88. package/bundled-tools/clis/maggie_design.py +84 -12
  89. package/bundled-tools/clis/maggie_service_booking.py +50 -1
  90. package/bundled-tools/clis/maggie_workflows.py +387 -0
  91. package/bundled-tools/clis/site_audit.py +77 -1
  92. package/bundled-tools/integrations/analytics.md +14 -0
  93. package/bundled-tools/runtime/site_baseline.py +3 -0
  94. package/package.json +1 -1
  95. package/references/browser-inspection.md +21 -0
@@ -0,0 +1,2434 @@
1
+ # MaggieDash Booking progress log
2
+
3
+ Task board coverage: BK-017 through BK-103. Current board state is 84 passed
4
+ and 3 `needs-evidence` tasks (BK-030, BK-031, BK-032). The MaggieDash release
5
+ baseline is version `0.2.8` at commit `9d99de7` on `origin/main`; this working
6
+ tree also contains the uncommitted BK-099/BK-100 extensions and the disabled-
7
+ account reset hardening. The
8
+ remaining tasks are real-host evidence gates plus explicitly documented
9
+ monetization follow-ups, not missing local booking primitives.
10
+
11
+ This is an append-only historical ledger. Counts such as 44 routes, 9 email
12
+ events, or 32 runtime observations in older entries describe the contract at
13
+ that point in time. The current contract is 47 manager endpoints, 11 public
14
+ customer endpoints, 10 email events, and 15 browser routes; see
15
+ [`CURRENT-STATE.md`](./CURRENT-STATE.md) for the authoritative snapshot.
16
+
17
+ ## 2026-09-21 — BK-103 consented Stripe no-show fee charging
18
+
19
+ - Completed the no-show flow as two deliberate steps: marking a booking
20
+ `no_show` still produces a review-only settlement, while a separate manager
21
+ or finance action can charge the policy-derived fee only after explicit
22
+ confirmation, customer consent, a saved provider payment method, and a
23
+ verified Stripe off-session capability.
24
+ - Ordinary customer payments now use `PaymentIntent` with
25
+ `setup_future_usage=off_session` when the customer agrees to save a payment
26
+ method. Stripe payment/setup webhooks persist the provider customer and
27
+ payment-method references for future use; SetupIntent remains reserved for
28
+ setup-only flows.
29
+ - Successful charges persist an `adjustment` payment attempt and audit/event
30
+ evidence, with stable idempotency. The generic Astro host and ORA mirror
31
+ queue `payment.no_show_fee` through the existing Resend outbox only after a
32
+ successful charge; pending or failed provider results remain visible for
33
+ manual handling.
34
+ - Added the versioned 47-route manager contract, reference-host coverage,
35
+ installed CLI contract parity, and the customer consent checkbox. ORA's
36
+ local `ST_SECRECT_KEY` alias is accepted for the existing test account while
37
+ `STRIPE_SECRET_KEY` remains the documented canonical name.
38
+ - Evidence: central Stripe/route/reference-host validators and `npm test`,
39
+ ORA `contract:check` and Astro check/build (193 files, 0
40
+ errors/warnings/hints), and whitespace validation. No production database
41
+ migration or live charge was performed.
42
+
43
+ ## 2026-09-21 — Protected Booking redirect compatibility
44
+
45
+ - Fixed the generic Astro host and ORA login pages so middleware-rewritten
46
+ `/maggie/*` paths are normalized back to the public `/_maggie/*` path after
47
+ sign-in. This preserves the original destination when an unauthenticated
48
+ user opens Booking directly and still rejects external redirect targets.
49
+ - Disposable ORA runtime evidence now covers first-owner registration, password
50
+ login, direct protected-route redirect, authenticated Booking overview and
51
+ Staff screens, and zero application console errors. Responsive captures at
52
+ 375, 768, and 1280 pixels were also generated.
53
+ - The only remaining browser caveat is Astro's development-toolbar warning
54
+ inside the intentionally sandboxed email-template preview iframe; it is a
55
+ dev-only injected script warning and is absent from the production build.
56
+
57
+ ## 2026-09-21 — Fail-closed first-run setup state
58
+
59
+ - Generic Astro and ORA registration/login pages now catch missing Booking
60
+ tables and render a clear `Finish Booking setup` screen with the exact
61
+ `maggie booking install --confirm --bootstrap` next step instead of exposing
62
+ a database 500 during an incomplete install.
63
+ - The state is covered by the generic Astro bootstrap validator, and both
64
+ MaggieDash `npm test` and the ORA `astro check`/`astro build` pass.
65
+ - The login preflight now checks the core, Booking, and access tables even when
66
+ the visitor has no session cookie. A fresh install therefore reaches the same
67
+ setup-required state instead of showing a login form that can only fail.
68
+ - The generic Booking page now enforces the same access boundary as its APIs:
69
+ owner/admin accounts pass directly, while staff/finance/manager accounts
70
+ need an active Booking role; a `staff` account also needs its staff profile
71
+ link. Ordinary Maggie dashboard editors and unlinked staff accounts receive
72
+ a bounded 403 instead of an error-filled Booking shell.
73
+
74
+ ## 2026-09-21 — Stripe readiness hardening
75
+
76
+ - Env-key presence no longer claims a Stripe account is connected. Bootstrap
77
+ reports `pending` when both Stripe secrets exist and requires the manager's
78
+ server-side verification action before preserving `connected`.
79
+ - Stripe verification now requires explicit `charges_enabled === true` and
80
+ `payouts_enabled === true`; missing or false fields produce `degraded`.
81
+ - Deployment-managed provider credentials remain in the secret store. The
82
+ optional dashboard-managed Stripe path accepts values only from an
83
+ owner/manager over HTTPS, verifies them before storage, and persists only
84
+ authenticated ciphertext; raw values are never returned or sent to the
85
+ public browser bundle.
86
+ - Central and ORA host validators/build checks passed after the change.
87
+
88
+ ## 2026-09-21 — Dashboard-managed Stripe connection
89
+
90
+ - Closed the first-run gap where a business owner could only configure Stripe
91
+ outside Booking. The Overview setup panel now accepts a secret key and
92
+ webhook secret for owner/manager sessions and clears both fields after the
93
+ request.
94
+ - The generic Astro host and ORA mirror validate the pair with Stripe before
95
+ writing it. Dashboard values are AES-256-GCM ciphertext keyed from
96
+ `BOOKING_TOKEN_SECRET`; deployment `STRIPE_SECRET_KEY` remains authoritative,
97
+ and staff/finance sessions cannot submit provider credentials.
98
+ - Additive schema columns, host bootstrap markers, CLI setup guidance, and
99
+ integration docs were synchronized. MaggieDash npm tests, host/schema gates,
100
+ ORA contract/build, ai-cmo Booking tests, packaged inspect/setup, and task
101
+ validation passed. Production migration, live API verification, and worker
102
+ enablement remain explicit host evidence gates.
103
+
104
+ ## 2026-09-21 — ORA production database preflight
105
+
106
+ - Ran `npm run booking:schema -- --dry-run` against the configured ORA
107
+ PostgreSQL connection. All four schema files, including host extensions,
108
+ executed inside a transaction and rolled back successfully; no production
109
+ rows or tables were changed.
110
+ - Ran `npm run booking:schema -- --check` and the read-only worker preview. The
111
+ current database has the core MaggieDash tables but not
112
+ `maggiedash_booking_allocations` or `maggiedash_booking_user_roles`; both
113
+ commands correctly report `needs-migration` and the worker refuses to run.
114
+ - The next production action is owner-approved backup/restore evidence followed
115
+ by `node scripts/maggie-booking-schema.mjs --apply --confirm`. Until that
116
+ happens, first-owner registration, Stripe connection, live calendar data,
117
+ and Resend booking delivery remain intentionally unavailable.
118
+
119
+ ## 2026-09-21 — Published CLI parity audit
120
+
121
+ - The local source CLI and regenerated bundled CLI pass
122
+ `maggie booking inspect --project /home/balalior/Dev/clients/orawellness.uk`.
123
+ - The currently published npm `@topy-ai/maggie@0.7.38` was tested separately and
124
+ still reports contract drift against the current ORA/MaggieDash surface: it
125
+ expects the old seven Booking email events and nine public customer
126
+ endpoints. This is a release artifact gap, not an ORA runtime failure.
127
+ - The next release must regenerate `bundled-contracts`, `bundled-tools`, and
128
+ bundled skills from this source tree, then run the published-package install
129
+ and inspect regression before npm publication. The repository now has
130
+ `node scripts/validate-cli-package.mjs` and a CI package smoke gate for this
131
+ exact tarball check. Until that release is
132
+ published, users must use the local CLI/source or will receive the stale
133
+ 0.7.38 contract validator.
134
+ - The source package is now prepared as the `0.7.39` release candidate; it
135
+ still requires npm publication and a registry-based install/inspect
136
+ regression before external users receive the current Booking contracts.
137
+
138
+ ## 2026-09-21 — Self-contained Booking npm bundle
139
+
140
+ - The package assembler now ships the Booking runbook and sanitized runtime
141
+ fixture under bundled references/contracts and rewrites repository-only
142
+ links for installed users.
143
+ - `python3 scripts/validate_skills.py` now passes all 20 skills and bundled
144
+ Markdown links; the exact `0.7.39` tarball also passes Booking contract,
145
+ access, Resend-template, task-board, and ORA inspect checks.
146
+
147
+ ## 2026-09-21 — Astro middleware install compatibility
148
+
149
+ - The Booking installer now merges its rewrite block into both conventional
150
+ Astro middleware signatures: a full `context` parameter and the common
151
+ destructured `({ url, request }, next)` parameter.
152
+ - Unsupported custom middleware remains preserved and fail-closed. A
153
+ disposable Astro install with the starter's existing middleware now returns
154
+ `booking inspect: passed` instead of requiring manual integration.
155
+ - Added an installer regression test for the destructured form; the MaggieDash
156
+ install and Booking CLI test suites passed.
157
+
158
+ ## 2026-09-21 — Dashboard Stripe connection path
159
+
160
+ - Added an owner/manager-only Booking Overview form for hosts that do not use
161
+ a deployment secret store for Stripe. Both the API secret and webhook secret
162
+ are verified with Stripe before persistence.
163
+ - Dashboard-managed credentials are sealed with AES-256-GCM using a key derived
164
+ from `BOOKING_TOKEN_SECRET`; only fingerprints and redacted status reach the
165
+ browser. Deployment-managed `STRIPE_SECRET_KEY` remains authoritative.
166
+ - Updated the generic Astro host, ORA host mirror, install schema, Booking UI,
167
+ and Stripe integration documentation. Production migration and live Stripe
168
+ verification remain release evidence tasks.
169
+
170
+ ## 2026-09-21 — Customer contract parity
171
+
172
+ - Fixed the ai-cmo-skills compact and bundled customer contracts to include the
173
+ two public package checkout/payment-return endpoints introduced in the
174
+ MaggieDash customer surface. The canonical count is now 11 everywhere.
175
+ - `maggie booking inspect --project /home/balalior/Dev/clients/orawellness.uk`
176
+ now passes with no contract drift errors; Python Booking tests and board
177
+ validation also pass.
178
+ - `maggie booking setup` now reports a complete Stripe key pair as
179
+ `online-payments-pending-verification` and prints the next step to run
180
+ **Verify Stripe connection** after signing in; it does not equate env-key
181
+ presence with a live provider connection.
182
+
183
+ ## Current snapshot — 2026-09-21
184
+
185
+ - MaggieDash `main` and `origin/main` point to `9d99de7` (`fix: make booking
186
+ catalog runtime-safe`). The package and distribution manifest
187
+ report `0.2.8`.
188
+ - The current source contains the separate `booking/src` workspace, manager
189
+ and public customer contracts, 47-route reference host, PostgreSQL core and
190
+ worker seams, injected payment boundary, runtime/ops contracts, browser
191
+ evidence workflow, priority/FIFO waitlist matching, 24-hour reminder enqueue job, payment policies with
192
+ deposit/balance projection, manager customer history, complete schedule-rule
193
+ management, editable service/treatment catalogue management, editable
194
+ staff/resource management, editable schedule-rule management, and
195
+ installation mappings, live-configuration manager booking creation, and
196
+ multi-treatment manager appointments with per-segment allocations, public
197
+ multi-treatment customer holds and checkout, tenant-scoped notification
198
+ inspection/dead-letter replay, tenant-scoped treatment package catalogue
199
+ management, customer package entitlements, balance reads, expiry enforcement,
200
+ and atomic manager-booking redemption. Public package checkout, token-bound
201
+ payment return, Stripe webhook/reconciliation fulfillment, manager purchase
202
+ listing, guarded package refunds, and cancellation-safe package-credit
203
+ restoration are now implemented locally; real-host
204
+ payment and migration evidence remains pending.
205
+ - Public customer package redemption is now implemented: a confirmed package
206
+ return links to the public booking page, the hold binds the opaque
207
+ entitlement to the customer's email record, and checkout locks the
208
+ entitlement, redeems every matching treatment in the same booking
209
+ transaction, and confirms a fully covered booking without starting a payment.
210
+ - BK-099 adds cancellation-safe package credit restoration. Manager and eligible
211
+ customer cancellations lock active redemption rows, decrement the matching
212
+ `quantity_redeemed` values, mark the ledger rows `reversed`, restore an
213
+ exhausted entitlement to `active` when it has not expired, and append the
214
+ reversal result to the booking event. Completed and no-show visits remain
215
+ consumed. Central reference-host manager/customer regressions passed.
216
+ - The installer now generates a reviewed single-flight worker schedule with
217
+ `maggie booking install --schedule systemd` or
218
+ `maggie booking worker-schedule --scheduler cron`; it writes deployment
219
+ artifacts only and never enables a service, edits crontab, starts a worker,
220
+ or exposes secrets.
221
+ - Treatment preparation and cleanup buffers are now operational rules rather
222
+ than catalogue-only metadata. Availability, holds, manager bookings,
223
+ customer bookings, rescheduling, multi-treatment segment timing, and reference
224
+ hosts use expanded occupied ranges; new PostgreSQL allocations persist those
225
+ ranges and carry `buffer_version = 1`.
226
+ - Cancellation/refund policy is normalized in catalogue configuration,
227
+ snapshotted on manager/customer/waitlist-created bookings, exposed in the
228
+ installed catalogue UI, and enforced at the customer cancellation cutoff.
229
+ Allowed cancellations now calculate a policy-safe refund settlement and call
230
+ the injected provider after the lifecycle write. Accepted or pending refunds
231
+ queue the existing Resend `payment.refunded` outbox notification; provider
232
+ outages return `manual_required` without claiming success. No-show fees are
233
+ calculated and now return a manager-facing `review_required` settlement;
234
+ automatic off-session charging remains a separate provider-consent task.
235
+ - Calendar Day/Week now uses the requested venue-local range in the PostgreSQL
236
+ repository and reference host. Week is Monday–Sunday, day/week results keep
237
+ staff scoping, and the manager UI labels the actual period.
238
+ - Booking team access is now a separately versioned install contract. The
239
+ MaggieDash distribution includes its administrator-only access route,
240
+ email/password and Resend invitation policy, granular role permissions,
241
+ schema, Team access UI, and a standalone CLI validator. This prevents a
242
+ fresh host install from silently omitting the staff-login management seam.
243
+ - The deterministic reference host now exercises owner-only Team access CRUD,
244
+ safe Resend invitation intent, permission updates, audit records, revocation,
245
+ and staff-session denial. This closes the gap where the access UI was static
246
+ but the reference browser host did not implement its endpoint.
247
+ - The Booking installer now supports explicit `--install-dependencies`. It
248
+ detects npm/pnpm/yarn/bun from the host lockfile and adds only missing React,
249
+ Phosphor, Tailwind, PostgreSQL, Stripe, and SSR adapter packages; a blank
250
+ Astro host receives a portable Node server config, while an existing
251
+ deployment adapter remains host-owned. `--dry-run` and `--diff` reject this
252
+ mutation before invoking a package manager.
253
+ - Resend delivery is implemented as a secret-safe outbox with retry,
254
+ dead-letter, replay, invitations, and reminders. Tenant-editable Booking
255
+ email templates now have a versioned ten-event contract, including package
256
+ purchase confirmation/refund and no-show fee events, with allowlisted
257
+ renderer, sandboxed manager preview, audited draft/publish/rollback, and
258
+ published-template resolution in both generic and ORA Resend workers. The
259
+ template contract never returns provider credentials or recipient addresses.
260
+ - The default GitHub source now declares the Astro `hostBootstrap`; a fresh
261
+ disposable Astro install from that public source copied 139 source artifacts
262
+ and 23 host files, then passed the installed host validator and
263
+ `maggie booking inspect`.
264
+ - Current local evidence: MaggieDash `npm test`, the 47-endpoint reference-host
265
+ suite, Booking UI validators, TSX parse, disposable PostgreSQL schema/core/
266
+ worker integration, backup/restore rehearsal, and fresh install projection
267
+ all passed. The browser evidence
268
+ contract now covers all 15 manager routes at 390/768/1440 widths (45 screens);
269
+ a fresh authenticated host capture is still required. The earlier 33/33
270
+ browser smoke covered only the former 11-route surface and is not reused as
271
+ production evidence. This is local/reference-host evidence only.
272
+ - BK-068 adds the public customer-manage history route. A valid 30-day manage
273
+ token now returns the current booking plus tenant/customer-scoped redacted
274
+ appointment summaries, and the optional customer page renders them without
275
+ identity fields. Central and ORA flow, reference-host, PostgreSQL adapter,
276
+ and UI validators passed; real Resend-link and staging evidence remain open.
277
+ - BK-030's source-level PostgreSQL transaction/lock cycle, alert contract, and
278
+ backup/restore rehearsal now pass against disposable PostgreSQL; it still
279
+ needs host-owned connection, alert routing, backup/restore ownership, and
280
+ recovery evidence. BK-031
281
+ still needs an authenticated HTTPS host runtime and browser capture. BK-032
282
+ now correctly remains `needs-evidence` until those artifacts pass the final
283
+ fail-closed release gate.
284
+ - ORA host preflight on 2026-09-21: `node scripts/schema-check.mjs` passed for
285
+ the existing site schema, and `node scripts/maggie-booking-schema.mjs
286
+ --dry-run` passed for all three Booking schema files without committing.
287
+ The real worker was intentionally not allowed to write and correctly failed
288
+ closed because `maggiedash_booking_allocations` is not yet present. Applying
289
+ the Booking migration remains an explicit owner-approved production action;
290
+ until then the dashboard is installed but cannot serve live Booking data.
291
+
292
+ ## 2026-09-21 — Worker scheduler artifact generation
293
+
294
+ - Added `maggie booking install --schedule systemd` and the standalone
295
+ `maggie booking worker-schedule --scheduler systemd|cron` command.
296
+ - Generated units/cron files run the installed host worker from the project
297
+ directory, preserve the single-flight lock, and load the host `.env` only on
298
+ the server. The CLI never edits crontab, enables systemd, starts a process,
299
+ or prints secrets.
300
+ - Verification: Python Booking tests (24/24), packaged CLI systemd generation,
301
+ board validation, Python/Node syntax checks, and `git diff --check` passed.
302
+ Enabling the schedule remains a host deployment/evidence gate.
303
+
304
+ ## 2026-09-21 — BK-099 cancellation-safe package credit restoration
305
+
306
+ - Added additive `status`, `reversed_at`, `reversal_reason`, and `reversed_by`
307
+ fields to `maggiedash_booking_package_redemptions`; the migration remains
308
+ idempotent and non-destructive.
309
+ - A cancelled manager booking now restores active package redemptions inside
310
+ the same transaction as the lifecycle transition. The repository locks the
311
+ ledger and balance rows, refuses inconsistent balances, restores an
312
+ exhausted entitlement when valid, and never deletes the original ledger row.
313
+ - The public customer cancellation path and deterministic reference host use
314
+ the same exactly-once semantics. No-show and completed bookings retain their
315
+ package debit by policy.
316
+ - Central `npm test`, public/manager reference-host regressions, disposable
317
+ PostgreSQL core integration (including package-credit restoration), schema
318
+ validation, ORA mirror checks, and ai-cmo board validation passed. The real
319
+ ORA database migration and staging cancellation evidence remain host gates.
320
+
321
+ ## 2026-09-21 — BK-094 tenant-scoped treatment package catalogue
322
+
323
+ - Added package catalogue tables for tenant-scoped prepaid treatment bundles:
324
+ package metadata, price/currency, optional expiry, active state, and included
325
+ service-variant quantities. Package items must reference active variants in
326
+ the same project.
327
+ - Added idempotent/audited `GET/POST /api/maggie/booking/packages.json`
328
+ manager routes, PostgreSQL repository methods, reference-host fixtures, and
329
+ the central/ORA Packages manager screen.
330
+ - Synchronized the detailed MaggieDash contract, compact ai-cmo-skills contract,
331
+ bundled npm contract, route/service/type validators, schema validator, and
332
+ installed ORA mirror. This is a catalogue foundation only; purchasing,
333
+ customer package balances, redemption at checkout, expiry enforcement, and
334
+ refund settlement remained the next package phase at that point.
335
+
336
+ ## 2026-09-21 — BK-096 customer package checkout and refund settlement
337
+
338
+ - Added a separate package-purchase aggregate and refund ledger so prepaid
339
+ treatment packages do not reuse booking-bound payment attempts.
340
+ - Added public package checkout/payment-return routes and customer UI, with
341
+ idempotent customer creation, provider action hand-off, and pending-state
342
+ recovery.
343
+ - Added Stripe metadata/webhook/reconciliation linkage that updates purchase
344
+ state and transactionally creates the customer entitlement and balances.
345
+ - Added manager package-purchase listing/refund routes and UI. Refunds are
346
+ blocked after a redeemed visit and remain provider-led until Stripe confirms
347
+ the result.
348
+ - Synced MaggieDash, ai-cmo-skills contracts/bundles, ORA host wiring, UI
349
+ validators, reference-host regression, schema, and docs.
350
+ - Local gates for this slice: central npm test, ai-cmo Python Booking tests,
351
+ ORA contract/build, and package checkout/reference-host regression. Production
352
+ DB migration, Stripe webhook evidence, and scheduled Resend evidence remain
353
+ host gates.
354
+
355
+ ## 2026-09-21 — BK-098 public customer package redemption
356
+
357
+ - Added `package_entitlement_id` to the hold projection, with a safe additive
358
+ schema migration and tenant/customer binding.
359
+ - Public customer hold and checkout now carry the entitlement from the package
360
+ payment return; the server validates active status, expiry, currency, and
361
+ remaining treatment credits without trusting the browser for customer
362
+ identity.
363
+ - Redemption locks the entitlement/items, writes the booking metadata and
364
+ redemption ledger, updates the balance/exhausted status, and completes in
365
+ the same transaction as booking conversion.
366
+ - Reference-host regression passed for a confirmed zero-price public booking,
367
+ balance decrement, ledger row, idempotent hold/checkout boundaries, and the
368
+ package-return “Book with this package” link.
369
+
370
+ ## 2026-09-21 — BK-097 package lifecycle Resend notifications
371
+
372
+ - Added `package.purchase.confirmed` and `package.purchase.refunded` to the
373
+ allowlisted email-template contract and fallback renderer.
374
+ - Package Stripe fulfillment and refund transitions now enqueue idempotent,
375
+ tenant-scoped notifications linked by `package_purchase_id`; the outbox keeps
376
+ recipient addresses out of stored notification records and exposes only a
377
+ hash.
378
+ - Updated the generic and ORA Resend workers to resolve package recipient,
379
+ package name, amount, and expiry at delivery time without booking manage
380
+ links for package messages.
381
+ - Synced the PostgreSQL schema, worker/core repositories, email contract,
382
+ validators, and installed ORA mirror. Local central tests pass; real Resend
383
+ delivery and staging webhook evidence remain host gates.
384
+ - Gap assessment: public package redemption is covered for fully covered
385
+ treatment selections. Customer balance browsing, memberships, gift cards,
386
+ recurring appointments, and automatic no-show charging remain future slices.
387
+
388
+ ## 2026-09-21 — BK-095 customer package entitlements and redemption
389
+
390
+ - Added tenant-scoped customer package entitlements, per-variant granted and
391
+ redeemed quantities, expiry/status projection, and a redemption ledger.
392
+ - Added manager `GET/POST /api/maggie/booking/customer-packages.json` routes
393
+ for balance reads and audited manual grants. A customer package grant is
394
+ idempotent and cannot cross tenant or customer scope.
395
+ - Manager-created bookings can now accept `packageEntitlementId`; the
396
+ PostgreSQL repository locks the entitlement and item rows in the booking
397
+ transaction, rejects expired/exhausted balances, zero-prices covered
398
+ segments, records redemptions, and marks fully consumed entitlements
399
+ exhausted. The reference host exercises the same flow.
400
+ - Added a Customer package balances panel to the Packages screen and synced
401
+ the central workspace, ORA mirror, detailed/compact/bundled contracts,
402
+ validators, and install docs. Stripe package checkout and package refunds
403
+ remain intentionally separate because the current payment attempt ledger is
404
+ booking-bound.
405
+
406
+ ## 2026-09-21 — buffer-aware availability and allocation enforcement
407
+
408
+ - `treatmentTiming` now separates customer-visible duration from occupied time:
409
+ the first treatment's preparation buffer, each internal cleanup plus next
410
+ preparation gap, and the last treatment's cleanup buffer are all accounted
411
+ for. Availability slots still expose the visible start/end times.
412
+ - The PostgreSQL core now writes expanded allocation ranges for manager-created
413
+ bookings, customer holds, waitlist conversion, and reschedules. Adjacent
414
+ bookings that touch a preparation/cleanup buffer are rejected transactionally.
415
+ - Central and ORA customer/reference hosts and customer UIs now expose and use
416
+ buffer fields for public availability and multi-treatment segment cursors.
417
+ - Added `schema/maggie-booking-buffer-backfill.sql`, a fail-closed one-time
418
+ migration for legacy reserved allocations. It must be reviewed and applied
419
+ separately after backup/staging verification; no live ORA database was
420
+ changed.
421
+ - Evidence passed: central and ORA runtime/reference/customer/UI validators,
422
+ syntax checks, disposable PostgreSQL core integrations, and a disposable
423
+ backfill migration test that moved `10:00–11:00` to `09:55–11:10` for a
424
+ `5/10` minute buffer.
425
+
426
+ ## 2026-09-21 — first-run bookability readiness
427
+
428
+ - PostgreSQL and reference-host Overview responses now expose the same
429
+ configuration gates: active location, active catalogue variant, bookable
430
+ staff with location/service assignments, working hours, overall `bookable`,
431
+ and payment capability.
432
+ - This makes the manager dashboard explain why a freshly installed tenant is
433
+ not yet bookable instead of showing only a generic catalogue/payment state.
434
+ - Central and ORA PostgreSQL repository validators now assert the complete
435
+ readiness payload. A fresh disposable PostgreSQL schema/core integration also
436
+ passed the real readiness query. No database or production configuration was
437
+ changed.
438
+
439
+ ## 2026-09-21 — disposable ORA host runtime verification
440
+
441
+ - Ran the ORA Astro host from an isolated copy against a disposable local
442
+ PostgreSQL database. The test applied the Booking schema only to that
443
+ temporary database and used non-production URLs/secrets.
444
+ - Verified the actual HTTP path for first-owner email/password authentication,
445
+ authenticated overview, settings, manager catalogue, staff list, and public
446
+ catalogue. The first owner registration returned HTTP 201; subsequent
447
+ login returned HTTP 200; all tested Booking reads returned HTTP 200.
448
+ - This runtime test found and fixed two host defects: the catalogue repository
449
+ ordered service variants by a column that is not in the schema
450
+ (`service_variants.created_at`), and the ORA catalogue bootstrap could
451
+ duplicate services after a partial retry. Variant ordering now uses stable
452
+ existing columns, and ORA seed-upsert logic reuses existing services and
453
+ resumes interrupted seeds safely.
454
+ - Re-ran MaggieDash `npm test`, ORA `npm run contract:check`, ORA
455
+ `npm run booking:email-templates:test`, and ORA `npm run build`; all passed.
456
+ The ORA build still reports only the two pre-existing non-Booking hints.
457
+ - This is disposable local-host evidence only. It does not close the ORA
458
+ production migration, real Stripe/Resend delivery, scheduler, or browser
459
+ evidence gates.
460
+
461
+ ## 2026-09-21 — multi-variant treatment catalogue parity
462
+
463
+ - The PostgreSQL catalogue read now returns variant metadata, stable ordering,
464
+ and buffer fields already supported by the schema/write path.
465
+ - The manager Catalogue screen now edits all treatment variants under one
466
+ service instead of silently reading and writing only the first variant. An
467
+ owner can add/remove variants, set each duration, price, currency, and active
468
+ state, then persist the complete variant set idempotently.
469
+ - The central workspace and the ORA installed workspace were updated together.
470
+ The PostgreSQL integration fixture now persists two variants and verifies
471
+ their buffer fields survive a read; the core integration passed.
472
+ - This closes the UI/data parity gap for multiple treatments. Buffer-aware
473
+ availability and allocation semantics are now enforced for new and
474
+ rescheduled allocations; legacy ORA allocation backfill remains an explicit
475
+ staging/production gate.
476
+
477
+ ## 2026-09-21 — disposable PostgreSQL evidence repair
478
+
479
+ - Fixed the core repository integration fixture to create the staff/location,
480
+ staff/service, and service/resource assignments required by the production
481
+ bookability rules.
482
+ - Updated the customer token assertion for the current payment-token plus
483
+ 30-day manage-token model (four sealed tokens across the two recovery flows).
484
+ - Re-ran the disposable PostgreSQL schema, core repository, worker repository,
485
+ and matching PostgreSQL 12 backup/restore integrations. All passed and both
486
+ temporary databases were removed afterwards. MaggieDash `npm test` also
487
+ passed. This strengthens BK-030 local evidence but does not replace the
488
+ required ORA host evidence.
489
+ - The GitHub Actions Astro-starter failure in run `35437704491`, job
490
+ `105883076605`, was caused by a missing `PUBLIC_SITE_URL` in the older
491
+ workflow revision. ai-cmo-skills commit `b19ad64` already supplies the
492
+ non-secret CI value `https://example.test`; it is unrelated to Booking.
493
+
494
+ ## 2026-09-21 — fresh Astro SSR install and build parity
495
+
496
+ - Added a portable `astro.config.mjs` to the generic Astro host scaffold. It
497
+ enables server output, the Node adapter, React integration, and Tailwind;
498
+ the installer skips it whenever the project already owns any
499
+ `astro.config.*`, so Cloudflare/Vercel/Netlify/Deno deployment choices remain
500
+ untouched.
501
+ - Added adapter-aware dependency completion. A blank Astro project receives
502
+ the Astro 5-compatible `@astrojs/node` range; an existing adapter is not
503
+ replaced. Added a generic `isResponse` auth export required by the bundled
504
+ email-template route.
505
+ - Evidence: the default public GitHub source at MaggieDash `db83854` installed
506
+ into a fresh disposable Astro project, `maggie booking inspect` passed, and
507
+ `PUBLIC_SITE_URL=https://example.test npx astro build` completed successfully.
508
+ The central host validator and full `npm test` also passed.
509
+
510
+ ## 2026-09-21 — Stripe connection verification
511
+
512
+ - Added the administrator-authenticated `POST /api/maggie/booking/payment-health.json`
513
+ route to the MaggieDash and ORA host adapters. It calls Stripe server-side,
514
+ persists only non-secret account/capability status, records an audit event,
515
+ and replays safely by idempotency key.
516
+ - Added the Overview “Verify Stripe connection” action. Deployment credentials
517
+ remain in the secret store; the optional dashboard path accepts a key pair
518
+ only for owner/manager sessions, verifies it server-side, and returns only a
519
+ redacted result.
520
+ - Updated the detailed/compact ai-cmo-skills contract, fixtures, validators,
521
+ bundled npm contract, installed ORA mirror, and current route documentation
522
+ to 40 manager routes. Also aligned the MaggieDash manifest validator with
523
+ the released package version.
524
+ - Verification passed: MaggieDash contract/reference-host validators, ai-cmo
525
+ Booking tests and contract CLI, ORA contract checks, ORA `npm run build`, and
526
+ `git diff --check`. ORA build retains only two pre-existing hints.
527
+ - Fixed the install-time schema runner so a blank Astro host does not require
528
+ `host-extensions.sql`; when a host supplies it, it now runs after the core
529
+ Booking tables exist. This was caught by the ORA dry-run against the real
530
+ configured database, which previously failed on the missing notifications
531
+ relation.
532
+
533
+ ## 2026-09-21 — BK-092 tenant-scoped email template management
534
+
535
+ - Added `booking-email-templates-v1` to MaggieDash and ai-cmo-skills. It freezes
536
+ seven Booking event keys, event-specific placeholders, owner/admin/manager
537
+ access, tenant scoping, idempotency, audit, 50,000-character HTML limits,
538
+ and server-only Resend/recipient handling.
539
+ - Added versioned PostgreSQL template storage, generic Astro and ORA
540
+ `GET/PATCH /api/maggie/booking/email-templates.json` routes, manager UI with
541
+ sandboxed preview, draft/publish/rollback history, and staff denial.
542
+ - Updated both Resend workers to resolve the latest published tenant template
543
+ by project and event, render only allowlisted escaped values, and use the
544
+ existing fallback when no override is published.
545
+ - Persisted the bounded notification variable context in `variables_json` and
546
+ loaded it through the PostgreSQL worker repository, so event-specific values
547
+ such as cancellation reasons survive the outbox/worker boundary without
548
+ storing recipient addresses or customer tokens.
549
+ - Verification passed: MaggieDash `npm test`, template/reference-host
550
+ validator, ORA `npm run contract:check`, ORA template validator, and ORA
551
+ `npm run build`. The build retains only the two pre-existing hints. Real
552
+ database migration, Resend delivery, scheduler, and authenticated host
553
+ evidence remain production gates.
554
+
555
+ ## 2026-09-21 — fresh-install contract parity
556
+
557
+ - Fixed the Booking CLI inspectors to normalize both the compact installed
558
+ contracts and MaggieDash's JSON Schema distribution contracts (`properties`
559
+ plus `x-endpoints`/`endpoints`). The email-template contract now declares the
560
+ same four read/draft/publish/rollback endpoints, auth boundary, idempotency,
561
+ and privacy policy in both forms.
562
+ - Added a regression test for both detailed contract shapes and updated the
563
+ MaggieDash email-template validator to read the normalized fields.
564
+ - Verification passed: a disposable local-source Astro install copied 139
565
+ artifacts and 23 host files, then `maggie booking inspect` returned
566
+ `passed`; packaged access/email contract checks, 25 ai-cmo Booking tests,
567
+ MaggieDash `npm test`, ORA template/contract/build checks, and `git diff
568
+ --check` also pass. The public GitHub distribution still needs the pending
569
+ MaggieDash release before default remote installs can use this host
570
+ bootstrap.
571
+
572
+ ## 2026-09-21 — BK-084 browser evidence coverage parity
573
+
574
+ - Updated the browser evidence contract, Playwright capture, validators, ORA
575
+ installed copy, and CLI release-gate route inventory from the former 11
576
+ manager screens to all 15 current screens: overview, calendar, bookings,
577
+ customers, waitlist, locations, catalogue, staff, resources, schedule,
578
+ payments, notifications, reports, settings, and audit.
579
+ - The contract now requires 45 route/viewport records across mobile, tablet,
580
+ and desktop. UI regression markers also require the waitlist, notification,
581
+ and reporting screens to remain present in the installed workspace.
582
+ - Verification passed: MaggieDash `npm test`, ORA `npm run contract:check`,
583
+ ORA `npm run build`, ai-cmo-skills Booking Python tests, packaged task-board
584
+ validation, and `git diff --check`. A real authenticated host capture is
585
+ still required before BK-031/BK-032 can close.
586
+
587
+ ## 2026-09-21 — first-owner registration hardening
588
+
589
+ - Hardened the generic Astro host and ORA installation copy so first-owner
590
+ registration runs in one PostgreSQL transaction protected by a
591
+ project-scoped `pg_advisory_xact_lock`. The owner check, project bootstrap,
592
+ user/membership writes, and audit event now commit or roll back together.
593
+ - An existing email account can become the first owner only after proving its
594
+ current password. Registration never overwrites an existing password or
595
+ re-enables a disabled account; a new account is the only path that hashes a
596
+ supplied password. This closes the concurrent-registration and account
597
+ takeover risks in the previous route.
598
+ - Verification passed: MaggieDash Astro host bootstrap validator, full
599
+ `npm test`, ORA `npm run contract:check`, ORA `npm run build`, and
600
+ `git diff --check`. The build still reports only the two pre-existing hints.
601
+ - This is local code hardening, not production activation. The ORA Booking
602
+ migration, real Stripe/Resend delivery, worker scheduling, and authenticated
603
+ browser evidence remain the BK-030/BK-031/BK-032 release gates.
604
+
605
+ ## 2026-09-21 — BK-082 Booking access defaults and disabled-account guard
606
+
607
+ - Fixed the generic Astro host and ORA access endpoints so a newly invited
608
+ `staff` account receives the safe default capabilities for calendar and
609
+ booking lifecycle work, while `finance` receives payment/refund defaults.
610
+ Administrators can still replace those defaults with the explicit granular
611
+ permission set from the Team access panel.
612
+ - Booking access creation now rejects an existing disabled email account and
613
+ no longer clears `disabled_at` as a side effect of granting access. This
614
+ prevents an invitation or staff-role assignment from reactivating a host
615
+ account outside the intended recovery flow.
616
+ - Verification passed: MaggieDash host bootstrap validator and full
617
+ `npm test`, ORA `npm run contract:check`, ORA `npm run build`, and
618
+ `git diff --check`. The build still reports only the two pre-existing hints.
619
+ - This closes the local staff-login/permission default gap; real database
620
+ migration, Resend delivery, worker scheduling, and authenticated host
621
+ evidence remain release gates.
622
+
623
+ ## 2026-09-21 — BK-083 worker migration preflight
624
+
625
+ - Hardened both the generic Astro worker and the ORA worker entrypoint with a
626
+ read-only PostgreSQL table preflight before lock acquisition or repository
627
+ reads. Missing core, Booking, or access tables now produce a bounded JSON
628
+ `needs-migration` report with exit code 1 instead of a raw missing-relation
629
+ stack trace.
630
+ - The preflight does not apply migrations or write business state. It points
631
+ operators to the existing dry-run/apply commands and keeps database/provider
632
+ secrets out of the report, so systemd/cron can alert on a clear reason.
633
+ - Verification passed: `node --check` for both worker entrypoints, the Astro
634
+ bootstrap validator, ORA worker run against its current unmigrated database,
635
+ and `git diff --check`. The ORA worker now reports core=true, booking=false,
636
+ access=false and exits 1 as designed.
637
+
638
+ ## 2026-09-21 — BK-080 notification delivery management
639
+
640
+ - Added a tenant-scoped manager Notifications screen that lists redacted
641
+ delivery state, including template, channel, status, attempts, timestamps,
642
+ provider reference, and sanitized last-error text without exposing recipient
643
+ email addresses or provider payloads.
644
+ - Owner/manager sessions can replay only `dead_letter` notifications. Replay
645
+ requires a human reason and idempotency key, resets the delivery lease/error
646
+ state, and records both `notification.replayed` and `notification.replay`
647
+ event/audit evidence. Staff and finance sessions cannot access the surface.
648
+ - Added `booking.notifications.read` and `booking.notification.replay` to the
649
+ central/ORA host contracts, reference host, PostgreSQL repository, service,
650
+ route handler, type contract, install docs, and package contract checks.
651
+ - Central MaggieDash `npm test`, packaged CLI contract/task/Stripe/setup checks,
652
+ ai-cmo Python tests, all relevant ORA Booking validators, ORA host-contract
653
+ fixture parity, ORA `npm run build`, and `git diff --check` passed.
654
+ BK-080 is now passed. Real Resend delivery, schema, owner, scheduler, and
655
+ production browser/runtime evidence remain host release gates.
656
+
657
+ ## 2026-09-21 — BK-069 bootstrap secret provisioning
658
+
659
+ - Updated the explicit `maggie booking install --confirm --bootstrap` path to
660
+ generate a cryptographically random `BOOKING_TOKEN_SECRET` in the host's
661
+ local `.env` when the implementation-only secret is absent. The value is
662
+ intentionally never printed or serialized into setup output.
663
+ - Existing valid secrets are preserved byte-for-byte; a configured value under
664
+ 32 characters fails closed rather than being silently replaced. Hosts using
665
+ an external secret manager remain responsible for provisioning the same key.
666
+ - Verification: the Booking CLI suite passed 13 tests, including generation,
667
+ idempotent replay, short-secret rejection, and existing secret redaction;
668
+ `git diff --check` passed.
669
+
670
+ ## 2026-09-21 — BK-070 transactional schema dry-run
671
+
672
+ - Added `--dry-run` to the installed Booking schema command. It executes the
673
+ core, host-extension, and Booking migrations inside one PostgreSQL
674
+ transaction, then rolls the transaction back; errors also rollback before
675
+ returning a bounded failure.
676
+ - The ORA database preflight passed against PostgreSQL 18.6 and rolled back
677
+ cleanly. The live schema remains unchanged (`booking` and `access` tables are
678
+ still absent); `--apply --confirm` remains an explicit deployment action.
679
+ - Verification: central and ORA Node syntax checks, live ORA dry-run, and
680
+ `git diff --check` passed. The installed worker still correctly fails until
681
+ the migration is approved and applied.
682
+
683
+ ## 2026-09-21 — BK-071 Resend sender-key compatibility
684
+
685
+ - The generic Astro Booking host now resolves the sender as
686
+ `EMAIL_FROM || RESEND_FROM_EMAIL` for both account invitation/reset emails
687
+ and the Resend worker. This matches the existing ORA convention without
688
+ changing the generic host's secret ownership boundary.
689
+ - ORA's Booking readiness summary now reports Resend as configured when the
690
+ existing `RESEND_FROM_EMAIL` key is used. No sender or API key is exposed in
691
+ a response.
692
+ - Verification: Astro host bootstrap validator, ORA build, worker syntax, and
693
+ `git diff --check` passed.
694
+
695
+ ## 2026-09-21 — BK-072 Multi-treatment manager appointments
696
+
697
+ - Manager booking creation now accepts up to 12 `segments`, each with its own
698
+ service variant, time range, price/currency, and staff/resource allocation.
699
+ The server enforces one location and currency, exact variant duration,
700
+ per-segment availability, same-resource/staff overlap rejection, and writes
701
+ the booking, segment rows, allocations, event, and audit record through the
702
+ existing idempotent transaction boundary.
703
+ - The reference host and ORA mirror now exercise a two-treatment appointment;
704
+ the manager form exposes `Add treatment`/`Remove treatment` and submits the
705
+ segment array while preserving the single-treatment path.
706
+ - Verification: central `npm test`, central and ORA reference-host validators,
707
+ ORA `npm run build`, and the UI source gate passed. Migration remains
708
+ unapplied on ORA pending an approved matching-version backup and explicit
709
+ deployment confirmation.
710
+
711
+ ## 2026-09-21 — BK-073 Public multi-treatment booking
712
+
713
+ - The public customer flow now accepts up to 12 ordered treatment segments while
714
+ keeping the existing single-treatment request shape compatible. Public DTOs
715
+ expose only safe segment fields; customer identity, token, payment-provider,
716
+ and tenant-private fields remain redacted.
717
+ - Public availability accepts `serviceVariantIds` and returns slots for the
718
+ combined duration. The customer page now supports adding/removing treatments,
719
+ shows the estimated total, and constructs contiguous segment intervals from
720
+ the selected start time.
721
+ - PostgreSQL holds now persist `segments_json`, reserve one allocation per
722
+ segment, and convert into one booking with segment rows, summed price, and
723
+ token-bound checkout/manage controls. The reference host covers multi-segment
724
+ availability, hold, and checkout replay.
725
+ - Verification: central `npm test`, central and ORA customer-flow/reference-host/
726
+ UI validators, ORA `npm run build`, schema static gate, and `git diff --check`
727
+ passed. The live ORA migration remains unapplied pending backup and explicit
728
+ deployment confirmation.
729
+
730
+ ## 2026-09-21 — BK-074 Multi-treatment rescheduling
731
+
732
+ - Manager-created and customer-converted bookings now keep a stable
733
+ segment-to-allocation link. Legacy single-treatment rows remain supported.
734
+ - Rescheduling now shifts each treatment segment and its matching staff/resource
735
+ allocation by the same delta, checks conflicts per target segment, preserves
736
+ the original total duration for multi-treatment bookings, and returns the
737
+ updated segment list.
738
+ - The reference customer host applies the same segment-aware behavior to its
739
+ public token-bound reschedule path, including per-segment availability checks.
740
+ - Verification: central PostgreSQL-core and customer-reference validators,
741
+ ORA validator mirrors, Node syntax checks, and `git diff --check` passed.
742
+ ORA build and the live database migration remain release gates.
743
+
744
+ ## 2026-09-21 — BK-075 Install-time live configuration IDs
745
+
746
+ - Booking catalogue responses now include tenant-scoped locations, and schedule
747
+ responses include the locations visible to the current staff scope.
748
+ - New manager booking, staff, resource, and schedule forms now derive defaults
749
+ from bootstrap data instead of posting `location-1` or `service-1`. Resource
750
+ writes now persist their service assignments, so a newly configured room or
751
+ device can actually participate in treatment availability.
752
+ - Synced the validated central Booking UI, repository, reference host, and UI
753
+ regression validator into ORA's installed `_maggie/booking` workspace.
754
+ - Verification: central UI, reference-host, PostgreSQL-core, and configuration
755
+ validators passed; central and ORA syntax checks passed; ORA `npm run build`
756
+ passed with zero errors and zero warnings (two pre-existing hints); and
757
+ `git diff --check` passed. Live Booking schema migration remains pending.
758
+
759
+ ## 2026-09-21 — BK-076 Install-time location management
760
+
761
+ - Added a tenant-scoped Locations screen and `GET/POST /locations.json` manager
762
+ boundary. Owners/managers can create or edit the first venue with name,
763
+ slug, IANA timezone, locale, address, active state, and online-booking state.
764
+ - Mirrored the configuration validator, service/repository method, route
765
+ permission, reference host, contract, and UI in ORA. This closes the blank
766
+ project setup gap: a host no longer needs a pre-seeded `location-1` before
767
+ services, staff, resources, or schedules can be configured.
768
+ - Verification: central and ORA service-contract, route-handler,
769
+ configuration, reference-host, and UI validators passed; the central full
770
+ suite is being rerun after synchronizing the independent 39-route fixture;
771
+ ORA build and live migration remain host release gates.
772
+
773
+ ## 2026-09-21 — BK-077 Synchronize the install-time Booking contract
774
+
775
+ - Updated ai-cmo-skills' public `contracts/maggiedash/booking-host-adapter-v1.json`
776
+ with the two location endpoints and `locationSetup` capability. The CLI's
777
+ detailed-contract gate now expects the same 39 manager routes as MaggieDash,
778
+ so a package-installed project cannot pass a stale 35-route contract.
779
+ - Updated the Python regression expectation and made the detailed-contract
780
+ validator compare its endpoint inventory instead of relying only on a future
781
+ hardcoded route count. The source/runtime contract remains separate from
782
+ provider secrets and host database state.
783
+ - Verification: `maggie booking contract`, Python Booking tests, MaggieDash
784
+ `booking:contract:validate`, task-board validation, and `git diff --check`
785
+ passed.
786
+
787
+ ## 2026-09-21 — BK-078 Verify the public MaggieDash install source
788
+
789
+ - Pushed MaggieDash `0.2.7` commit `50f0c16`, including the Astro
790
+ `hostBootstrap`, 40-route Booking source, worker/schema artifacts, and the
791
+ blank-host-safe schema runner. The follow-up `0.2.8` release supersedes this
792
+ source for fresh installs.
793
+ - Ran the default installer against a fresh disposable Astro project without
794
+ `--source`; it copied 139 source artifacts and 22 Astro host files from
795
+ `https://github.com/TOPY-AI-LTD/MaggieDash.git` before the subsequent SSR
796
+ adapter/config addition.
797
+ - The installed host validator and `maggie booking inspect` both passed. This
798
+ closes BK-078; real database, scheduler, authenticated browser, and ops
799
+ evidence remain the separate BK-030/BK-031/BK-032 gates.
800
+
801
+ ## 2026-09-21 — BK-079 Fix npm CLI Booking contract paths
802
+
803
+ - Rebuilt `packages/maggie-cli/bundled-contracts/maggiedash` from the current
804
+ source contract and added the execution board to the packaged contract set.
805
+ - Updated the Booking CLI to resolve contracts and the board from either the
806
+ source checkout (`contracts/`, `docs/`) or the npm layout
807
+ (`bundled-contracts/`). The published CLI no longer looks for a nonexistent
808
+ `packages/maggie-cli/contracts` directory.
809
+ - Verification: packaged `maggie booking contract`, `stripe-audit`,
810
+ `tasks validate`, and `setup` passed; package Node/Python syntax checks and
811
+ `git diff --check` passed.
812
+
813
+ ## 2026-09-21 — BK-067 automatic waitlist slot matching
814
+
815
+ - Added `backend/booking/waitlist.mjs` with deterministic service, location,
816
+ staff, preferred-date/time, priority, and FIFO matching rules.
817
+ - Added the `match-waitlist` worker job between availability refresh and
818
+ reminders. It queues one idempotent `booking.waitlist.available` notification
819
+ through the existing Resend outbox, persists `notified_at` plus the offered
820
+ interval, and deliberately does not auto-create or reserve a booking.
821
+ - Extended the PostgreSQL worker repository and additive schema with
822
+ `offered_start_at` and `offered_end_at`. Astro workers accept explicit
823
+ `BOOKING_WAITLIST_*` scope values so ambiguous multi-service availability
824
+ cannot send an incorrect offer.
825
+ - Verification: MaggieDash `npm test`, waitlist priority/FIFO/replay
826
+ regression, ORA worker/runtime/UI validators, and `git diff --check` passed.
827
+
828
+ ## 2026-09-20 — Detailed execution board
829
+
830
+ - Added `EXECUTION-BOARD.json` with leaf tasks BK-017–BK-038. Each task now
831
+ declares dependencies, plan, implementation files, tests, documentation
832
+ updates, and acceptance evidence.
833
+ - Added `TASK-RUNBOOK.md` to make the required task → plan → implement → test →
834
+ docs → progress loop explicit.
835
+ - Added `maggie booking tasks validate|list|show` as a read-only task board
836
+ inspection surface. BK-017 passed after JSON, CLI, Python syntax, skill
837
+ links, and whitespace gates.
838
+
839
+ ## 2026-09-20 — BK-018 host contract reconciliation
840
+
841
+ - Reconciled the host contract from 26 to 32 canonical endpoints, including
842
+ customer detail, configuration writes, payment health, and the documented
843
+ refund/payment-start routes.
844
+ - Added an independent contract fixture, an installed route projection, and
845
+ `npm run booking:contract:validate` so contract IDs/routes cannot silently
846
+ drift from the host documentation.
847
+ - Validation: `npm test` passed, including manifest, Booking, 32-endpoint
848
+ contract, Stripe, runtime, syntax, and whitespace gates.
849
+
850
+ ## 2026-09-20 — BK-019 deterministic reference host
851
+
852
+ - Added the secret-free fixture state and in-memory host implementation at
853
+ `fixtures/booking-host-state.v1.json` and
854
+ `backend/booking/reference-host.mjs`.
855
+ - Added `booking:reference-host:test`, `booking:reference-host`, and the
856
+ installed `run-booking-reference-host.mjs` server. The local server is
857
+ explicitly fixture-only; it is not a production database or payment adapter.
858
+ - The validator exercises all 32 canonical endpoint IDs and required response
859
+ fields, plus missing-session rejection, project scope, owner/manager/staff/
860
+ finance role boundary, mutation idempotency, webhook authentication, and a
861
+ fixture secret/raw-payload scan.
862
+ - Evidence: `npm test`; `npm run booking:reference-host -- --self-test`; local
863
+ HTTP GET to `/api/maggie/booking/overview.json` with the fixture session.
864
+ - Result: BK-019 passed. The next executable task is BK-020, PostgreSQL
865
+ migration hardening and repeatable migration evidence.
866
+
867
+ ## 2026-09-20 — BK-020 PostgreSQL migration hardening
868
+
869
+ - Expanded the additive migration with booking segments, payment transactions,
870
+ notification records, location/catalog/staff policy fields, hold ownership,
871
+ booking payment/source fields, allocation ownership, compatibility backfill,
872
+ and query indexes. `project_id` remains the physical tenant key mapped to
873
+ the existing MaggieDash project/session boundary.
874
+ - Added `scripts/validate-booking-schema.mjs` and the stable
875
+ `npm run booking:schema:validate` command. It rejects destructive SQL and
876
+ checks the full table/constraint/index inventory.
877
+ - Evidence command: `node scripts/validate-booking-schema.mjs
878
+ --database-url maggie_booking_validation_20260920_1 --confirm` against a
879
+ disposable PostgreSQL 14 database. The base schema was applied once, the
880
+ Booking migration twice, and the database check reported 26 tables, 3
881
+ required constraints, 3 required indexes, and `overlapCheck: passed`.
882
+ - The overlap test ran inside a rolled-back transaction; the disposable
883
+ database was removed after verification. `npm test` and `git diff --check`
884
+ also pass.
885
+ - Result: BK-020 passed. The next executable task is BK-021, timezone-aware
886
+ availability, holds, lifecycle commands, and transaction-safe domain rules.
887
+
888
+ ## 2026-09-20 — BK-021 timezone and booking domain commands
889
+
890
+ - Added `backend/booking/time.mjs` for IANA timezone validation, local-to-UTC
891
+ conversion, explicit DST gap rejection, ambiguous fold selection, UTC/local
892
+ round-tripping, and interval normalization.
893
+ - Added `backend/booking/commands.mjs` for idempotent hold creation/release/
894
+ conversion, lifecycle transitions, rescheduling, multi-segment allocation
895
+ conflict checks, project scope, and event/audit intent. The layer is pure
896
+ provider-neutral code and does not open a database or receive credentials.
897
+ - Added `scripts/validate-booking-domain.mjs` and `npm run booking:domain:test`.
898
+ Fixtures cover Europe/London DST gap/fold, two-segment holds, overlap
899
+ rejection, idempotent replay, hold conversion, transition, and reschedule.
900
+ - `npm test`, `npm run booking:domain:test`, and `git diff --check` pass.
901
+ - Result: BK-021 passed. The next executable task is BK-022, safe host DTOs,
902
+ request validation, and transaction-aware service boundaries.
903
+
904
+ ## 2026-09-20 — BK-022 host service boundary and safe DTOs
905
+
906
+ - Added `backend/booking/request.mjs` for JSON/content-type validation,
907
+ idempotency context, project scope, request IDs, and safe error mapping.
908
+ - Added `backend/booking/dto.mjs` for canonical booking/customer/payment/list/
909
+ overview/settings DTOs with recursive secret, token, raw-payload, and card
910
+ field redaction.
911
+ - Added `backend/booking/service.mjs` with repository and transaction injection;
912
+ it keeps SQL/provider SDKs outside the dashboard and returns canonical
913
+ response shapes.
914
+ - Added `scripts/validate-booking-service.mjs` and
915
+ `npm run booking:service:test`. It verifies content type/idempotency failure,
916
+ safe errors, redaction, transaction invocation, and canonical responses.
917
+ - `npm test`, `npm run booking:service:test`, and `git diff --check` pass.
918
+ - Result: BK-022 passed. The next executable task is BK-023, validated
919
+ catalog/staff/resource/schedule/policy configuration CRUD.
920
+
921
+ ## 2026-09-20 — BK-023 configuration validation and CRUD intent
922
+
923
+ - Added `backend/booking/configuration.mjs` and
924
+ `contracts/booking-configuration-v1.json`. The layer validates active
925
+ services/variants, integer minor-unit prices and ISO currencies, staff
926
+ location/service eligibility, resource capacity, schedule intervals and
927
+ working-hour times, then returns readiness and audit intent.
928
+ - Integrated the normalized configuration validators into the reference host's
929
+ catalog/staff/resource/schedule mutation routes so they no longer echo
930
+ arbitrary UI input.
931
+ - Added `scripts/validate-booking-configuration.mjs` and
932
+ `npm run booking:configuration:test`. Evidence covers invalid duration,
933
+ staff/resource scope, capacity, schedule ordering, idempotent draft updates,
934
+ audit events, and readiness.
935
+ - `npm test`, `npm run booking:configuration:test`, and `git diff --check`
936
+ pass.
937
+ - Result: BK-023 passed. The next executable task is BK-024, provider-neutral
938
+ payment orchestration and a fake gateway.
939
+
940
+ ## 2026-09-20 — BK-024 payment gateway and fake provider
941
+
942
+ - Added `backend/booking/payment-gateway.mjs` with idempotent payment start,
943
+ provider reconciliation, refund upper-bound checks, currency/amount
944
+ validation, capability gating, and strict separation between payment and
945
+ booking state.
946
+ - Added `backend/booking/fake-payment-gateway.mjs` and
947
+ `fixtures/payment-gateway.v1.json` for success, action-required, delayed,
948
+ failure, reconciliation, and refund scenarios. The fake provider exposes no
949
+ secret, card data, or raw payload.
950
+ - Added `contracts/booking-payment-gateway-v1.json`,
951
+ `scripts/validate-booking-payment-gateway.mjs`, and
952
+ `npm run booking:payment:test`.
953
+ - Evidence: fake modes all pass; payment redirect/action-required does not
954
+ change booking `paymentStatus`; duplicate starts replay; reconciliation is
955
+ queued; refund over captured amount and disabled capabilities fail safely.
956
+ `npm test` and `git diff --check` pass.
957
+ - Result: BK-024 passed. The next executable task is BK-025, a host-owned
958
+ official Stripe adapter and sandbox conformance boundary.
959
+
960
+ ## 2026-09-20 — BK-025 injected Stripe adapter boundary
961
+
962
+ - Added `backend/booking/stripe-adapter.mjs`. It uses an injected official SDK
963
+ factory, server-side secret provider, pinned API version, optional connected
964
+ account, and raw-body webhook secret. It covers PaymentIntents, Checkout
965
+ Sessions, SetupIntents, provider reads, Refunds, and normalized webhook
966
+ events without importing Stripe or reading environment variables.
967
+ - Added `scripts/validate-stripe-adapter.mjs` and
968
+ `npm run booking:stripe-adapter:test` using an official-SDK-shaped test
969
+ double. Evidence confirms secret injection, action-required/client-safe
970
+ actions, account/API version options, webhook raw-body verification, refund
971
+ mapping, and safe missing-secret errors.
972
+ - Updated the Stripe integration/payment gateway docs to distinguish the
973
+ implemented host seam from the still-required host sandbox/live conformance.
974
+ `npm test` and `git diff --check` pass.
975
+ - Result: BK-025 passed. The next executable task is BK-026, transactional
976
+ notification/outbox delivery and recovery.
977
+
978
+ ## 2026-09-20 — BK-026 notification outbox and recovery
979
+
980
+ - Added `backend/booking/notifications.mjs` and the type-only
981
+ `notification-adapter.d.ts`. Templates/channels are allowlisted, recipients
982
+ are stored as hashes, variables are bounded, and queueing creates a safe
983
+ outbox record.
984
+ - Implemented lease/claim, adapter-injected delivery, exponential retry,
985
+ dead-letter after max attempts, and reasoned operator replay. Delivery
986
+ failure is post-commit and cannot roll back booking/payment truth.
987
+ - Added `scripts/validate-booking-notifications.mjs` and
988
+ `npm run booking:notifications:test`. Evidence covers template rejection,
989
+ recipient redaction, outbox enqueue, idempotency, send, backoff, dead-letter,
990
+ and replay recovery.
991
+ - Updated runtime operations and Astro host docs. `npm test` and
992
+ `git diff --check` pass.
993
+ - Result: BK-026 passed. The next executable task is BK-027, completing the
994
+ Booking UI data loading, navigation, forms, and action feedback.
995
+
996
+ ## 2026-09-20 — Stripe integration audit
997
+
998
+ - Audited the official Stripe API reference and event types for the Booking
999
+ scope: Customers, Checkout Sessions, PaymentIntents, SetupIntents, Refunds,
1000
+ Events, discounts, Billing, Tax, Terminal, and Connect.
1001
+ - Added the installable `maggiedash-stripe-booking-capabilities.v1` contract,
1002
+ a stale-audit CLI gate, and a provider-specific normalizer that does not
1003
+ import the Stripe SDK or handle credentials.
1004
+ - Recorded that gift cards and referrals are not native Stripe API resources in
1005
+ this scope. Gift Up and PartnerStack are candidate Stripe Apps; MaggieDash
1006
+ still owns local attribution, redemption/reconciliation policy, and safety
1007
+ decisions.
1008
+ - Validation: `npm test`, `npm run booking:stripe:validate`, and
1009
+ `maggie booking stripe-audit --contract ...` must pass. A real host adapter,
1010
+ sandbox upgrade, and production runtime evidence remain pending.
1011
+
1012
+ ## Baseline — 2026-09-20
1013
+
1014
+ - Confirmed MaggieDash is clean at `8d6c158` and currently distributes only
1015
+ `./_maggie/admin`.
1016
+ - Confirmed the existing dashboard uses the host's email/password session and
1017
+ `/api/maggie/*` boundary; passkeys are not part of the contract.
1018
+ - Confirmed `maggie-service-booking` is a provider-backed catalogue/booking-link
1019
+ skill, not a transactional Booking workspace.
1020
+ - Confirmed the Booking product documents define a provider-neutral domain,
1021
+ PostgreSQL source of truth, idempotent commands, audit/outbox records and a
1022
+ replaceable payment gateway.
1023
+ - Created the executable board in [`TASKS.md`](./TASKS.md).
1024
+ - User requested the remaining host-owned runtime to be made concrete, so BK-011
1025
+ through BK-015 were added for domain services, workers, schedules, browser
1026
+ evidence, and host operations.
1027
+
1028
+ ## Working loop
1029
+
1030
+ 1. Read the task's contract and acceptance gate.
1031
+ 2. Implement in the owning repository.
1032
+ 3. Run the smallest relevant validator immediately.
1033
+ 4. Fix failures before moving to the next task.
1034
+ 5. Update README/contracts/plan references and append the command/evidence
1035
+ here.
1036
+
1037
+ ## Evidence log
1038
+
1039
+ | Date | Tasks | Commands/evidence | Result |
1040
+ |---|---|---|---|
1041
+ | 2026-09-20 | BK-001 | Existing docs, MaggieDash manifest, adapter v2, package and dashboard source inspection | Contract baseline confirmed; docs task marked done |
1042
+ | 2026-09-20 | BK-002–BK-008 | `cd /home/balalior/Dev/MaggieDash && npm test` | Manifest, Booking workspace, endpoint contract, auth boundary, schema markers, and install mappings passed |
1043
+ | 2026-09-20 | BK-002, BK-006 | `python3 tools/clis/maggie_dash.py install --project <tmp> --source /home/balalior/Dev/MaggieDash --confirm` followed by `python3 tools/clis/maggie_booking.py inspect --project <tmp>` | Real local install copied admin and `_maggie/booking`; inspect passed with root contract/schema |
1044
+ | 2026-09-20 | BK-006 | `python3 tools/clis/maggie_booking.py contract`; `python3 tools/clis/maggie.py booking contract`; `python3 -m py_compile tools/clis/maggie.py tools/clis/maggie_booking.py` | Contract and top-level dispatch passed; invalid JSON evidence was rejected |
1045
+ | 2026-09-20 | BK-003, BK-009 | Temporary PostgreSQL database: apply `schema/maggiedash-install.sql`, apply `schema/maggie-booking-install.sql` twice, assert both exclusion constraints | Migration passed twice; `btree_gist` and 2 overlap constraints verified; temporary database removed |
1046
+
1047
+ ## 2026-09-20 — BK-027 Booking UI completion
1048
+
1049
+ - Added URL-backed booking query/page state, keyboard-selectable rows, typed
1050
+ booking records, idempotent mutation headers, pending/success/failure
1051
+ feedback, accessible confirmation dialogs, and validated configuration forms.
1052
+ - Added `scripts/validate-booking-ui.mjs` and the stable
1053
+ `npm run booking:ui:test` gate. esbuild compilation passed.
1054
+ - Ran the compiled React workspace in Chrome against the secret-free reference
1055
+ host at 390x844, 768x1024, and 1440x1000. The initial smoke found an invalid
1056
+ `/bookings/none.json` request and two mobile overflow defects; both were
1057
+ fixed. The corrected smoke covered all 11 routes with no failed requests or
1058
+ console errors. Tailwind CDN warnings came only from the temporary harness.
1059
+ - Result: BK-027 passed. Real authenticated host evidence remains a BK-031
1060
+ requirement.
1061
+
1062
+ ## 2026-09-20 — BK-028 manager operations
1063
+
1064
+ - Added calendar day/week modes and status filtering, the complete manager
1065
+ lifecycle action map, rescheduling, payment start/reconcile/refund controls,
1066
+ and explicit audit/payment status views.
1067
+ - Reference-host Chrome smoke confirmed the booking list, keyboard row
1068
+ selection, confirmation dialog, Check in mutation, and Action saved state.
1069
+ - Result: BK-028 passed.
1070
+
1071
+ ## 2026-09-20 — BK-029 security and access boundaries
1072
+
1073
+ - Added `scripts/validate-booking-security.mjs` and
1074
+ `npm run booking:security:test`. It covers missing session, cross-project
1075
+ scope, staff/finance role restrictions, unsigned webhooks, safe invalid JSON,
1076
+ fixture secret redaction, and email/password-only auth.
1077
+ - Result: BK-029 passed. Production host session and location-membership
1078
+ evidence remain part of BK-031.
1079
+
1080
+ ## 2026-09-20 — BK-030 worker adapter seam
1081
+
1082
+ - Added `backend/booking/postgres-worker-adapter.mjs`, injected repository and
1083
+ notification interfaces, tenant lock acquire/release, and the production
1084
+ guard that rejects the JSON fixture store when `NODE_ENV=production`.
1085
+ - Added `scripts/validate-booking-worker-adapter.mjs` and
1086
+ `npm run booking:worker-adapter:test`. The full `npm test` suite passed and
1087
+ the production guard failed safely without `--adapter` as intended.
1088
+ - Result: BK-030 is `needs-evidence`: the host still must connect the seam to
1089
+ PostgreSQL advisory/distributed locking, real transactions, and recovery
1090
+ alerts.
1091
+
1092
+ ## 2026-09-20 — release gate and evidence boundary
1093
+
1094
+ - Extended `maggie booking release-gate` with `--browser-evidence` and
1095
+ `--require-browser`; it validates all 11 routes at 3 viewports, screenshot
1096
+ path safety, ready state, empty console errors, and empty failed requests.
1097
+ - The supplied GitHub Actions run `35437704491` used pre-fix commit `bf3a54d`.
1098
+ Its Astro build failed because `PUBLIC_SITE_URL` was absent. Main already
1099
+ contains `b19ad64`, which sets `PUBLIC_SITE_URL=https://example.test` in the
1100
+ workflow.
1101
+ - BK-031 remains `needs-evidence` until a real HTTPS host supplies the scoped
1102
+ session state and sanitized browser/runtime artifacts. BK-032 remains
1103
+ planned until BK-030/BK-031 are complete.
1104
+ | 2026-09-20 | BK-005, BK-009 | `npx --yes esbuild@0.25.0 booking/src/booking.tsx --bundle --external:react --external:@phosphor-icons/react`; `npm test`; `python3 scripts/validate_skills.py`; `git diff --check` | Booking TSX parsed; MaggieDash manifest/Booking gates, 20 skill/link checks, Python syntax, and whitespace checks passed. Schedule screen and contract-backed create form were added after review. |
1105
+ | 2026-09-20 | BK-011–BK-015 | `npm test`; `npm run booking:worker -- --job all`; `node backend/booking/run-booking-jobs.mjs --job all --write --write-fixture --confirm` on a temporary fixture; `node --check` for browser capture/validator; review of systemd/cron/GitHub workflows | Availability, hold expiry, payment webhook boundary/reconciliation, notification lease/retry, adapter runner, schedules, and browser evidence workflow are implemented. Production host wiring/evidence remains explicitly gated. |
1106
+ | 2026-09-20 | BK-012–BK-015 | Temporary install: `maggie dash install --source /home/balalior/Dev/MaggieDash --confirm`; `maggie booking inspect`; installed `validate-booking-runtime.mjs` and worker dry-run | Installed project contains `_maggie/booking`, runtime/browser contracts, worker, ops templates, and both workflows; inspect and installed runtime checks passed. |
1107
+ | 2026-09-20 | BK-017 | `python3 tools/clis/maggie_booking.py tasks validate`; `... tasks list`; `... tasks show BK-019`; `python3 scripts/validate_skills.py`; `git diff --check` | Execution board contains 16 dependency-linked leaf tasks with plan/implementation/test/docs/acceptance fields; task CLI and documentation gates passed. |
1108
+
1109
+ ## 2026-09-20 — BK-030 PostgreSQL repository and board gate
1110
+
1111
+ - Added `backend/booking/postgres-worker-repository.mjs` in MaggieDash. It is a
1112
+ host-injected, parameterized, tenant-scoped repository for worker state,
1113
+ notifications, normalized payment-event acknowledgement, availability
1114
+ snapshots, and session-bound PostgreSQL advisory locks. It intentionally has
1115
+ no `pg` import, environment-variable reads, or provider credentials.
1116
+ - Added `scripts/validate-booking-postgres-worker-repository.mjs` and the stable
1117
+ `npm run booking:postgres-repository:test` gate. The fake executor verifies
1118
+ parameterized SQL, transaction writes, tenant scope, lock calls, event
1119
+ acknowledgement, and snapshot persistence.
1120
+ - Extended the disposable schema gate. A fresh PostgreSQL database applied the
1121
+ base and Booking migrations twice, confirmed 27 Booking tables, three
1122
+ constraints, three indexes, four normalized payment-event columns, the
1123
+ availability snapshot table, and an advisory-lock round trip; the database
1124
+ was dropped after the test.
1125
+ - Added `--require-board`/`--board` to `maggie booking release-gate`. A final
1126
+ release now fails closed while any execution-board task is not `passed`.
1127
+ - Result: BK-030 remains `needs-evidence`: repository and disposable database
1128
+ checks pass, but the production host still must provide a session-bound
1129
+ connection, real notification/alert wiring, backup/restore evidence, and
1130
+ operational recovery evidence. BK-031 and BK-032 remain open.
1131
+
1132
+ ## 2026-09-20 — BK-030 operational health controls
1133
+
1134
+ - Added a correlation ID to every worker report and propagated it to expired
1135
+ hold events and the CLI `--correlation-id` option.
1136
+ - Added notification dead-letter handling after the configured retry limit;
1137
+ dead-letter rows are no longer claimed again automatically.
1138
+ - Added `backend/booking/health.mjs` and
1139
+ `npm run booking:health:test`. It emits the versioned sanitized health report
1140
+ with stable alert codes for lock contention, failed/stale workers, stale
1141
+ availability, payment reconciliation lag, notification retries, and dead
1142
+ letters.
1143
+ - Added the health/repository gates to the MaggieDash package test and Booking
1144
+ runtime CI, and updated the runtime contract, README, ops runbook, task board,
1145
+ and QA guidance.
1146
+ - Result: BK-030 remains `needs-evidence`: the operational code and local gates
1147
+ pass, while the host still must connect the report to real alert routing and
1148
+ prove backup/restore and recovery behavior.
1149
+
1150
+ ## 2026-09-20 — BK-030 real PostgreSQL repository cycle
1151
+
1152
+ - Added the optional stable command
1153
+ `booking:postgres-repository:integration`. It requires an explicit
1154
+ `--confirm`, creates one uniquely-prefixed test tenant, runs the actual
1155
+ injected `pg` client through repository read/write/transaction/advisory-lock
1156
+ paths, verifies payment acknowledgement plus notification/event/availability
1157
+ persistence, and removes only that test tenant.
1158
+ - Ran it against a fresh local PostgreSQL database using `pg@8.16.3`; the
1159
+ cycle passed and the database was removed after the run.
1160
+ - Result: BK-030 now has real local PostgreSQL evidence, but remains
1161
+ `needs-evidence` for host-owned alert routing, backup/restore, and recovery
1162
+ rehearsal. BK-031 still requires a real authenticated HTTPS host.
1163
+
1164
+ ## 2026-09-20 — BK-030 rollback write guard
1165
+
1166
+ - Added the reference-host rollback invariant: when `settings.bookingEnabled`
1167
+ is false, new booking and hold mutations return `capability_disabled`, while
1168
+ existing reads remain available and prior history is not deleted.
1169
+ - Extended the reference-host validator and operations docs with the rollback
1170
+ evidence requirement.
1171
+ - Result: the code-side rollback control is covered; production feature-flag
1172
+ and recovery evidence remains host-owned, so BK-030 stays `needs-evidence`.
1173
+
1174
+ ## Open production gates
1175
+
1176
+ The workspace UI and contracts can be delivered independently of a host's
1177
+ runtime. Before enabling real bookings, the host still needs a database
1178
+ migration run, availability/hold services, payment adapter/webhook
1179
+ reconciliation, notification delivery, browser evidence and a canary release.
1180
+ These are tracked in [`CURRENT-STATE.md`](./CURRENT-STATE.md), not hidden behind
1181
+ the UI installer.
1182
+
1183
+ ## 2026-09-20 — BK-031 runtime evidence capture boundary
1184
+
1185
+ - Found and fixed a real local evidence regression: the sanitized runtime
1186
+ fixture contained 27 observations while the canonical host contract declared
1187
+ 32 endpoints. `maggie booking runtime-validate` now passes the aligned
1188
+ 32-endpoint fixture.
1189
+ - Added `MaggieDash/scripts/capture-booking-runtime-evidence.mjs`. It requires
1190
+ an HTTPS origin, an environment-owned email/password session cookie, an
1191
+ explicit host test plan, and `--confirm` for mutation coverage. It writes
1192
+ only endpoint IDs, canonical routes, status codes, and required-field
1193
+ booleans.
1194
+ - Added the package-local
1195
+ `scripts/validate-booking-runtime-evidence.mjs`, a 32-endpoint fixture, the
1196
+ install manifest mappings, and the protected
1197
+ `.github/workflows/booking-runtime-evidence.yml` workflow. The workflow uses
1198
+ environment-scoped base URL/session/plan inputs and retains only sanitized
1199
+ evidence.
1200
+ - Tests passed:
1201
+ `npm run booking:runtime:evidence:test`, `npm test`, `git diff --check`,
1202
+ `python3 tools/clis/maggie_booking.py tasks validate`, and
1203
+ `python3 scripts/validate_skills.py`.
1204
+ - Result: BK-031 has a stable executable real-host evidence path but remains
1205
+ `needs-evidence` because neither inspected host project currently exposes the
1206
+ Booking route set, and no authenticated HTTPS host run has been supplied.
1207
+ The fixture is explicitly not production evidence.
1208
+
1209
+ ## 2026-09-20 — runtime evidence validator hardening
1210
+
1211
+ - Tightened `maggie booking runtime-validate` to fail closed on unsupported
1212
+ evidence schema, non-HTTPS base URLs, duplicate observations, and method or
1213
+ canonical-route mismatches against the host contract.
1214
+ - Re-ran the aligned 32-endpoint fixture, task-board validation, skill/link
1215
+ validation, and whitespace checks; all passed.
1216
+
1217
+ ## 2026-09-20 — BK-030 operational evidence contract
1218
+
1219
+ - Added `contracts/booking-ops-evidence-v1.json` plus matching MaggieDash
1220
+ validator and fixture. `maggie booking ops-validate` now checks sanitized
1221
+ proof for backup/restore, all seven stable health alert codes, and rollback /
1222
+ worker-restart / outbox-replay recovery rehearsal.
1223
+ - The validator is deliberately read-only: it does not create backups, page an
1224
+ operator, restart a worker, or replay an outbox. Those facts must still come
1225
+ from the host environment.
1226
+ - `npm run booking:ops:evidence:test`, `maggie booking ops-validate`, board
1227
+ validation, skill/link validation, and whitespace checks passed.
1228
+ - Result: BK-030 remains `needs-evidence` until a real host supplies these
1229
+ proofs plus the PostgreSQL/alert connection; the fixture is not release
1230
+ evidence.
1231
+
1232
+ ## 2026-09-20 — BK-022 reusable Booking route boundary
1233
+
1234
+ - Added `backend/booking/route-handler.mjs` with a framework-neutral dispatcher
1235
+ for all 32 Booking contract routes. It centralizes session lookup, default
1236
+ role policy, project scope, JSON parsing, idempotency-key enforcement,
1237
+ correlation headers, safe error mapping, and raw provider-webhook forwarding.
1238
+ - Extended `createBookingService` with calendar/availability, configuration,
1239
+ health, audit/event, and payment reconciliation methods required by the
1240
+ dispatcher. Added matching TypeScript host-boundary types and installer
1241
+ mappings.
1242
+ - Added `npm run booking:route-handler:test`; it passes all 32 route mappings
1243
+ plus unauthorized, staff mutation, missing-idempotency, cross-project,
1244
+ invalid-JSON, not-found, and webhook-body tests.
1245
+ - Re-ran `npm test` and `git diff --check`; both passed. This closes the
1246
+ reusable MaggieDash-side HTTP boundary, while real host repository/session
1247
+ and HTTPS production evidence remain BK-030/BK-031 gates.
1248
+
1249
+ ## 2026-09-20 — installed-package projection verification
1250
+
1251
+ - Installed the current MaggieDash source into a fresh temporary project with
1252
+ `python3 tools/clis/maggie_dash.py install --project <tmp> --source
1253
+ /home/balalior/Dev/MaggieDash --confirm`; 109 files were installed without
1254
+ overwriting the host project.
1255
+ - Ran the installed route-handler validator and installed ops-evidence
1256
+ validator. `maggie booking inspect --project <tmp>`, `release-gate --project
1257
+ <tmp>`, and `stripe-audit --project <tmp>` all passed.
1258
+ - This confirms the published install projection contains `_maggie/booking`,
1259
+ the 32-route dispatcher, contracts, runtime/browser workflows, worker,
1260
+ schema, ops templates, and sanitized fixtures. BK-030/BK-031 remain
1261
+ explicitly host-evidence gates; no fixture was promoted to production proof.
1262
+
1263
+ ## 2026-09-20 — BK-032 release gate includes operational evidence
1264
+
1265
+ - Extended `maggie booking release-gate` with `--ops-evidence`,
1266
+ `--ops-contract`, and `--require-ops`. The final gate can now require
1267
+ runtime, browser, operational, and execution-board evidence in one
1268
+ fail-closed decision.
1269
+ - Updated the Booking skill, task runbook, execution board, and final-gate
1270
+ examples so backup/restore, seven-code alert routing, and recovery rehearsal
1271
+ cannot be omitted from release review.
1272
+ - The gate remains read-only; it validates sanitized proof and never performs
1273
+ backups, paging, migrations, payment capture, or deployment.
1274
+
1275
+ ## 2026-09-20 — BK-022 canonical list response hardening
1276
+
1277
+ - Hardened `createBookingService` list methods to accept either a repository
1278
+ array or a canonical `{ items, total, page, pageSize }` object. Payment list
1279
+ responses now preserve the contract's `reconciliation` summary while still
1280
+ applying DTO redaction.
1281
+ - Added a regression fixture for object-shaped payment results and secret
1282
+ redaction in `validate-booking-service.mjs`; the service gate now covers
1283
+ this host/repository boundary explicitly.
1284
+ - Verification: `npm run booking:service:test`, `npm test`, fresh
1285
+ `maggie dash install` projection, installed route-handler validation,
1286
+ installed `release-gate --require-ops`, task-board validation, skill/link
1287
+ validation, and whitespace checks all passed.
1288
+
1289
+ ## 2026-09-20 — host discovery boundary for BK-031
1290
+
1291
+ - Rechecked the available local host projects. The ASPA-DAY main application
1292
+ has an independent `/api/booking/*` implementation with Firebase identity
1293
+ and business-membership semantics; `bea.gift` has no matching native
1294
+ Booking route set.
1295
+ - Neither project exposes MaggieDash's traditional email/password session,
1296
+ `/api/maggie/booking/*` 32-endpoint contract, or the required host adapter
1297
+ evidence boundary. They are therefore not used as BK-031 production proof,
1298
+ and no unrelated host code was modified to manufacture evidence.
1299
+
1300
+ ## 2026-09-20 — BK-029 staff role boundary correction
1301
+
1302
+ - Corrected the reusable authorization policy: staff can now perform only
1303
+ approved `checked_in`, `in_progress`, `completed`, and `no_show` booking
1304
+ transitions. Staff payment routes, payment-health, customer directories,
1305
+ reschedule/configuration writes, and other mutations remain forbidden.
1306
+ - Reused the same policy in the fixture reference host instead of maintaining
1307
+ a second divergent role matrix. The route-handler validator now covers the
1308
+ allowed lifecycle path and denied finance/customer/unsafe-transition paths.
1309
+
1310
+ ## 2026-09-20 — booking security documentation synchronized
1311
+
1312
+ - Updated the security/compliance and host-adapter guidance to document the
1313
+ staff lifecycle-only mutation boundary, finance payment boundary, and the
1314
+ host-owned location/assignment filtering requirement.
1315
+ - Verification after the policy and documentation change: full MaggieDash
1316
+ `npm test`, route-handler validator, reference-host validator, fresh install
1317
+ projection, installed runtime/ops evidence validators, task-board validation,
1318
+ skill/link validation, and whitespace checks all passed.
1319
+
1320
+ ## 2026-09-20 — BK-030 real worker adapter cycle and tenant context fix
1321
+
1322
+ - Extended the disposable PostgreSQL integration test to execute the complete
1323
+ `PostgresWorkerAdapter -> runBookingJobs -> dispatcher -> transaction`
1324
+ cycle, instead of testing repository reads/writes in isolation.
1325
+ - Fixed the repository/adapter context mismatch that could acknowledge webhook
1326
+ events while silently skipping payment, notification, event, and availability
1327
+ state writes. The PostgreSQL repository now accepts and validates the shared
1328
+ `{ tenantScope, nextState }` context and rejects mismatched tenant scopes.
1329
+ - Removed a test-clock race by setting notification `available_at` explicitly
1330
+ in the integration fixture. The bare database-name integration path now uses
1331
+ `PGHOST` or the local PostgreSQL socket.
1332
+ - Evidence: disposable PostgreSQL schema migration applied twice, advisory
1333
+ lock and overlap checks passed, and the real worker cycle persisted payment
1334
+ acknowledgement, notification delivery, event, and availability snapshot.
1335
+ BK-030 still requires host alert-routing, backup/restore, and recovery proof.
1336
+
1337
+ ## 2026-09-20 — BK-031 installed runtime workflow path fix
1338
+
1339
+ - Fixed `.github/workflows/booking-runtime-evidence.yml` so it resolves either
1340
+ the source checkout's `scripts/` directory or the installed host's
1341
+ `maggiedash/scripts/` directory, matching the browser evidence workflow.
1342
+ - Added a manifest/runtime validator invariant for both capture and validation
1343
+ commands. This prevents an installed Booking package from producing a broken
1344
+ workflow that cannot capture its required 32-endpoint evidence.
1345
+ - Verification: source `npm test`, fresh 109-file install projection, installed
1346
+ Booking inspect, and inspection of the installed workflow paths all passed.
1347
+
1348
+ ## 2026-09-20 — BK-031 browser layout evidence enforcement
1349
+
1350
+ - Extended the browser evidence contract and validator with `layoutErrors`.
1351
+ Capture now measures document/body width at every route and viewport and
1352
+ fails evidence on horizontal overflow, alongside console and request errors.
1353
+ - This makes the existing QA acceptance criterion executable in the protected
1354
+ Playwright workflow instead of relying only on the local UI smoke test.
1355
+
1356
+ ## 2026-09-20 — BK-032 release gate browser parity
1357
+
1358
+ - Closed a release-gate parity gap: the Python `maggie booking release-gate`
1359
+ browser validator now requires the same ISO timestamp, 390/768/1440 viewport
1360
+ set, empty console/request errors, and empty `layoutErrors` as the installed
1361
+ JavaScript evidence validator.
1362
+ - This prevents an old or incomplete browser artifact from passing the final
1363
+ gate merely because it contains the expected route names.
1364
+
1365
+ ## 2026-09-20 — BK-032 runtime evidence parity
1366
+
1367
+ - Hardened the Python runtime evidence validator used by `maggie booking
1368
+ runtime-validate` and `release-gate`: it now requires ISO timestamps and a
1369
+ dedicated tenant, exact endpoint cardinality, rejects unknown/duplicate
1370
+ observations, and rejects sensitive evidence keys.
1371
+ - The Python gate now matches the JavaScript host validator's fail-closed
1372
+ contract instead of accepting a weaker local representation.
1373
+
1374
+ ## 2026-09-20 — BK-031 runtime plan route regression
1375
+
1376
+ - Fixed the runtime capture plan matcher so contract placeholders such as
1377
+ `{id}` are converted to concrete path segments exactly once. The previous
1378
+ matcher replaced placeholders before attempting to build its comparison
1379
+ pattern, so valid concrete routes could be rejected before any host request.
1380
+ - Exported the plan validator and added
1381
+ `scripts/validate-booking-runtime-plan.mjs`, covering concrete path
1382
+ parameters, required query parameters, mutation bodies, and unknown-route
1383
+ rejection without credentials.
1384
+ - Added the validator to the MaggieDash distribution manifest, `npm test`,
1385
+ the task board, host README, and the installed-project docs.
1386
+ - Verification: runtime plan validator, manifest validation, full MaggieDash
1387
+ test suite, fresh install projection, installed plan validator, ai-cmo task
1388
+ validation, skill/link validation, and whitespace checks.
1389
+
1390
+ ## 2026-09-20 — BK-030 operational evidence gate hardening
1391
+
1392
+ - Strengthened the Booking ops evidence contract and both validators to require
1393
+ backup/restore timestamps, row-count verification, critical alert delivery,
1394
+ and all rollback/restart/outbox-replay proof booleans.
1395
+ - Added `--require-host` to reject fixture, test, and local environments when
1396
+ operational evidence is used for a release gate. The regular fixture command
1397
+ remains available for local validator regression tests.
1398
+ - Added the protected
1399
+ `.github/workflows/booking-ops-evidence.yml` workflow and installed manifest
1400
+ entry. It accepts only a sanitized host-generated artifact and does not
1401
+ pretend to execute host-specific backup, pager, restart, or replay actions.
1402
+ - The workflow also checks that the evidence `environment` matches the selected
1403
+ GitHub deployment environment before validation, preventing a staging
1404
+ artifact from being attached to a production run.
1405
+ - Added regression coverage for missing proof fields, false recovery claims,
1406
+ and the host-only gate. BK-030 remains `needs-evidence` until a real host
1407
+ supplies backup/restore, alert-routing, and recovery evidence.
1408
+ - Expanded the health gate to exercise all seven stable alert codes, including
1409
+ worker failure and retrying-notification paths that were previously only
1410
+ named in the ops contract.
1411
+ - Verification: source `npm test`, fixture and host-only ops validators,
1412
+ `python3 -m unittest tools.tests.test_maggie_booking`, fresh install
1413
+ projection, installed Booking inspect, task-board validation, Python syntax,
1414
+ skill/link validation, and whitespace checks.
1415
+
1416
+ ## 2026-09-20 — BK-030 disposable backup/restore rehearsal
1417
+
1418
+ - Ran a real local PostgreSQL rehearsal against an explicitly named disposable
1419
+ database: applied the base and Booking migrations twice, inserted a sentinel
1420
+ project row, created a custom-format `pg_dump`, restored into a separate
1421
+ disposable database, and verified the sentinel row after restore.
1422
+ - Result: schema/constraint/advisory-lock checks passed and
1423
+ `backup_restore status=passed restored_rows=1`; both temporary databases were
1424
+ dropped after verification.
1425
+ - This is local database evidence only. It does not satisfy the remaining
1426
+ production-host backup retention, alert destination, worker restart, and
1427
+ outbox replay evidence required to move BK-030 to `passed`.
1428
+ ## 2026-09-20 — BK-033 public customer boundary
1429
+
1430
+ - Added the versioned `booking-customer-surface-v1` contract with six separate
1431
+ public-noindex routes for catalogue, availability, holds, checkout start,
1432
+ payment-return recovery, and customer cancellation.
1433
+ - Added `customer-flow.mjs` safe public DTOs, hold input validation, bounded
1434
+ payment-return states, and allowlisted confirmation/cancellation/reschedule/
1435
+ reminder notification intents. Added the framework-neutral customer route
1436
+ handler with `no-store`/`noindex` headers, mutation idempotency, and
1437
+ fail-closed tenant binding.
1438
+ - Added a secret-free fixture and `npm run booking:customer-flow:test`, then
1439
+ included all customer artifacts in the MaggieDash distribution manifest.
1440
+ - Documentation updated in the MaggieDash root/backend/Astro adapter docs and
1441
+ the Booking PRD, delivery plan, host adapter, task runbook, and board.
1442
+ - Verification: customer-flow validator, full MaggieDash `npm test`, manifest
1443
+ validation, public DTO redaction, missing-tenant rejection, and route
1444
+ noindex/idempotency checks all passed.
1445
+ - Remaining host work is explicit: bind a real tenant, apply public
1446
+ origin/CSRF/rate-limit/bot controls, persist customer methods, wire provider
1447
+ checkout and email/SMS delivery, then capture real runtime/browser evidence.
1448
+
1449
+ ## 2026-09-20 — BK-034 public customer booking page
1450
+
1451
+ - Added `booking/src/customer.tsx` and the Astro route starter
1452
+ `adapters/astro/customer-booking-page.astro` for the public
1453
+ `/_maggie/booking/book` page. The page loads the public catalogue and
1454
+ availability, creates an idempotent hold, starts checkout, and renders a
1455
+ pending payment-return state without treating a redirect as confirmation.
1456
+ - Public browser requests use `credentials: omit`; write requests carry
1457
+ `Idempotency-Key` and `X-Correlation-Id`. The Astro starter is noindex and
1458
+ the installed projection includes both route templates.
1459
+ - Added `booking:customer-ui:test`, manifest requirements, task BK-034, and
1460
+ synchronized the MaggieDash/AI CMO booking documentation.
1461
+ - Verification: customer UI/source and installed-projection validators,
1462
+ customer-flow validator, manifest validation, MaggieDash `npm test`,
1463
+ task-board validation, Python CLI tests, esbuild TSX bundle parse, and
1464
+ installed projection inspection passed. A production host
1465
+ still owns tenant binding, origin/CSRF/rate limits, provider checkout,
1466
+ persistence, and real browser/runtime evidence.
1467
+
1468
+ ## 2026-09-20 — BK-035 public customer reference-host journey
1469
+
1470
+ - Added `backend/booking/customer-reference-host.mjs`, a deterministic
1471
+ public-customer wrapper around the existing secret-free manager reference
1472
+ host. It exercises the public catalog, availability, hold, checkout,
1473
+ payment-return, and token-bound cancellation boundary without using the
1474
+ manager session for customer routes.
1475
+ - Added `scripts/validate-booking-customer-reference-host.mjs` and exposed it
1476
+ through `booking:customer-reference-host:test`, the distribution manifest,
1477
+ the installed-project inspector, and the full `npm test` gate.
1478
+ - Verification: public catalog and date-scoped availability, idempotent hold
1479
+ replay, checkout-to-pending state, payment-return recovery, token-bound
1480
+ cancellation, manager-session isolation, and notification-intent assertions
1481
+ all passed.
1482
+ - This is deterministic contract/browser development evidence only. A host
1483
+ still owns tenant persistence, origin/CSRF/rate limits, provider checkout,
1484
+ opaque token storage, and production browser/runtime evidence.
1485
+
1486
+ ## 2026-09-20 — BK-036 customer input and mutation replay hardening
1487
+
1488
+ - Hardened `customer-flow.mjs` so public holds reject malformed email
1489
+ addresses and missing booking-update consent with structured
1490
+ `validation_failed` fields, while preserving the existing empty-payload
1491
+ validation order.
1492
+ - Added customer-scoped idempotency storage to the reference customer host for
1493
+ checkout and cancellation. Replayed cancellation returns the original
1494
+ response without a second event or notification intent.
1495
+ - Verification: invalid-email, missing-consent, stable-error-ordering,
1496
+ customer-flow, cancel-replay, full MaggieDash `npm test`, and installed
1497
+ projection checks passed.
1498
+
1499
+ ## 2026-09-20 — BK-037 idempotency payload mismatch regression
1500
+
1501
+ - Added a customer-scoped normalized request hash to the deterministic public
1502
+ reference host. The stored record contains only the hash and redacted
1503
+ response, never the raw customer payload.
1504
+ - Same-key same-payload retries replay the original hold, checkout, or cancel
1505
+ response. Reusing a key with a different payload now fails with a safe
1506
+ `409 conflict` response instead of silently returning the wrong result.
1507
+ - Verification: hold, checkout, and cancellation mismatch fixtures,
1508
+ customer reference-host validator, syntax checks, and the full MaggieDash
1509
+ test suite passed. The compact ai-cmo-skills contract now validates the
1510
+ declared input and replay policy through `maggie booking inspect`, with a
1511
+ Python regression test for policy drift.
1512
+
1513
+ ## 2026-09-20 — BK-038 public customer CI coverage
1514
+
1515
+ - Extended `.github/workflows/booking-runtime.yml` so source and installed
1516
+ runtime gates execute the public customer flow, reference-host, and UI
1517
+ validators, plus syntax checks for the customer backend modules.
1518
+ - Added static workflow markers to `scripts/validate-booking.mjs`, preventing
1519
+ future workflow edits from silently dropping the public customer checks.
1520
+ - Verification: MaggieDash `npm test`, source/install customer validators,
1521
+ workflow marker validation, and manifest/install inspection passed.
1522
+
1523
+ ## 2026-09-20 — BK-039 complete service adapter contract
1524
+
1525
+ - Added `backend/booking-adapter-contract.d.ts` with the full transaction
1526
+ repository method surface consumed by `createBookingService`, the complete
1527
+ manager `BookingService` shape, and a separate six-method
1528
+ `BookingCustomerService` shape.
1529
+ - Added explicit `serviceMethod` mappings to all 32 versioned manager endpoints.
1530
+ This makes the route → service → repository seam inspectable before a host
1531
+ wires PostgreSQL, while keeping SQL, sessions, secrets, and provider SDKs
1532
+ host-owned.
1533
+ - Added `scripts/validate-booking-service-contract.mjs`, installed it through
1534
+ `maggiedash.json`, and included it in the Booking manifest gate. It rejects
1535
+ missing/duplicate endpoint mappings and missing repository, manager-service,
1536
+ or public-customer method declarations.
1537
+ - Updated the host adapter documentation with the typed seam and command.
1538
+ - Verification: service-contract validator, MaggieDash `npm test`, manifest
1539
+ validation, and fresh install projection checks passed. This is a contract
1540
+ gate, not production host evidence; BK-030/BK-031 remain external-host work.
1541
+
1542
+ ## 2026-09-20 — BK-040 CLI service-contract enforcement
1543
+
1544
+ - Mirrored the 32 manager `serviceMethods` mappings and six public customer
1545
+ methods in the compact ai-cmo Booking contract.
1546
+ - Updated `maggie booking inspect` and `release-gate` to require the installed
1547
+ `booking-adapter-contract.d.ts` and service-contract validator, so an
1548
+ installed project cannot appear ready with only route/UI files.
1549
+ - Added Python regression coverage and documented the stable
1550
+ `npm run booking:service-contract:test` command in the Booking CLI runbook.
1551
+ - Verification: Python unit tests, CLI contract validation, task-board
1552
+ validation, syntax compilation, and installed-projection inspection passed.
1553
+
1554
+ ## 2026-09-20 — BK-041 customer cancellation UI
1555
+
1556
+ - Added a token-bound cancellation action to the public payment-return page.
1557
+ The page sends `credentials: omit`, an idempotency key, and the opaque
1558
+ continuation token to `/api/maggie/booking/public/bookings/{id}/cancel.json`.
1559
+ - Added bounded pending, success, and error states without native dialogs, and
1560
+ extended the customer UI validator to protect the cancellation route marker.
1561
+ - Updated the MaggieDash README and customer journey task record.
1562
+ - Verification: customer UI validator, source syntax checks, full MaggieDash
1563
+ `npm test`, and installed customer UI validation passed. Production tenant
1564
+ binding, cancellation policy, and real browser evidence remain host-owned.
1565
+
1566
+ ## 2026-09-20 — BK-042 PostgreSQL manager core repository
1567
+
1568
+ - Added the additive `maggiedash_booking_settings` table and
1569
+ `createPostgresBookingCoreRepository` in MaggieDash. It accepts only a host
1570
+ query executor, same-client transaction callback, tenant scope, and clock;
1571
+ it never imports `pg`, reads environment variables, or handles provider
1572
+ secrets.
1573
+ - Implemented tenant-scoped parameterized reads for overview/calendar,
1574
+ bookings, availability, customers, catalogue, settings, audit, events, and
1575
+ runtime, plus transactional booking creation, hold creation/release,
1576
+ rescheduling, and lifecycle transition writes. Writes persist idempotency,
1577
+ event, audit, allocation, and overlap-protected records.
1578
+ - Added explicit PostgreSQL casts for every bound parameter in the new SQL
1579
+ seam, including nullable text/date/timestamp values, to prevent the class of
1580
+ ambiguous-parameter errors seen in host API handlers.
1581
+ - Added the typed core repository surface, install manifest entries, README
1582
+ host wiring notes, and a fake-executor validator covering same-key replay,
1583
+ tenant rejection, transaction client reuse, SQL parameter typing, and event/
1584
+ audit persistence.
1585
+ - Updated `maggie booking inspect` and `release-gate` to require the installed
1586
+ core repository artifact as well as its typed service contract and validator.
1587
+ - Verification: core repository validator, service/host/schema gates, full
1588
+ MaggieDash `npm test`, fresh install projection, task-board validation, and
1589
+ Python/skill/link checks passed. A real disposable PostgreSQL database also
1590
+ passed migration, booking create/replay, transition, reschedule, readback,
1591
+ event/audit/idempotency persistence, and cleanup. Payment provider orchestration,
1592
+ public checkout persistence, and real host evidence remain explicit follow-up
1593
+ work; configuration persistence is covered by BK-043.
1594
+
1595
+ ## 2026-09-20 — BK-043 PostgreSQL manager configuration and operational reads
1596
+
1597
+ - Added the tenant-scoped PostgreSQL manager repository surface for catalogue,
1598
+ staff, resources, schedules, closures, settings, payments reads, health,
1599
+ payment health, audit, events, and lifecycle operations. Existing variants
1600
+ referenced by bookings are deactivated rather than deleted during catalogue
1601
+ updates.
1602
+ - Added the additive `maggiedash_booking_closures` table, expanded the typed
1603
+ core adapter contract, and added the installed manager-method validator. The
1604
+ core remains secret-free and deliberately leaves payment SDK operations and
1605
+ webhook verification to injected host adapters.
1606
+ - Extended the real disposable PostgreSQL integration to exercise catalog,
1607
+ staff, resource, schedule, closure, settings, health, event/audit, and
1608
+ idempotency persistence. The cycle passed and removed its test tenant.
1609
+ - Evidence: `npm run booking:postgres-manager-methods:test`,
1610
+ `npm run booking:postgres-core-repository:integration --
1611
+ --database-url <disposable-db> --confirm`, `npm test`, and fresh install
1612
+ projection checks.
1613
+ - Result: BK-043 passed. Remaining work is the host/provider payment and
1614
+ webhook seam plus real host runtime/browser/ops evidence for BK-030/BK-031;
1615
+ BK-032 remains the final release gate.
1616
+
1617
+ ## 2026-09-20 — BK-044 provider-injected PostgreSQL payment persistence
1618
+
1619
+ - Added `backend/booking/postgres-payment-adapter.mjs` for normalized payment
1620
+ start, server-side reconciliation, and refund persistence. The host injects
1621
+ the fake or Stripe-shaped gateway; the adapter does not import provider SDKs,
1622
+ read secrets, or accept raw provider payloads.
1623
+ - Payment provider calls happen before the adapter's short PostgreSQL
1624
+ transaction. The transaction persists payment attempts, booking payment
1625
+ status, refund/payment-transaction rows, idempotency, and event/audit records.
1626
+ `createBookingService` now routes provider mutations through this boundary so
1627
+ an external call is never held inside the manager repository transaction.
1628
+ - Added fake-gateway and real disposable PostgreSQL coverage for start,
1629
+ same-key replay, reconciliation, refund, and persistence counts. The
1630
+ service gate also verifies the provider-outside-transaction behavior.
1631
+ - Evidence: `npm run booking:postgres-payment-adapter:test`,
1632
+ `npm run booking:service:test`, `npm test`, and the real core/payment
1633
+ PostgreSQL integration cycle passed and cleaned up its tenant/database.
1634
+ - Result: BK-044 passed. Webhook signature verification, public checkout
1635
+ persistence, and real host runtime/browser/ops evidence remain explicit host
1636
+ boundaries; BK-030/BK-031 still require external evidence and BK-032 is the
1637
+ final release gate.
1638
+
1639
+ ## 2026-09-20 — BK-045 public customer PostgreSQL persistence
1640
+
1641
+ - Added `maggiedash_booking_customer_tokens` with a short-lived token hash and
1642
+ host-sealed ciphertext. Raw bearer tokens are generated/used in memory only;
1643
+ the host supplies `tokenCodec.seal/open` backed by its AEAD key.
1644
+ - Added `backend/booking/postgres-customer-adapter.mjs` composing the manager
1645
+ core and payment persistence seams for public catalog, availability, holds,
1646
+ checkout-to-pending, payment-return recovery, and token-bound cancellation.
1647
+ It uses public DTOs and never exposes manager/customer/provider internals.
1648
+ Customer hold, checkout, and cancellation mutations now require their own
1649
+ namespaced idempotency records and use the manager transaction seam when
1650
+ available.
1651
+ - Added a customer adapter validator and installed it through the manifest,
1652
+ service contract, package scripts, and README/host adapter documentation.
1653
+ - Evidence: customer adapter gate, customer flow and reference-host gates,
1654
+ real disposable PostgreSQL hold/checkout/payment-return/cancel replay,
1655
+ full `npm test`, schema/install checks, and fresh projection validation
1656
+ passed. Public origin/CSRF, abuse controls, notification delivery, token key,
1657
+ and real host/browser evidence remain host-owned.
1658
+ - Result: BK-045 passed. BK-030/BK-031 still require external host evidence and
1659
+ BK-032 remains the final release gate.
1660
+
1661
+ ## 2026-09-20 — BK-030 executable backup/restore rehearsal
1662
+
1663
+ - Added `scripts/validate-booking-postgres-backup-restore.integration.mjs` and
1664
+ the stable `booking:postgres-backup-restore:integration` command to turn the
1665
+ backup requirement into a repeatable check. It requires explicitly named
1666
+ source and empty restore databases, runs a custom-format `pg_dump`/
1667
+ `pg_restore`, and compares row counts for the protected Booking tables.
1668
+ - Installed the command through `maggiedash.json`, documented it in the
1669
+ MaggieDash/host/ops README files, and added it to the BK-030 execution gate.
1670
+ - Verification: a real local disposable source/restore database pair passed
1671
+ row-count parity; the existing worker repository cycle and `pg_dump`/
1672
+ `pg_restore` rehearsal also passed. The command never drops either database.
1673
+ - Result: local BK-030 implementation/evidence is stronger, but the task stays
1674
+ `needs-evidence` until the host supplies alert routing, backup/recovery
1675
+ ownership, and sanitized host ops evidence. BK-031/BK-032 remain open.
1676
+
1677
+ ## 2026-09-20 — BK-046 customer checkout provider-failure recovery
1678
+
1679
+ - Reproduced the failure window where the manager conversion committed before
1680
+ the payment provider call failed. A retry previously saw a converted hold
1681
+ and returned a conflict, even though the booking was still recoverable.
1682
+ - Namespaced customer hold, checkout, and cancellation mutations when calling
1683
+ the manager repository, keeping those manager keys distinct from the
1684
+ customer idempotency records. Checkout now replays the conversion with the
1685
+ stable customer key, reuses an unexpired sealed customer token, and sends the
1686
+ same provider idempotency key on retry. A genuinely expired active hold still
1687
+ fails closed.
1688
+ - Added a regression that fails the provider after conversion, retries the
1689
+ same checkout, and verifies the pending booking is recovered without a
1690
+ duplicate booking/token path.
1691
+ - Extended the disposable PostgreSQL integration with the same failure window:
1692
+ the first provider call throws after conversion, the retry succeeds, the
1693
+ replay returns the same booking, and the database contains one recovery
1694
+ booking with two sealed customer tokens total.
1695
+ - Evidence: `npm run booking:postgres-customer-adapter:test`, disposable
1696
+ PostgreSQL core/customer integration, `node --check
1697
+ scripts/validate-booking-postgres-core-repository.integration.mjs`, and the
1698
+ full MaggieDash `npm test` gate passed. BK-046 is passed; BK-030/BK-031
1699
+ still require real host evidence and BK-032 remains the final release gate.
1700
+
1701
+ ## 2026-09-20 — BK-047 backup restore target fail-closed preflight
1702
+
1703
+ - Audited the executable backup/restore rehearsal and found two unsafe or
1704
+ misleading assumptions: the command previously trusted the caller's empty
1705
+ target claim, and a row-empty schema still made full `pg_restore` fail on
1706
+ `CREATE TABLE` conflicts.
1707
+ - Added a true empty-public-schema preflight before `pg_restore`. A target with
1708
+ any public application table now fails before dump restore and leaves the
1709
+ existing target unchanged; a bare empty database receives the full
1710
+ custom-format restore and row-count parity.
1711
+ - Added `--pg-bin-dir` plus server/client major-version preflight. The command
1712
+ now gives an actionable error when the default `PATH` selects an older
1713
+ `pg_dump`/`pg_restore`, instead of exposing a late dump failure.
1714
+ - Evidence: a real PostgreSQL 14 source/bare-target pair passed with
1715
+ `--pg-bin-dir /usr/lib/postgresql/14/bin`; a target containing the source
1716
+ schema/project was rejected before restore; and the forced PostgreSQL 12
1717
+ `PATH` produced the expected corrective `--pg-bin-dir` error. README, ops,
1718
+ host adapter docs, task board, and this progress record now describe the
1719
+ fail-closed target and client-selection behavior. BK-047 is passed;
1720
+ BK-030/BK-031 and BK-032 remain the real-host release gates.
1721
+
1722
+ ## 2026-09-20 — BK-047 board and install projection verification
1723
+
1724
+ - Reconciled the machine-readable BK-030 execution-board command with the
1725
+ matching-client requirement introduced by BK-047.
1726
+ - Installed a fresh temporary project from the current MaggieDash worktree;
1727
+ `maggie booking inspect --project <temporary-project>` passed all 30 install,
1728
+ contract, validator, workflow, schema, customer, worker, and ops checks.
1729
+ - Ran the required release gate against that projection. With runtime, browser,
1730
+ ops, and board requirements enabled, it correctly returned `blocked` with
1731
+ explicit missing-evidence errors rather than treating local source or fixture
1732
+ artifacts as production proof. BK-030/BK-031 remain external-host work and
1733
+ BK-032 is now `needs-evidence` until those artifacts exist.
1734
+
1735
+ ## 2026-09-20 — BK-032 release-gate diagnostics
1736
+
1737
+ - Hardened `maggie booking release-gate` so explicitly supplied but missing or
1738
+ malformed runtime, browser, and ops artifacts produce a machine-readable
1739
+ `blocked` result with the affected evidence status set to `failed`, instead
1740
+ of terminating before the gate report is emitted.
1741
+ - Added a Python regression covering all three missing-artifact paths and
1742
+ documented the CI/task-workflow behavior. The gate remains fail-closed and
1743
+ still requires real host evidence when the corresponding `--require-*`
1744
+ flags are used. BK-032 is now `needs-evidence`: its implementation and local
1745
+ regression are complete, but release cannot pass until BK-030/BK-031 provide
1746
+ host-bound runtime, browser, and operations evidence.
1747
+
1748
+ ## 2026-09-20 — local full-gate verification and CI diagnosis
1749
+
1750
+ - Re-ran the MaggieDash Booking reference-host suite (32 endpoints), UI source
1751
+ gate, full `npm test`, TSX/esbuild parse, disposable PostgreSQL backup/restore
1752
+ rehearsal, and the fresh install projection. All local checks passed.
1753
+ - Re-ran the ai-cmo-skills task-board, Python Booking CLI regression suite,
1754
+ skill/link validator, and whitespace check. All passed; the release gate
1755
+ correctly emits structured `blocked` output when required host artifacts are
1756
+ absent.
1757
+ - Inspected GitHub Actions run `35437704491` / job `105883076605`. The failure
1758
+ was the Astro starter build loading `astro.config.mjs` without
1759
+ `PUBLIC_SITE_URL`; commit `b19ad64` already adds the non-secret CI value
1760
+ `https://example.test`. No Booking code caused that failure.
1761
+ - The remaining release blockers are unchanged and intentional: a real
1762
+ authenticated HTTPS host run for BK-031, plus host-owned alert routing,
1763
+ backup/recovery, and operational evidence for BK-030. Fixture/reference-host
1764
+ output is not promoted as production proof.
1765
+
1766
+ ## 2026-09-20 — documentation synchronization against MaggieDash 0.2.6
1767
+
1768
+ - Re-inspected MaggieDash after the Booking commit was pushed. `main` and
1769
+ `origin/main` both resolve to `16afe3ba9e26ce952cc6ad32b7f813a6a1ea5bfc`;
1770
+ `package.json` and `maggiedash.json` both report `0.2.6`.
1771
+ - Updated this progress log, the Booking README, delivery plan, CLI guide, and
1772
+ docs index to point at the current 32-route manager contract,
1773
+ six-route public customer contract, installed validators, and current
1774
+ release-board counts. Historical entries were left intact and are not
1775
+ rewritten as current status.
1776
+ - Verification: `npm test` in MaggieDash passed; `maggie booking tasks
1777
+ validate`, the seven Python Booking regressions, `validate_skills.py`, and
1778
+ `git diff --check` passed in ai-cmo-skills.
1779
+ - Result: docs now reflect the pushed `0.2.6` source. No local/reference-host
1780
+ result was promoted to production evidence; BK-030/BK-031/BK-032 remain
1781
+ `needs-evidence` until host-owned artifacts pass the final gate.
1782
+
1783
+ ## 2026-09-20 — ORA Wellness host integration audit
1784
+
1785
+ - Audited `/home/balalior/Dev/clients/orawellness.uk` after installing the
1786
+ Booking workspace. The host now has manager/customer routes, email/password
1787
+ auth, Booking roles, Stripe injection, a Resend outbox worker, and the public
1788
+ customer flow.
1789
+ - Fixed the production-path gaps found during the audit: real tenant location
1790
+ selection, safe public 403/429 errors, Stripe payment-account projection,
1791
+ webhook payload hashing, customer-cancel notification enqueueing, and worker
1792
+ payment projection from `pending_payment` to `confirmed`/`cancelled`.
1793
+ - Added the host-specific audit and deployment guide:
1794
+ `ORAWELLNESS-INTEGRATION-AUDIT.md` and the client
1795
+ `docs/maggie-booking-integration.md`.
1796
+ - Evidence: ORA build passed, installed Booking inspection passed, central
1797
+ MaggieDash `npm test` passed, and the read-only schema check reported
1798
+ `core=true`, `booking=false`, `access=false`. No client database migration
1799
+ was applied. Production Stripe, Resend scheduler, browser, and operations
1800
+ evidence remain required before switching the public CTA.
1801
+
1802
+ ## 2026-09-20 — generic Booking host bootstrap
1803
+
1804
+ - Productized the Booking setup path as `maggie booking install --project .
1805
+ --confirm`. It delegates to the distribution installer and keeps the
1806
+ `/_maggie/admin` and `/_maggie/booking` workspaces together.
1807
+ - Added an Astro host bootstrap that is safe for blank or existing projects:
1808
+ email/password sessions, first-owner registration, manager/public Booking
1809
+ routes, PostgreSQL/Stripe adapter wiring, middleware rewrite starter, schema
1810
+ command, Resend outbox worker, and an environment-variable example are
1811
+ copied only when the destination file is absent. Existing files are reported
1812
+ as preserved; an existing `src/middleware.ts` requires a deliberate manual
1813
+ merge of the generated rewrite block.
1814
+ - Included the installer path in the npm CLI bundle and added the
1815
+ host-bootstrap validator. Evidence: MaggieDash `booking:host-bootstrap:test`,
1816
+ full `npm test`, ai-cmo-skills Booking installer tests (14/14), package CLI
1817
+ help smoke test, and a disposable Astro install projection all passed.
1818
+ - This is an install/bootstrap improvement, not production activation. It does
1819
+ not apply SQL, create the first owner, install host dependencies, configure
1820
+ Stripe/Resend credentials, merge existing middleware, or provide production
1821
+ runtime/browser/operations evidence. Full Fresha parity (packages,
1822
+ memberships, gift cards, deposits, reminders, reports, multi-location, and
1823
+ customer history) remains outside the current v1 scope.
1824
+
1825
+ ## 2026-09-20 — Booking access and permission boundary
1826
+
1827
+ - Found and fixed a fresh-install defect: the generic Astro adapter queried
1828
+ `maggiedash_booking_user_roles`, but the standard Booking migration did not
1829
+ create it. The table is now part of the provider-neutral migration with
1830
+ `manager`, `staff`, and `finance` roles, optional staff-profile linkage,
1831
+ explicit `permissions_json`, and an active flag. Existing host extensions
1832
+ receive additive columns rather than destructive changes.
1833
+ - Added the generic Astro access API and Staff dashboard panel. Owners and
1834
+ administrators can create email/password accounts, link staff profiles,
1835
+ revoke access, reset passwords, and edit granular capabilities. The shared
1836
+ route handler maps those capabilities to calendar, booking lifecycle,
1837
+ customer, catalogue, staff, resource, schedule, payment, refund, settings,
1838
+ and audit routes; authorization is enforced server-side.
1839
+ - Synchronized the ORA host adapter, access endpoint, schema extension, and
1840
+ installed Booking UI with the same permission boundary. ORA's build passed
1841
+ with 0 errors; MaggieDash host bootstrap, schema, UI, and full npm tests
1842
+ passed, as did the ai-cmo-skills installer regressions.
1843
+ - This phase still uses an administrator-supplied temporary password rather
1844
+ than a Resend invitation/reset flow. Resend remains the Booking notification
1845
+ worker; invitation email, password reset, staff self-service profile, and
1846
+ full Fresha feature parity remain follow-up work.
1847
+
1848
+ ## 2026-09-20 — Staff assignment scope and account email lifecycle
1849
+
1850
+ - Found and fixed the repository-level assignment gap: route permissions alone
1851
+ did not restrict a staff session's project-scoped booking queries. A linked
1852
+ `staff_id` is now propagated through the host session context and enforced for
1853
+ overview metrics, calendar, availability, bookings, customer summaries,
1854
+ staff/resources, schedule rows, booking/hold reads, and lifecycle mutations.
1855
+ Unlinked staff sessions fail closed; service variants are project-scoped.
1856
+ - Added server-side Resend account email helpers to the generic Astro host and
1857
+ ORA: one-time expiring invitation/reset tokens, hashed token persistence,
1858
+ password setup/reset, session revocation after reset, account-email API
1859
+ routes, reset page, invitation resend action, and account audit events. The
1860
+ Booking access panel no longer requires an administrator to share a temporary
1861
+ password.
1862
+ - Verification: central core repository and route-handler validators passed;
1863
+ generic Astro bootstrap validator now covers the account-email routes; ORA
1864
+ Astro build, generic host bundle checks, the central npm suite, and the
1865
+ Booking inspect gate passed.
1866
+ - Fixed the final account-email routing gap by adding the
1867
+ `/_maggie/reset-password` middleware rewrite in both the generic Astro host
1868
+ and ORA. ORA's Booking Staff panel can now create an account and send its
1869
+ invitation directly, then link the staff profile and edit permissions.
1870
+
1871
+ ## 2026-09-20 — Reports slice
1872
+
1873
+ - Added the tenant-scoped `booking.reports.read` endpoint and PostgreSQL
1874
+ `readReports` repository method. It validates a maximum 366-day range and
1875
+ returns totals, booked minutes, revenue, cancellations/no-shows, and
1876
+ breakdowns by day, service, staff, and location.
1877
+ - Added the Reports navigation screen, date filters, accessible data tables,
1878
+ reference-host coverage, route/contract validators, and the `reports.read`
1879
+ permission name. Central MaggieDash `npm test` passes with 33 manager routes.
1880
+ - ORA still needs the copied installed adapter/contract projection refreshed and
1881
+ real staging data verification before this report can be treated as a
1882
+ production read model.
1883
+ - Remaining: apply the standard schema on staging, capture real Resend/Stripe
1884
+ delivery and authenticated browser evidence, and implement the broader
1885
+ Fresha roadmap (packages, memberships, gift cards, deposits, reporting,
1886
+ multi-location policies, and customer self-service history).
1887
+
1888
+ ## 2026-09-20 — 24-hour reminder slice
1889
+
1890
+ - Added `queueBookingReminders` to the provider-neutral notification module.
1891
+ It selects future `confirmed` bookings within the next 24 hours, requires a
1892
+ customer email, and derives a stable tenant-scoped idempotency key from the
1893
+ booking ID.
1894
+ - Added `enqueue-reminders` to the runtime contract and default worker cycle.
1895
+ The PostgreSQL worker now loads the customer email/location needed for the
1896
+ server-side decision and upserts newly queued outbox rows in the same worker
1897
+ transaction. The dispatcher still resolves the actual address at send time;
1898
+ raw email is not stored in the notification record.
1899
+ - Synced the ORA host copy and confirmed the existing Resend dispatcher can
1900
+ deliver the new `booking.reminder` template without a new provider secret.
1901
+ - Evidence: deterministic reminder queue/replay, central worker repository
1902
+ validator, ORA health/syntax checks, and `git diff --check` pass. ORA
1903
+ production scheduler/Resend acceptance evidence remains a host release gate.
1904
+
1905
+ ## 2026-09-20 — Payment policy and balance slice
1906
+
1907
+ - Added provider-neutral service policies for `full`, `deposit`, `pay_later`,
1908
+ and `no_payment`, including normalized deposit amount and initial due amount.
1909
+ - Payment attempts now carry a purpose (`deposit`, `balance`, `full`, or
1910
+ `adjustment`). The runtime and PostgreSQL payment adapter aggregate captured
1911
+ attempts and refunds into `paidMinor`, `balanceDueMinor`, and payment status;
1912
+ they do not trust only the latest provider attempt.
1913
+ - The Booking manager catalogue form can configure the policy, the Payments
1914
+ screen can start a deposit or balance payment, and the public checkout sends
1915
+ only the amount due at that stage. Partial refunds project to the booking and
1916
+ queue the allowlisted `payment.refunded` Resend notification.
1917
+ - Fixed idempotent payment replay to return the original result before current
1918
+ balance validation, so a retry remains safe after the first capture.
1919
+ - Evidence: central `npm test`, runtime deposit projection, reference-host
1920
+ endpoint suite, PostgreSQL payment adapter validator, and `git diff --check`
1921
+ pass. ORA copies were synchronized and still require host migration, Stripe,
1922
+ Resend, and staging evidence.
1923
+
1924
+ ## 2026-09-20 — Schedule rule and install safety slices
1925
+
1926
+ - Fixed the Schedule screen's nested response handling and stopped its add-rule
1927
+ form from replacing unrelated schedule rows. New working hours, staff shifts,
1928
+ time-off records, and location closures now submit the full current snapshot
1929
+ with bounded owner/time validation.
1930
+ - Added the four-rule Schedule form to MaggieDash and the installed ORA
1931
+ projection. The UI validator now protects the preservation path and schedule
1932
+ rule markers.
1933
+ - Improved Astro installation: when a project already has the conventional
1934
+ `defineMiddleware((context, next) => {})` shape, `maggie booking install`
1935
+ inserts an idempotent rewrite block for Booking/login/register/reset without
1936
+ replacing host auth or redirects. Unsupported middleware is preserved and
1937
+ reported in install state; `maggie booking inspect` treats the unresolved
1938
+ integration as a failure.
1939
+ - Evidence: MaggieDash `npm test`, Booking UI validator, ORA Astro build,
1940
+ installer regression suite, JSON/task-board validation, and whitespace checks
1941
+ passed.
1942
+
1943
+ ## 2026-09-20 — Manager customer history slice
1944
+
1945
+ - Replaced the manager Customers collection-only surface with a searchable
1946
+ tenant-scoped directory and selected-customer detail panel.
1947
+ - The detail panel uses the existing safe customer-detail route to show contact
1948
+ data, recorded service consent, and appointment history with loading, empty,
1949
+ retry, and error states; it does not expose public bearer tokens or provider
1950
+ internals.
1951
+ - Added `CustomersView`, selected-customer route coverage, and appointment/
1952
+ consent markers to the UI regression validator. Synchronized the ORA host
1953
+ projection and confirmed `maggie booking inspect --project .` plus the ORA
1954
+ Astro build pass.
1955
+ - This is manager history, not a customer self-service history portal. The
1956
+ latter remains a separate roadmap item.
1957
+ ## 2026-09-20 — BK-054 editable service and treatment catalogue
1958
+
1959
+ - Added a dedicated Catalogue view with service rows, variant details, search,
1960
+ and an explicit Edit service action rather than routing catalogue data through
1961
+ the generic read-only collection table.
1962
+ - The configuration form now keeps the existing service and variant IDs while
1963
+ editing name, variant label, duration, price, currency, payment policy, and
1964
+ active/inactive status. The existing audited, idempotent catalogue endpoint
1965
+ remains the only write path.
1966
+ - Mirrored the UI in the ORA installed host and added a configuration regression
1967
+ proving that edits preserve IDs and can deactivate both service and variant.
1968
+ - Evidence: MaggieDash `npm run booking:ui:test`, `npm test`, ORA Astro build,
1969
+ task-board JSON validation, and `git diff --check` passed. Host staging data
1970
+ verification remains part of the existing BK-030/BK-031/BK-032 release gates.
1971
+
1972
+ ## 2026-09-21 — BK-055 editable staff and resource management
1973
+
1974
+ - Added dedicated Staff and Resources views with search, stable selection, edit
1975
+ actions, and bounded loading/empty/error states instead of exposing only the
1976
+ generic create form.
1977
+ - Staff edits preserve the profile ID while updating name, email, phone,
1978
+ location/service assignments, active state, and bookable state. Resource edits
1979
+ preserve the resource ID while updating name, type, location, capacity, and
1980
+ active state.
1981
+ - Reused the existing audited, idempotent `staff.json` and `resources.json`
1982
+ endpoints; no new persistence path was introduced. Mirrored the UI in ORA.
1983
+ - Evidence: MaggieDash `npm run booking:ui:test`,
1984
+ `npm run booking:configuration:test`, `npm test`, ORA Astro build, task-board
1985
+ validation, and `git diff --check` passed. Host staging verification remains
1986
+ part of BK-030/BK-031/BK-032.
1987
+
1988
+ ## 2026-09-21 — BK-056 editable schedule-rule management
1989
+
1990
+ - Replaced the schedule add-only surface with a searchable rule list covering
1991
+ working hours, staff shifts, time off, and location closures.
1992
+ - Existing rules can be selected and edited with their stable IDs; changing a
1993
+ rule writes the complete snapshot while removing only the selected row, so
1994
+ unrelated availability rules remain intact.
1995
+ - Added bounded validation for ordered working hours, interval dates, and staff/
1996
+ resource ownership inputs. Mirrored the schedule editor in ORA.
1997
+ - Evidence: MaggieDash `npm run booking:ui:test`, `npm test`, ORA Astro build,
1998
+ task-board validation, and `git diff --check` passed. Host staging
1999
+ verification remains part of BK-030/BK-031/BK-032.
2000
+
2001
+ ## 2026-09-21 — BK-057 live-configuration manager booking creation
2002
+
2003
+ - Replaced manual service/location ID fields in the manager New booking form
2004
+ with live catalogue, location, staff, and resource selectors.
2005
+ - The form now submits `staffId` or `resourceId`, matching the PostgreSQL
2006
+ repository's allocation requirement, and returns bounded feedback when no
2007
+ allocation is selected. Service selection also fills the configured price and
2008
+ currency instead of asking managers to copy minor units manually.
2009
+ - Mirrored the form in ORA and expanded the reference-host create fixture to
2010
+ include a staff allocation.
2011
+ - Evidence: MaggieDash UI/reference-host/full-suite validation, ORA Astro build,
2012
+ task-board validation, and `git diff --check` passed. Host staging
2013
+ verification remains part of BK-030/BK-031/BK-032.
2014
+
2015
+ ## 2026-09-21 — BK-058 first-run Booking setup checklist
2016
+
2017
+ - Added `maggie booking setup --project .` as a read-only onboarding checklist.
2018
+ It reports workspace/middleware installation, required environment-key
2019
+ presence, optional Stripe payment configuration, and the pending schema,
2020
+ first-owner, and Resend-worker steps without printing any secret values.
2021
+ - Fixed setup and `maggie booking inspect` to recognize the escaped path
2022
+ markers emitted by Astro TypeScript regex literals, so an existing merged
2023
+ middleware is not falsely reported as missing.
2024
+ - Evidence: `python3 -m unittest tools.tests.test_maggie_booking -v`, setup and
2025
+ inspect against the ORA host, and `git diff --check` passed. Schema/owner/
2026
+ worker and real Stripe delivery remain explicit host verification gates.
2027
+
2028
+ ## 2026-09-21 — BK-059 explicit one-command host bootstrap
2029
+
2030
+ - Added `maggie booking install --project . --confirm --bootstrap` for a
2031
+ reviewed new host. It installs the normal workspace/host scaffold, then
2032
+ runs only the installed `scripts/maggie-booking-schema.mjs --apply --confirm`
2033
+ with the host's existing environment.
2034
+ - The default install remains non-migrating; `--bootstrap` cannot be combined
2035
+ with `--dry-run` or `--diff`, and it still does not create an owner, configure
2036
+ Stripe, send email, or deploy.
2037
+ - Evidence: Booking Python CLI suite (10 tests), package prepack/entrypoint
2038
+ smoke, task-board validation, and `git diff --check` passed. Owner setup,
2039
+ Stripe webhook configuration, worker scheduling, and real host evidence
2040
+ remain explicit next steps.
2041
+
2042
+ ## 2026-09-21 — BK-060 token-bound customer self-service rescheduling
2043
+
2044
+ - Added `POST /api/maggie/booking/public/bookings/{id}/reschedule.json` to the
2045
+ public customer contract. It validates the sealed booking token, future
2046
+ timestamps, terminal booking states, tenant scope, allocation conflicts, and
2047
+ idempotent replay before delegating to the same transactional manager
2048
+ reschedule command.
2049
+ - Added safe `serviceVariantId` and `locationId` fields to the public booking
2050
+ DTO so the payment-return page can load available times. The customer page
2051
+ now lets a customer choose another date/time and queues the existing
2052
+ `booking.rescheduled` Resend notification through both the generic Astro
2053
+ adapter and ORA's host adapter.
2054
+ - Evidence: MaggieDash customer-flow, reference-host, PostgreSQL-adapter, UI,
2055
+ and full-suite gates passed. ORA source/build synchronization and real host
2056
+ token/email evidence remain deployment gates.
2057
+
2058
+ ## 2026-09-21 — BK-061 Resend customer-manage links
2059
+
2060
+ - Split public customer tokens by purpose. Checkout now creates a short-lived
2061
+ payment-return token plus a separately stored 30-day `manage` token; both
2062
+ remain sealed at rest and only their hashes are searchable.
2063
+ - Updated the idempotent schema migration and schema validator with the token
2064
+ purpose column and manage-token lookup index. The Astro and ORA Resend
2065
+ workers reuse an existing manage token or create one for a manager-created
2066
+ booking, then include only the safe manage URL in the email HTML.
2067
+ - Evidence: MaggieDash PostgreSQL customer-adapter validator, full `npm test`,
2068
+ schema/static validators, worker syntax checks, ORA customer-adapter
2069
+ validator, and the prior ORA Astro build passed. Real database migration and
2070
+ Resend delivery remain BK-030/BK-031/BK-032 deployment evidence.
2071
+
2072
+ ## 2026-09-21 — BK-062 tenant-scoped waitlist
2073
+
2074
+ - Added `maggiedash_booking_waitlist_entries` with tenant, service, location,
2075
+ optional staff, preferred date/time, priority, status, idempotency, and
2076
+ notification-expiry fields. Waitlist writes use the same PostgreSQL scope,
2077
+ audit, event, and idempotency boundaries as bookings.
2078
+ - Added the public `POST /api/maggie/booking/public/waitlist.json` join route
2079
+ and a manager queue with status filtering plus notify, convert, cancel, and
2080
+ priority actions. Staff sessions remain limited to their linked staff scope.
2081
+ - Added the `booking.waitlist.available` notification intent, Astro/ORA host
2082
+ wrappers, and worker dispatch through the existing Resend outbox. The email
2083
+ points customers back to the booking page; it does not promise or reserve a
2084
+ slot.
2085
+ - Evidence: MaggieDash full suite and customer-flow/schema/UI/route/contract
2086
+ validators passed; ORA source validators and Astro build passed. A fresh
2087
+ browser capture, real schema migration, scheduled worker run, and actual
2088
+ Resend delivery remain host release evidence.
2089
+
2090
+ ## 2026-09-21 — BK-063 transactional waitlist conversion
2091
+
2092
+ - Added an additive `converted_booking_id` column, foreign key, and index to
2093
+ the waitlist schema. A conversion now locks the queue entry and creates its
2094
+ booking, segment, allocation, payment-policy projection, event, and audit
2095
+ record before marking the entry converted.
2096
+ - Added server-side validation for concrete times, staff/resource eligibility,
2097
+ tenant scope, overlap conflicts, and idempotent replay. The manager Waitlist
2098
+ screen now selects a live staff/resource allocation and creates the booking;
2099
+ confirmed results use the normal host Resend confirmation path.
2100
+ - Evidence: MaggieDash `npm test`, core repository conversion replay test,
2101
+ reference-host conversion assertion, ORA route/contract/schema/UI/host
2102
+ validators, ORA Astro build, and whitespace checks passed. Real migration,
2103
+ browser capture, scheduled worker, Stripe/payment-policy staging, and Resend
2104
+ delivery remain host release evidence.
2105
+
2106
+ ## 2026-09-21 — BK-064 first-run payment readiness panel
2107
+
2108
+ - Added a manager Overview setup checklist to the central Booking workspace and
2109
+ ORA mirror. It reads the existing payment-health response, shows the Stripe
2110
+ account status and test/live mode, and generates the current host webhook URL.
2111
+ - Added a browser-safe copy action and explicit guidance to configure
2112
+ `STRIPE_SECRET_KEY` and `STRIPE_WEBHOOK_SECRET` in the deployment secret
2113
+ store. No provider secret is persisted or rendered by the UI.
2114
+ - Evidence: MaggieDash `npm test`, Booking UI/customer UI/host validators, ORA
2115
+ `npm run build`, and `git diff --check` passed. ORA's read-only schema check
2116
+ still reports `needs-migration` with core present and Booking/access tables
2117
+ absent; no migration was applied.
2118
+
2119
+ ## 2026-09-21 — BK-065 strict setup-secret validation
2120
+
2121
+ - Updated `maggie booking setup` to validate the public token secret length in
2122
+ memory and report a short value as `invalid`, rather than treating presence
2123
+ as readiness. Stripe now reports `degraded` when only one of its two required
2124
+ keys is configured.
2125
+ - Added regression coverage that confirms actionable next steps while keeping
2126
+ database URLs, Resend keys, Stripe keys, and token values out of output.
2127
+ - Evidence: 11 Python CLI tests, task-board validation, and whitespace checks
2128
+ passed.
2129
+
2130
+ ## 2026-09-21 — BK-066 installed workspace validator fix
2131
+
2132
+ - Fixed the Booking UI validator in MaggieDash and the ORA installed mirror to
2133
+ read `booking/src` from the source package and fall back to the installed
2134
+ sibling `_maggie/booking` workspace on a host project.
2135
+ - Added an explicit bounded error when neither workspace exists. This removes
2136
+ the misleading `ENOENT` path failure after installation.
2137
+ - Evidence: MaggieDash `npm test` and `booking:ui:test`, ORA UI/customer UI
2138
+ validators, and `git diff --check` passed.
2139
+
2140
+ ## 2026-09-21 — BK-085 cancellation and refund policy boundary
2141
+
2142
+ - Added a versioned, normalized catalogue policy with free, cutoff-window, and
2143
+ non-refundable modes, plus refund outcome and no-show fee fields.
2144
+ - Copied the policy into manager-created, customer-created, and waitlist-
2145
+ converted bookings so later catalogue edits do not rewrite historical
2146
+ booking intent.
2147
+ - Enforced the configured cutoff in PostgreSQL and reference customer
2148
+ cancellation flows. Rejections return the policy and a bounded reason for
2149
+ the customer UI; provider refund execution remains an explicit Stripe/host
2150
+ operation.
2151
+ - Added the installed manager controls and additive
2152
+ `cancellation_policy_json` schema migration to MaggieDash and the ORA mirror.
2153
+ - Evidence: MaggieDash `npm test`, ORA `npm run contract:check`, ORA Astro
2154
+ build, policy/customer/schema/UI validators, and `git diff --check` passed.
2155
+ The ORA schema was not applied; its existing read-only preflight still
2156
+ reports `needs-migration`.
2157
+
2158
+ ## 2026-09-21 — BK-086 calendar range correctness
2159
+
2160
+ - Fixed the manager Calendar Week mode so it no longer executes the Day query.
2161
+ PostgreSQL now uses a venue-timezone, half-open day/week range and keeps the
2162
+ staff-session filter bound to the same query.
2163
+ - Updated the reference host to filter fixture bookings by the requested day
2164
+ or Monday–Sunday week, including cross-day appointments at the boundaries.
2165
+ - Updated the installed calendar period label and week agenda rows so the UI
2166
+ reflects the returned range instead of showing only the selected date.
2167
+ - Evidence: MaggieDash `npm test`, central and ORA reference-host/repository
2168
+ validators, ORA `npm run contract:check`, ORA Astro build, and
2169
+ `git diff --check` passed. Existing ORA build output retained two unrelated
2170
+ hints and no errors or warnings.
2171
+
2172
+ ## 2026-09-21 — BK-087 cancellation settlement and refund execution
2173
+
2174
+ - Added a provider-neutral cancellation settlement planner that allocates full
2175
+ or deposit refunds across captured payment attempts after already-recorded
2176
+ refunds, and reports a bounded no-show fee without charging it automatically.
2177
+ - Added the PostgreSQL settlement seam. The booking lifecycle is committed
2178
+ first; provider refunds then run with per-booking/payment-attempt idempotency.
2179
+ Provider errors return `manual_required`, so an outage cannot resurrect a
2180
+ cancelled booking or produce a false success response.
2181
+ - Customer cancellation responses now include redacted settlement status. The
2182
+ generic Astro host and ORA host queue `payment.refunded` through the existing
2183
+ tenant-scoped Resend outbox only for accepted/pending refund items, followed
2184
+ by the normal cancellation email.
2185
+ - Closed the generic-host Resend parity gap: the Astro worker now has a
2186
+ dedicated `payment.refunded` subject and a 15-second fetch timeout, matching
2187
+ the ORA worker. The Astro bootstrap validator locks both markers into the
2188
+ installable source.
2189
+ - Evidence: MaggieDash `npm test`, cancellation allocation/customer-adapter
2190
+ regressions, central and ORA syntax checks, and the installed host mirror
2191
+ synchronization passed. ORA contract/build and `git diff --check` remain in
2192
+ the final verification pass below; live Stripe/Resend delivery is still a
2193
+ host release gate.
2194
+
2195
+ ## 2026-09-21 — BK-088 no-show fee review boundary
2196
+
2197
+ - Extended the PostgreSQL cancellation settlement seam to return a redacted
2198
+ `review_required` result for manager no-show transitions, including the
2199
+ policy-derived `noShowFeeMinor`.
2200
+ - No-show transitions return zero refundable amount and zero refund items even
2201
+ when the booking has captured payment; the injected refund provider is not
2202
+ called and no Resend refund email is queued.
2203
+ - Added the reference-host regression and manager detail notice stating that
2204
+ no automatic charge or refund was made. The source package and ORA mirror
2205
+ carry the same behavior.
2206
+ - Evidence: MaggieDash `npm test`, central/ORA no-show and reference-host
2207
+ validators, esbuild, ORA `contract:check`/build, Astro bootstrap validation,
2208
+ and `git diff --check` passed. The ORA build retains two pre-existing hints.
2209
+
2210
+ ## 2026-09-21 — BK-089 Booking access install contract
2211
+
2212
+ - Added `booking-access-v1.json` to the MaggieDash distribution and the
2213
+ ai-cmo-skills bundled contracts. It freezes the administrator-only access
2214
+ boundary, roles, granular permissions, password minimum, Resend invitation,
2215
+ audit actions, and tenant/disabled-account policy.
2216
+ - Added the generic Astro access route, schema, Team access UI, and manifest
2217
+ validator to the Booking install gate. Added `maggie booking
2218
+ access-contract` so a host can validate this boundary without connecting to
2219
+ PostgreSQL or a provider.
2220
+ - Evidence: `npm run booking:access:test`, MaggieDash `npm test`, packaged
2221
+ contract checks, and `git diff --check` are the required gates. Real ORA
2222
+ migration and authenticated staff-login evidence remain production gates.
2223
+
2224
+ ## 2026-09-21 — BK-090 reference-host Team access CRUD
2225
+
2226
+ - Added an in-memory, secret-free Team access fixture to the reference host.
2227
+ Owner sessions can read access, create an invited staff account, update
2228
+ permissions, and revoke access; staff sessions receive 403.
2229
+ - Added idempotent access mutation handling and audit events while keeping the
2230
+ fixture independent of PostgreSQL, Stripe, and Resend network calls.
2231
+ - Evidence: reference-host validator and full MaggieDash `npm test` passed.
2232
+
2233
+ ## 2026-09-21 — BK-091 dependency-complete Booking installation
2234
+
2235
+ - Added `maggie booking install --confirm --install-dependencies` for fresh
2236
+ Astro hosts. The mode preserves existing dependency versions, selects the
2237
+ package manager already declared by the project, and installs only missing
2238
+ Booking runtime packages.
2239
+ - Added failure-safe mutation guards so dependency installation cannot run from
2240
+ `--dry-run` or `--diff`, and a no-op project does not invoke a package
2241
+ manager.
2242
+ - Added adapter-aware dependency selection and a blank-host Node SSR config;
2243
+ existing Astro deployment adapters remain untouched.
2244
+ - Evidence: 22 Python Booking CLI tests, a fresh public-source dependency
2245
+ install, public-source `maggie booking inspect`, fresh `astro build`, central
2246
+ host validator, MaggieDash `npm test`, packaged task validation, and
2247
+ `git diff --check` passed.
2248
+
2249
+ ## 2026-09-21 — BK-093 complete Booking defaults in Settings
2250
+
2251
+ - Extended the manager Settings screen in MaggieDash and the ORA installed
2252
+ workspace to load and save the existing tenant `currency`,
2253
+ `bookingEnabled`, and `capturePolicy` fields alongside venue timezone.
2254
+ - Added explicit controls for accepting new bookings and automatic/manual
2255
+ payment capture policy. Disabling booking writes keeps history and reads
2256
+ available while the existing host boundary rejects new holds/bookings.
2257
+ - Kept Stripe and Resend credentials outside the dashboard and browser bundle;
2258
+ this change reuses the existing audited, idempotent settings endpoint.
2259
+ - Evidence: central/ORA Booking UI validators, central/ORA reference-host
2260
+ settings regressions, MaggieDash `npm test`, ORA `npm run contract:check`,
2261
+ ORA Astro build, and `git diff --check` passed.
2262
+
2263
+ ## 2026-09-21 — Reviewed one-command fresh-host setup
2264
+
2265
+ - Added `maggie booking install --confirm --ready` as the explicit convenience
2266
+ path for a new Astro host. It combines missing dependency installation,
2267
+ `BOOKING_TOKEN_SECRET` provisioning, and the idempotent Booking schema apply.
2268
+ - Kept the safety boundary explicit: `--ready` still requires `--confirm`, is
2269
+ incompatible with `--dry-run`/`--diff`, does not create the owner, configure
2270
+ Stripe, send Resend mail, enable a scheduler, or deploy, and can only write a
2271
+ reviewable scheduler artifact when paired with `--schedule`.
2272
+ - Added an offline regression covering the combined path and synchronized the
2273
+ skill, repository README, package README, and Booking CLI documentation.
2274
+ - Updated the read-only `maggie booking setup` checklist to recommend
2275
+ `--ready` for a fresh host with missing dependencies, while retaining the
2276
+ narrower `--bootstrap` instruction for an already-installed host.
2277
+ - Evidence: 32 Booking/MaggieDash Python tests, contract/access/email-template
2278
+ checks, `validate_skills.py`, packaged CLI validation against ORA, and
2279
+ `git diff --check` passed.
2280
+
2281
+ ## 2026-09-21 — Disposable PostgreSQL worker and recovery evidence
2282
+
2283
+ - Ran the real PostgreSQL core-repository integration against a uniquely named
2284
+ disposable database. It passed booking creation/replay, lifecycle and
2285
+ reschedule, catalogue/staff/resource/schedule/settings persistence, payment
2286
+ adapter behavior, package-credit restoration, public customer checkout/cancel
2287
+ recovery, token sealing, and cleanup.
2288
+ - Ran the real PostgreSQL worker integration against the same disposable
2289
+ schema. It passed tenant advisory locking, transaction writes, payment event
2290
+ acknowledgement, notification dispatch/persistence, event persistence, and
2291
+ availability snapshot generation.
2292
+ - Ran the PostgreSQL 14 custom-format backup/restore rehearsal into a separate
2293
+ empty disposable database; tool/server version matching, empty-target
2294
+ preflight, restore, and row-count parity passed. Both temporary databases
2295
+ were removed by the test trap.
2296
+ - This strengthens BK-030's disposable-database evidence but does not satisfy
2297
+ the remaining ORA production requirements: approved migration, host alert
2298
+ routing, production backup/recovery rehearsal, real runtime evidence, or
2299
+ authenticated browser evidence.
2300
+
2301
+ ## 2026-09-21 — ORA worker deployment-secret parity
2302
+
2303
+ - Updated the ORA Booking worker to merge the local `.env` fallback with
2304
+ `process.env`, with deployment-injected values taking precedence. The
2305
+ standalone Resend worker now behaves like the installable MaggieDash Astro
2306
+ worker under systemd, VPS secret stores, and CI environments.
2307
+ - No secret values are logged or copied; the change only fixes configuration
2308
+ resolution. ORA contract:check, Astro build, worker syntax, and whitespace
2309
+ checks remain required evidence.
2310
+
2311
+ ## 2026-09-21 — Fail-closed first-owner registration
2312
+
2313
+ - Added core/Booking/access table preflight to the generic Astro registration
2314
+ page and registration API, matching the existing login guard.
2315
+ - ORA now shows setup-required when only the core schema exists, and the API
2316
+ returns a bounded 503 before creating a project, user, membership, or owner
2317
+ audit row. This prevents an incomplete migration from creating a misleading
2318
+ first-owner account.
2319
+ - Added central host-bootstrap and ORA contract markers for the registration
2320
+ guard. Runtime verification against the current unmigrated ORA dev database
2321
+ returned HTTP 200 with the setup-required state and no owner form.
2322
+ - Posted a valid-format disposable registration request to the unmigrated ORA
2323
+ runtime; the API returned HTTP 503 with the bounded setup-incomplete error,
2324
+ confirming that the write guard also runs server-side before any owner or
2325
+ project row can be created.
2326
+ - Evidence: MaggieDash npm test, Astro host validator, ORA
2327
+ contract:check, ORA Astro build (193 files, 0 errors/warnings/hints),
2328
+ runtime registration checks, and git diff --check passed.
2329
+
2330
+ ## 2026-09-21 — Remaining production release gates
2331
+
2332
+ - Local implementation and disposable PostgreSQL evidence are complete for the
2333
+ Booking core, worker repository, backup/restore rehearsal, access control,
2334
+ Stripe contracts, Resend templates/outbox, and installed ORA host.
2335
+ - The release gate is intentionally still blocked by evidence rather than a
2336
+ missing local feature: ORA production schema migration/rollback approval,
2337
+ real worker operations and alert routing, authenticated runtime evidence,
2338
+ authenticated Playwright browser evidence, and board tasks BK-030/BK-031/BK-032.
2339
+ - The gate itself is read-only and does not migrate the database, create a
2340
+ booking, capture a payment, send email, or deploy. These production actions
2341
+ require an explicit rollout window, backup, credentials, and operator
2342
+ approval.
2343
+ - Release distribution is also still open: the local CLI candidate is
2344
+ `@topy-ai/maggie` 0.7.39 while the npm registry is 0.7.38, and the current
2345
+ MaggieDash Booking changes are uncommitted in the working tree. A fresh
2346
+ public-source install therefore must not be described as consuming this
2347
+ latest candidate until the MaggieDash source and npm package are released.
2348
+
2349
+ ## 2026-09-21 — Align ORA migration secret resolution
2350
+
2351
+ - Updated the installed ORA schema command to use `.env` only as a local
2352
+ fallback and let deployment-injected `process.env` values take precedence,
2353
+ matching the Booking worker and generic MaggieDash Astro host.
2354
+ - Added an ORA contract check so a future install cannot silently regress to a
2355
+ migration command that ignores systemd, CI, or secret-store credentials.
2356
+ - This is an install/deployment hardening change; it does not apply the ORA
2357
+ production migration or expose any secret values.
2358
+
2359
+ ## 2026-09-21 — Connect the ORA public booking entry point
2360
+
2361
+ - Kept the existing `/book` email-request flow as a safe fallback, but added a
2362
+ schema-aware online-booking entry point once the Booking core, location, and
2363
+ access tables are ready.
2364
+ - The new link preserves legacy `?service=` hints and the installed customer
2365
+ UI now resolves those hints against tenant service/variant IDs, slugs, names,
2366
+ and legacy IDs before selecting the first treatment fallback.
2367
+ - Evidence: MaggieDash manager/customer UI and full npm validators, ORA
2368
+ `contract:check`, ORA Astro build (193 files, 0 errors/warnings/hints),
2369
+ runtime check confirming the online link stays hidden on the current
2370
+ unmigrated database, and `git diff --check` passed.
2371
+
2372
+ ## 2026-09-21 — Align public booking copy and privacy disclosure
2373
+
2374
+ - Updated ORA `/book`, `llms.txt`, and Privacy copy so the legacy email request
2375
+ path and the optional online Stripe/Resend path are described separately.
2376
+ - The copy now avoids claiming that the site never charges online once the
2377
+ Booking schema is enabled, while explicitly stating that card numbers/CVC
2378
+ remain outside the host database.
2379
+ - Evidence: ORA contract check, Astro build (193 files, 0 errors/warnings/hints),
2380
+ and whitespace validation passed.
2381
+
2382
+ ## 2026-09-21 — Public multi-location booking selection
2383
+
2384
+ - Closed a real multi-location gap: the Booking manager and PostgreSQL schema
2385
+ already supported multiple locations, but the public customer flow silently
2386
+ used only the first active location.
2387
+ - Public catalogue DTOs now expose only safe fields for every active,
2388
+ online-bookable location, while retaining the legacy first `locationId` for
2389
+ older hosts. The customer page renders a location selector and sends the
2390
+ selected location to availability, waitlist, hold, checkout, and reschedule
2391
+ flows.
2392
+ - PostgreSQL availability now validates the selected tenant location, uses its
2393
+ timezone, and filters conflicts by location. Central MaggieDash and the ORA
2394
+ installed mirror are synchronized.
2395
+ - Evidence: MaggieDash full `npm test`, central/ORA customer-flow and customer-
2396
+ UI validators, ORA `contract:check`, ORA Astro check/build (193 files,
2397
+ 0 errors/warnings/hints), and `git diff --check` passed. No production
2398
+ database was changed.
2399
+
2400
+ ## 2026-09-21 — BK-101 complete server-enforced Booking capability permissions
2401
+
2402
+ - Found a real access-control drift: the route handler already mapped
2403
+ `locations`, `waitlist`, and `notifications` capabilities, but the admin
2404
+ permission registry and access contract did not expose them. Staff customer
2405
+ and notification reads were also hard-blocked even when an administrator
2406
+ explicitly granted the capability.
2407
+ - Added the complete registry to the generic Astro host, ORA mirror,
2408
+ reference host, detailed/compact contracts, and CLI contract validation.
2409
+ Missing `permissions_json` rows now receive safe role defaults instead of
2410
+ implicitly receiving every read route. Explicit staff grants are honored by
2411
+ the server, while staff lifecycle mutations remain limited to approved
2412
+ check-in/in-progress/completed/no-show transitions.
2413
+ - Added regression coverage for scoped staff customer, location, waitlist,
2414
+ and notification reads plus legacy default-denial behavior. Updated the
2415
+ host adapter, ORA integration, execution board, and task docs.
2416
+
2417
+ ## 2026-09-21 — BK-102 persist provider customer identity for Stripe
2418
+
2419
+ - Fixed a real payment-boundary defect: Booking customers use tenant-local
2420
+ UUIDs, but the previous Stripe adapter could pass those values directly as
2421
+ Stripe `cus_*` references. Real Checkout, PaymentIntent, package purchase,
2422
+ and SetupIntent requests could therefore fail even after Stripe connection
2423
+ verification succeeded.
2424
+ - Added the tenant-scoped `provider_customer_ref` column and partial unique
2425
+ index. The Astro host now resolves the local customer, creates or reuses a
2426
+ Stripe Customer with a stable idempotency key, persists only the provider
2427
+ reference, and passes that provider ID to Stripe. Dashboard credentials and
2428
+ provider references never enter public DTOs.
2429
+ - Synchronized the central MaggieDash adapter/schema and ORA mirror, and
2430
+ extended both Stripe adapter validators to assert local-to-provider mapping.
2431
+ - Evidence passed: central Stripe adapter validator and full `npm test`, ORA
2432
+ Stripe adapter validator, ORA `contract:check`, ORA Astro check/build (193
2433
+ files, 0 errors/warnings/hints), and whitespace validation. No production
2434
+ database migration was applied.