@open-mercato/cli 0.10.1-develop.7736.1.88e07906bf → 0.10.1-develop.7748.1.d745ba61aa
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.
- package/.turbo/turbo-build.log +3 -1
- package/dist/agentic/guides/module-facts.json +635 -173
- package/dist/agentic/guides/module-facts.v2.json +635 -173
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/attachments/di-registrations-rich.md +6 -6
- package/dist/agentic/guides/modules/attachments/di-service-tokens.md +5 -5
- package/dist/agentic/guides/modules/attachments/exact-override-targets.md +9 -7
- package/dist/agentic/guides/modules/attachments/generator-plugins.md +11 -0
- package/dist/agentic/guides/modules/attachments/index.md +4 -2
- package/dist/agentic/guides/modules/attachments/setup.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
- package/dist/agentic/guides/modules/cart/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_autopay/acl-features.md +12 -0
- package/dist/agentic/guides/modules/gateway_autopay/cli-commands.md +12 -0
- package/dist/agentic/guides/modules/gateway_autopay/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/gateway_autopay/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/gateway_autopay/exact-override-targets.md +17 -0
- package/dist/agentic/guides/modules/gateway_autopay/index.md +19 -0
- package/dist/agentic/guides/modules/gateway_autopay/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/gateway_autopay/setup.md +11 -0
- package/dist/agentic/guides/modules/gateway_autopay/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/promotions/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +78 -72
- package/dist/agentic/guides/upstream/manifest.json +2 -2
- package/package.json +7 -7
- package/src/lib/generators/__tests__/attachment-access.test.ts +70 -0
|
@@ -310,11 +310,11 @@ Files in `apps/mercato/.mercato/generated/` are produced by the CLI generators.
|
|
|
310
310
|
|
|
311
311
|
`.ai/specs/2026-05-21-email-integration-foundation.md` adds optional per-user scoping to integration credentials so two users on the same tenant can connect their own mailbox (Gmail / IMAP) without sharing one row. **All changes are additive** and pass the contract-surface checks above:
|
|
312
312
|
|
|
313
|
-
|
|
|
313
|
+
|Surface|Change|Classification|
|
|
314
314
|
|---|---|---|
|
|
315
|
-
|
|
|
316
|
-
|
|
|
317
|
-
|
|
315
|
+
|Type interface (`IntegrationScope`)|New **optional** field `userId?: string \| null`|✓ ADDITIVE (Type interface, optional field)|
|
|
316
|
+
|Database schema|New nullable column `integration_credentials.user_id uuid` via additive migration `Migration20260526154136`, plus partial unique index `integration_credentials_user_lookup_idx` on `(integration_id, organization_id, tenant_id, user_id)` `WHERE user_id IS NOT NULL AND deleted_at IS NULL`|✓ ADDITIVE (NULL default; the partial index leaves existing tenant-wide rows untouched)|
|
|
317
|
+
|`createCredentialsService` API|`getRaw` / `resolve` / `save` / `saveField` signatures unchanged; when `scope.userId` is falsy the lookup filter pins `user_id = NULL`, reproducing the prior tenant-wide behaviour exactly|✓ Behaviour-preserving for existing callers|
|
|
318
318
|
|
|
319
319
|
**Migration path for existing tenants**: no action required. Existing integrations keep their single `user_id IS NULL` row and resolve exactly as before; only callers that pass `scope.userId` (the new per-user channels) read or write user-scoped rows.
|
|
320
320
|
|
|
@@ -326,17 +326,17 @@ Files in `apps/mercato/.mercato/generated/` are produced by the CLI generators.
|
|
|
326
326
|
|
|
327
327
|
> **Update (2026-06-02):** the Microsoft Graph push surfaces (the two `/webhooks/microsoft/*` routes, the `…-microsoft-delta-sync` / `…-microsoft-renew-subscriptions` queues, and `OM_MICROSOFT_WEBHOOK_BASE_URL` / `OM_PUSH_RENEWAL_MICROSOFT_LEAD_HOURS`) were removed together with the `@open-mercato/channel-microsoft` provider — they never shipped in a release, so the removal is not a breaking change. The rows below reflect the Gmail-only surfaces that remain. The `client_state_encrypted` column — proposed solely for Microsoft Graph's anti-tampering nonce — was dropped from scope together with the provider before this branch's migrations were finalized; it appears in no committed migration or snapshot, so there is no schema change to reconcile.
|
|
328
328
|
|
|
329
|
-
|
|
|
329
|
+
|Surface|Change|Classification|
|
|
330
330
|
|---|---|---|
|
|
331
|
-
|
|
|
332
|
-
|
|
|
333
|
-
|
|
|
334
|
-
|
|
|
335
|
-
|
|
|
336
|
-
|
|
|
337
|
-
|
|
|
338
|
-
|
|
|
339
|
-
|
|
|
331
|
+
|Adapter type interface (`ChannelAdapter`)|Three new **optional** methods: `registerPush?`, `unregisterPush?`, `applyPushNotification?`|✓ ADDITIVE (Type interface, optional fields)|
|
|
332
|
+
|Adapter input/output types|New exported types: `PushRegistration`, `RegisterPushInput`, `UnregisterPushInput`, `ApplyPushNotificationInput`|✓ ADDITIVE (new types, no rename)|
|
|
333
|
+
|Event IDs|Four new events: `communication_channels.push.{registered,failed,renewed,deactivated}`|✓ ADDITIVE (new event IDs)|
|
|
334
|
+
|ACL feature IDs|One new feature: `communication_channels.channel.push.manage`|✓ ADDITIVE (new feature ID)|
|
|
335
|
+
|API routes|Two new routes: `/webhooks/gmail`, `/channels/[id]/push/register`|✓ ADDITIVE (new routes)|
|
|
336
|
+
|Database schema|No change. The `client_state_encrypted` column proposed for Microsoft Graph was removed from scope before the migrations were finalized — it is absent from every committed migration and the snapshot.|✓ No net schema change|
|
|
337
|
+
|Queue names|Two new queues: `…-gmail-history-sync`, `…-gmail-renew-watch`|✓ ADDITIVE|
|
|
338
|
+
|Env vars|New optional: `OM_GMAIL_PUBSUB_TOPIC`, `OM_GMAIL_PUBSUB_AUDIENCE`, `OM_GMAIL_PUBSUB_SERVICE_ACCOUNT_EMAIL`, `OM_PUSH_RENEWAL_GMAIL_LEAD_HOURS`|✓ ADDITIVE|
|
|
339
|
+
|Polling cadence|`pollIntervalSeconds` flips 60 → 1800 only when `pushStatus='active'` is persisted. Non-push channels unchanged.|✓ Behavior-preserving for existing channels|
|
|
340
340
|
|
|
341
341
|
**Migration path for existing tenants**: no action required. Push is opt-in per channel — until an operator explicitly registers (via connect flow or `POST /push/register`), Gmail channels keep polling on the Spec B baseline. The new ACL feature `communication_channels.channel.push.manage` must be granted via `yarn mercato auth sync-role-acls` post-deploy for the "Re-register push" button to appear.
|
|
342
342
|
|
|
@@ -346,16 +346,16 @@ Files in `apps/mercato/.mercato/generated/` are produced by the CLI generators.
|
|
|
346
346
|
|
|
347
347
|
`.ai/specs/2026-08-06-command-interceptor-http-status.md` lets a command interceptor's deliberate rejection carry an HTTP status and body, so a business block surfaces as (for example) `422` instead of a generic `500`. **All changes are additive** and pass the contract-surface checks above:
|
|
348
348
|
|
|
349
|
-
|
|
|
349
|
+
|Surface|Change|Classification|
|
|
350
350
|
|---|---|---|
|
|
351
|
-
|
|
|
352
|
-
|
|
|
353
|
-
|
|
|
354
|
-
|
|
|
355
|
-
|
|
|
356
|
-
|
|
|
357
|
-
|
|
|
358
|
-
|
|
|
351
|
+
|Type interface (`CommandInterceptorBeforeResult`)|Two new **optional** fields: `status?: number`, `body?: Record<string, unknown>`|✓ ADDITIVE (Type interface, optional fields)|
|
|
352
|
+
|Function signature (`CommandInterceptorError` constructor)|New **optional** second parameter `options?: { status?, body?, cause? }`|✓ ADDITIVE (optional parameter appended; every `new CommandInterceptorError(message)` call site compiles and behaves identically)|
|
|
353
|
+
|Function return types (`runCommandInterceptorsBefore`, `runCommandInterceptorsBeforeUndo`)|Returned `error` widens from `{ message: string }` to `{ message: string; status?: number; body?: Record<string, unknown> }`|✓ ADDITIVE (a widened return type is safe for readers; callers reading `.message` are unaffected)|
|
|
354
|
+
|Import path / exports (`@open-mercato/shared/lib/commands`)|New exports: `isCommandInterceptorError`, `getCommandInterceptorHttpRejection`, `CommandInterceptorErrorOptions`, `CommandInterceptorHttpRejection`. `CommandInterceptorError` keeps its existing export|✓ ADDITIVE (new exports, nothing removed or renamed)|
|
|
355
|
+
|HTTP response shapes (`makeCrudRoute` handlers, `POST /api/audit_logs/audit-logs/actions/undo`) — the two transports that shipped with the original spec|A rejection **that sets a status** answers with it; a rejection that sets none keeps the byte-identical generic `500` (CRUD) / `400 Undo failed` (undo)|✓ Behaviour-preserving for existing interceptors (regression-tested in `crud-factory.test.ts` and `undo.route.test.ts`)|
|
|
356
|
+
|HTTP response shapes (direct `commandBus.execute` routes) — the transport rollout in [#5181](https://github.com/open-mercato/open-mercato/pull/5181) (issue [#5097](https://github.com/open-mercato/open-mercato/issues/5097))|The same mapping now reaches every first-party transport that owns its `try/catch`: 80 branches across 67 `packages/core` route files, one inline branch in `packages/enterprise/.../security/api/profile/password`, one inline branch in `packages/channel-discord/.../api/channels/[id]/ai-auto-reply`, and six module-level error mappers (`handleCheckoutRouteError`, `handleDocumentsRouteError`, `mapSudoError`, `mapMfaError`, `mapEnforcementError`, `mapSecurityUsersError`) covering 14 further bus-calling routes in `checkout`, `enterprise`-security and `documents`. A rejection that sets **no** status keeps each route's byte-identical historical answer, as do `CrudHttpError`, `ZodError` and optimistic-lock conflicts|✓ Behaviour-preserving for existing interceptors (pinned per response shape by behavioural tests in each affected package, and held against regression by the static guard `packages/core/src/__tests__/command-interceptor-http-coverage.test.ts`)|
|
|
357
|
+
|HTTP response shapes — deliberately **not** covered|17 routes call the bus where no `catch` can receive the rejection (tracked in [#5435](https://github.com/open-mercato/open-mercato/issues/5435)), and the two `eudr` batch routes (`plots/import`, `product-mappings/suggestions/apply`) keep their published `HTTP 200` + `failed[]` contract because every bus call there sits behind a per-item `catch`|✓ No change (both exemption lists are asserted in both directions by the static guard, so neither can rot silently)|
|
|
358
|
+
|Database schema, event IDs, ACL features, DI names, CLI commands|No change|✓ n/a|
|
|
359
359
|
|
|
360
360
|
**Migration path for existing modules**: no action required. The capability is opt-in per rejection — an interceptor that never sets `status` produces exactly the responses it produced before. Interceptors that want a deliberate status add `status` (and optionally `body`) to the `{ ok: false, message }` verdict they already return. First-party transports that call `commandBus.execute` inside their own `try/catch` **now do** honour the contract as of [#5181](https://github.com/open-mercato/open-mercato/pull/5181): every such route consults `getCommandInterceptorHttpRejection(err)` — directly, or through the module-level error mapper it already delegates to — immediately after its `isCrudHttpError` branch, or first in the `catch` where there is none, and the static coverage guard fails when a new bus-calling route ships without it. Third-party transports honour the same contract in the same two lines via `getCommandInterceptorHttpRejection(err)`, which validates the status is an integer in 400-599 before returning it.
|
|
361
361
|
|
|
@@ -367,13 +367,13 @@ API dispatch and API-interceptor selection now share the same matched-route iden
|
|
|
367
367
|
This closes a policy bypass where a mixed-case or percent-encoded spelling dispatched
|
|
368
368
|
to a handler but did not select its exact `before` interceptor.
|
|
369
369
|
|
|
370
|
-
|
|
|
370
|
+
|Surface|Change|Classification|
|
|
371
371
|
|---|---|---|
|
|
372
|
-
|
|
|
373
|
-
|
|
|
374
|
-
|
|
|
375
|
-
|
|
|
376
|
-
|
|
|
372
|
+
|Function signature (`findApiRouteManifestMatch`)|New optional fourth parameter `request?: Request`; existing three-argument callers keep the same return value and matching behavior|✓ ADDITIVE (optional parameter appended)|
|
|
373
|
+
|API route URLs and handler context|No route is added, removed, or renamed; handler `params` and request query semantics are unchanged|✓ No contract change|
|
|
374
|
+
|Interceptor selection|Static segments use the matched manifest spelling, while matched dynamic/catch-all values stay concrete. Alternate spellings that already reached a route now run the same exact/prefix interceptors as its normal spelling; malformed percent encoding reaches no handler|⚠️ Intentional security narrowing only (previous policy-bypass requests are denied or intercepted)|
|
|
375
|
+
|Request cloning/reconstruction|Dispatcher identity survives `Request.clone()` and `new Request(request.url, request)`. Unknown, forged, or evicted internal continuity metadata fails closed; unbound direct handlers retain legacy URL-derived matching|✓ Behavior-preserving for valid dispatches; intentional security narrowing for forged metadata|
|
|
376
|
+
|Handler ordering|Authorization and interceptor `before`/`after` positions are unchanged|✓ Behavior-preserving for normally spelled requests|
|
|
377
377
|
|
|
378
378
|
**Migration path for existing modules**: none. Keep authored `targetRoute` values.
|
|
379
379
|
Callers that dispatch through the framework catch-all receive canonical binding
|
|
@@ -388,13 +388,13 @@ authored route constant directly to the interceptor runner.
|
|
|
388
388
|
|
|
389
389
|
Deleting a user who had customised their sidebar failed on the `user_sidebar_preferences` / `sidebar_variants` foreign keys and surfaced as a generic `500`. The fix clears those rows in `auth.users.delete`, gives both FKs `ON DELETE CASCADE`, and teaches `makeCrudRoute` to recognise a Postgres foreign-key violation (SQLSTATE 23503). **All changes are additive** and pass the contract-surface checks above:
|
|
390
390
|
|
|
391
|
-
|
|
|
391
|
+
|Surface|Change|Classification|
|
|
392
392
|
|---|---|---|
|
|
393
|
-
|
|
|
394
|
-
|
|
|
395
|
-
|
|
|
396
|
-
|
|
|
397
|
-
|
|
|
393
|
+
|Import path / exports (`@open-mercato/shared/lib/db/pg-errors`)|New exports `isForeignKeyViolation(err)` and `getForeignKeyViolationConstraint(err)`|✓ ADDITIVE (new exports, nothing removed or renamed)|
|
|
394
|
+
|HTTP response shapes (`makeCrudRoute` handlers)|A handler that throws a Postgres foreign-key violation now answers `409 { error, code: 'FOREIGN_KEY_VIOLATION', requestId }` with an `x-request-id` header, where it previously answered the generic `500 { error, message, requestId }`. The constraint name is logged and reported to telemetry but never returned to the client. Every other error class keeps its byte-identical historical answer|⚠️ Behaviour change for one error class only. No retained response loses a field, but a client that treated the old `500` as retryable now receives a non-retryable `409`. Regression-tested in `crud-factory.test.ts`|
|
|
395
|
+
|Database schema (`user_sidebar_preferences_user_id_foreign`, `sidebar_variants_user_id_foreign`)|Both constraints are dropped and recreated with `on update cascade on delete cascade` (`Migration20260907120000_auth`). No table or column is added, renamed, removed or retyped, and `down()` restores each constraint to its original definition|✓ ADDITIVE-ONLY compatible (delete behaviour widened, nothing narrowed)|
|
|
396
|
+
|Command behaviour (`auth.users.delete`, `auth.users.create` undo)|The dependent-row cascade also clears `user_sidebar_preferences` and `sidebar_variants`. Those rows are not captured by `UserUndoSnapshot`, so undoing a user delete restores the user, roles, ACLs and custom fields but not the sidebar customisation. `user_consents` is deliberately left untouched|✓ Behaviour-preserving for every delete that succeeded before; deletes that previously failed with `500` now succeed|
|
|
397
|
+
|Event IDs, ACL features, DI names, CLI commands|No change|✓ n/a|
|
|
398
398
|
|
|
399
399
|
**Migration path for existing modules**: no action required. A client that branched on `5xx` for foreign-key failures should treat `409` with `code: 'FOREIGN_KEY_VIOLATION'` as the same condition; it was never retryable.
|
|
400
400
|
|
|
@@ -404,13 +404,13 @@ Deleting a user who had customised their sidebar failed on the `user_sidebar_pre
|
|
|
404
404
|
|
|
405
405
|
`TenantDataEncryptionService.encryptFields` treats "already encrypted" as "decrypts under the current DEK" — a deliberate anti-forgery choice ([#2720](https://github.com/open-mercato/open-mercato/issues/2720)). Real ciphertext sealed under a *different* key failed that check too and was encrypted a second time, producing a nested envelope that no read path can undo, plus a lookup hash computed over ciphertext ([#5951](https://github.com/open-mercato/open-mercato/issues/5951)). That write is now rejected:
|
|
406
406
|
|
|
407
|
-
|
|
|
407
|
+
|Surface|Change|Classification|
|
|
408
408
|
|---|---|---|
|
|
409
|
-
|
|
|
410
|
-
|
|
|
411
|
-
|
|
|
412
|
-
|
|
|
413
|
-
|
|
|
409
|
+
|Import path / exports (`@open-mercato/shared/lib/encryption/aes`)|New export `isEncryptedPayloadShape(value)` — a key-free structural check (`<iv>:<ct>:<tag>:v1` with a 12-byte IV, 16-byte tag and non-empty ciphertext). Explicitly NOT an "is this encrypted" oracle; the shape is forgeable|✓ ADDITIVE (new export, nothing removed or renamed)|
|
|
410
|
+
|Function behaviour (`encryptEntityPayload` / `encryptFields`)|A field holding a structurally well-formed envelope that does not decrypt under the current DEK now raises `TenantDataEncryptionError` with code `WRONG_KEY`, where it previously returned a payload containing a nested envelope. Signature, return type and every other input keep their byte-identical historical behaviour|⚠️ Behaviour change on one previously-corrupting path. `WRONG_KEY` was already declared in `TenantDataEncryptionErrorCode` and emitted nowhere, so no existing handler changes meaning. Regression-tested in `tenantDataEncryptionService.test.ts`|
|
|
411
|
+
|Encryption-at-rest guarantee (#2720)|Unchanged. Nothing is ever stored verbatim: a forgery whose shape is not length-valid (the check is length-based, not content-based) still fails the structural check and is encrypted as ordinary plaintext, and a length-valid one is rejected rather than persisted|✓ Preserved (pinned by the retained `#2720` test cases)|
|
|
412
|
+
|CLI behaviour (`mercato entities rotate-encryption-key`, `… backfill-system-encryption`)|A row whose ciphertext opens under neither `--old-key` nor the current tenant key is reported and skipped instead of rewritten; the backfill no longer passes already-encrypted columns to the encrypt path. Rows that rotated or backfilled successfully before are unaffected|✓ Behaviour-preserving for every row that succeeded before; a row that was previously corrupted is now skipped instead — `rotate-encryption-key --old-key` reports it in the run summary, while `backfill-system-encryption` and `rotate-encryption-key` without `--old-key` skip it silently (see UPGRADE_NOTES.md)|
|
|
413
|
+
|DB schema, API routes, event IDs, ACL features, DI names|No change|✓ n/a|
|
|
414
414
|
|
|
415
415
|
**Migration path for existing modules**: no action required. Operationally, a write touching a record whose encrypted field is sealed under a stale key now fails loudly until the rotation is finished (`mercato entities rotate-encryption-key --old-key …`) or the sealing DEK is restored — a deliberate trade of availability for integrity, since the previous outcome was silent, undetectable corruption. This change does not repair envelopes that were already nested before the upgrade.
|
|
416
416
|
|
|
@@ -420,13 +420,13 @@ Deleting a user who had customised their sidebar failed on the `user_sidebar_pre
|
|
|
420
420
|
|
|
421
421
|
[`.ai/specs/2026-08-12-module-registry-registration-listeners.md`](.ai/specs/2026-08-12-module-registry-registration-listeners.md) adds a public subscription to the module registry so a cache derived from the module list can drop what it built from an incomplete one ([#5103](https://github.com/open-mercato/open-mercato/issues/5103)). **All changes are additive** and pass the contract-surface checks above:
|
|
422
422
|
|
|
423
|
-
|
|
|
423
|
+
|Surface|Change|Classification|
|
|
424
424
|
|---|---|---|
|
|
425
|
-
|
|
|
426
|
-
|
|
|
427
|
-
|
|
428
|
-
|
|
|
429
|
-
|
|
|
425
|
+
|Function signatures|New export `onModulesRegistered(listener)` on `@open-mercato/shared/lib/modules/registry`|✓ ADDITIVE (new function)|
|
|
426
|
+
|Type definitions|New export `ModulesRegisteredListener = (modules: Module[]) => void \| PromiseLike<void>`|✓ ADDITIVE (new type, no rename)|
|
|
427
|
+
|`registerModules(modules)`|Signature, return type, and synchronous behavior unchanged; it now also notifies listeners after the reconciliation it already performed|✓ Behaviour-preserving for existing callers|
|
|
428
|
+
|Import paths|None — both exports ship from the existing registry path|✓ No change|
|
|
429
|
+
|Event IDs, API routes, DB schema, DI names, ACL features, notification IDs, CLI commands, generated files|No change|✓ n/a|
|
|
430
430
|
|
|
431
431
|
**Contract commitments**: listeners are notified synchronously after `setGlobalModules()` (so `getModules()` is readable inside a listener) and only when the registered set actually changed, as decided by an immutable per-registration snapshot of module ids, top-level contract keys and array-valued contract elements. Accessor-declared contracts are never invoked by that snapshot and always count as changed. The contract is fail-soft on both paths: a synchronous throw and an asynchronous rejection are each observed and logged, and neither can fail `registerModules()`. Change detection MAY become more sensitive without a deprecation cycle (over-invalidation only drops a warm cache); it MUST NOT become less sensitive, since that direction serves a stale registry.
|
|
432
432
|
|
|
@@ -440,21 +440,21 @@ Issue #3852 removed the non-cryptographic passkey verification shape from `Passk
|
|
|
440
440
|
|
|
441
441
|
**Exception requirements, as met by this change:**
|
|
442
442
|
|
|
443
|
-
|
|
|
443
|
+
|Requirement|How it is satisfied|
|
|
444
444
|
|---|---|
|
|
445
|
-
|
|
|
446
|
-
|
|
|
447
|
-
|
|
|
448
|
-
|
|
|
449
|
-
|
|
|
445
|
+
|1. Qualifying condition argued|See *Why the deprecation protocol does not apply* below — both values the removed shape compared are disclosed by the server, so accepting it *is* the bypass|
|
|
446
|
+
|2. Narrowest removal, no retained vulnerable branch|Only `verifyPayloadSchema` and the two non-cryptographic acceptance paths are deleted. The `{ response }` path, the challenge TTL check and the signature-counter update are untouched, and **no flag, config toggle or opt-in keeps the old shape reachable**|
|
|
447
|
+
|3. Steps 4 and 5|[`UPGRADE_NOTES.md`](UPGRADE_NOTES.md) `0.6.7 → 0.7.0` (client *and* operator actions); spec [`.ai/specs/enterprise/2026-08-14-passkey-mfa-require-webauthn-assertion.md`](.ai/specs/enterprise/2026-08-14-passkey-mfa-require-webauthn-assertion.md) § Migration & Backward Compatibility|
|
|
448
|
+
|4. Dated entry|This section|
|
|
449
|
+
|5. Maintainer sign-off|PR carries the `security` label; the waiver is called out in the PR body for explicit human approval|
|
|
450
450
|
|
|
451
|
-
|
|
|
451
|
+
|Surface|Change|Classification|
|
|
452
452
|
|---|---|---|
|
|
453
|
-
|
|
|
454
|
-
|
|
|
455
|
-
|
|
|
456
|
-
|
|
|
457
|
-
|
|
|
453
|
+
|API request shape (`POST /api/security/mfa/verify`, `POST /api/security/sudo/verify`, `methodType: 'passkey'`)|`payload` must be `{ response }` carrying a WebAuthn assertion. The `{ credentialId, challenge }` alternative is removed and now answers `401`|✗ BREAKING (deliberate — see rationale)|
|
|
454
|
+
|Provider contract (`MfaProviderInterface.verifySchema` for `passkey`)|`verifyPayloadSchema` narrows from a union to a single object requiring `response`|✗ BREAKING for a caller that validated against the exported schema|
|
|
455
|
+
|Verification behavior|A verified `verifyAuthenticationResponse` is the only route to a positive verdict; an absent verify context is a rejection rather than a `credentialId` comparison|✗ BREAKING for a client that skipped `/api/security/mfa/prepare`|
|
|
456
|
+
|Failure mode|A payload that fails the schema, and an assertion the verifier throws on, return `false` instead of throwing — so they answer the documented `401` and count toward the challenge attempt limit instead of logging a `500` that skipped lockout|✓ Strictly safer (no verdict flips from negative to positive)|
|
|
457
|
+
|API route URLs, HTTP methods, response schemas, database schema, event IDs, ACL features, DI names, CLI commands|No change|✓ n/a|
|
|
458
458
|
|
|
459
459
|
**Why the deprecation protocol does not apply.** The protocol exists to give downstream authors a bridge release. Here the request shape being removed *is* the vulnerability: both values it compared are disclosed by the server, so a bridge would keep the passkey second factor bypassable for a minor version in both login MFA and sudo step-up. A security fix that leaves the hole open is not a fix.
|
|
460
460
|
|
|
@@ -464,12 +464,12 @@ Issue #3852 removed the non-cryptographic passkey verification shape from `Passk
|
|
|
464
464
|
|
|
465
465
|
[`.ai/specs/2026-09-02-data-sync-adapter-start-controls.md`](.ai/specs/2026-09-02-data-sync-adapter-start-controls.md) lets a `DataSyncAdapter` declare, per entity type, which of the Data Sync dashboard's manual-start controls apply, so the dashboard stops offering controls that cannot mean anything for the selected entity type. **All changes are additive** and pass the contract-surface checks above:
|
|
466
466
|
|
|
467
|
-
|
|
|
467
|
+
|Surface|Change|Classification|
|
|
468
468
|
|---|---|---|
|
|
469
|
-
|
|
|
470
|
-
|
|
|
471
|
-
|
|
|
472
|
-
|
|
|
469
|
+
|Type definitions (§2)|New optional method `DataSyncAdapter.supportsStartControl?(control, entityType)`; new exported type `DataSyncStartControl = 'fullSync' \| 'batchSize'`|✓ ADDITIVE (optional member, new type — same shape as the `persistsSharedCursor` and `runParameters` additions before it)|
|
|
470
|
+
|Import paths (§4)|New module `data_sync/lib/start-controls.ts` exporting `resolveStartControlMap`, `applicableStartControls`, `StartControlMap`, `StartControlApplicability`, `DATA_SYNC_START_CONTROLS`|✓ ADDITIVE (new path; nothing moved or re-exported)|
|
|
471
|
+
|API route URLs (§7)|`GET /api/data_sync/options` items gain a `startControls` object; `POST /api/data_sync/run` is unchanged and keeps honouring `fullSync` and `batchSize` whatever an adapter declares|✓ ADDITIVE (new optional response field, no request-shape change)|
|
|
472
|
+
|Auto-discovery, function signatures, event IDs, widget spot IDs, DB schema, DI names, ACL features, notification IDs, CLI commands, generated files|No change|✓ n/a|
|
|
473
473
|
|
|
474
474
|
**Contract commitments**: only an explicit `false` removes a control, so an adapter that declares nothing — or whose predicate returns anything else — renders the same form and sends the same request body as before. A predicate that throws is treated as *applies*, because `api/options.ts` resolves every registered adapter in one response and one broken predicate must not take the dashboard down for the rest. The `startControls` map is sparse and keyed only by the adapter's own `supportedEntities`; a missing entry means every control applies, so a client that ignores the field behaves exactly as today. The declaration governs what the dashboard **offers**, never what the run API **accepts** — that separation MUST hold for any future change here, or an API client posting `fullSync: true` would silently stop getting a full run.
|
|
475
475
|
|
|
@@ -479,15 +479,15 @@ Issue #3852 removed the non-cryptographic passkey verification shape from `Passk
|
|
|
479
479
|
|
|
480
480
|
Spec: [`.ai/specs/2026-09-08-error-reporting-policy.md`](.ai/specs/2026-09-08-error-reporting-policy.md). Every change is additive; no existing path emits less than it did before.
|
|
481
481
|
|
|
482
|
-
|
|
|
482
|
+
|Surface|Change|Classification|
|
|
483
483
|
|---|---|---|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
484
|
+
|`TelemetryProvider`|Optional `reportError?()` added, called in addition to the span/log/metric path. MUST stay optional — third parties implement this interface|✓ ADDITIVE|
|
|
485
|
+
|`ReportErrorContext` / `TelemetryRuntime['reportError']` context|Optional `code?: string` fingerprint added|✓ ADDITIVE|
|
|
486
|
+
|`data_sync.run.completed` payload|Optional `createdCount`, `updatedCount`, `skippedCount`, `failedCount` added; no existing field changed (§5 permits additive payload fields)|✓ ADDITIVE|
|
|
487
|
+
|`integration_logs` rows at `level: 'error'`|Also reported to the active telemetry backend (message, `code`, ids — never `payload`). With telemetry off, one global lookup and no behaviour change|✓ ADDITIVE|
|
|
488
|
+
|`queue` failure paths, `data_sync` engine|Existing `logger.error` lines keep their text and gain a `reportError` call with a `code`|✓ ADDITIVE|
|
|
489
|
+
|`reportError`'s `code`|A value that is not shaped `module.reason` is dropped rather than published, so it cannot become an unbounded, unredacted metric label. No in-repo caller passes one; a caller that did reported exactly as one passing no `code`, which is the pre-PR behaviour|✓ ADDITIVE|
|
|
490
|
+
|`integration_logs` message text for the payment status poller and the Stripe webhook processor|The failure cause moves from `payload` **into** the message (`Payment status polling failed: {cause}`), because the payload is deliberately never reported. `payload` keeps the same fields|✓ ADDITIVE (row content, no schema or field change)|
|
|
491
491
|
| `integration_logs.code` for the payment status poller | Previously `null`, now `payment_gateways.status_poll_failed`, so it groups apart from the `integrations.log_error` catch-all. The column and its API field already existed | ✓ ADDITIVE (a value where there was none) |
|
|
492
492
|
| `IntegrationLogError` (`core:integrations`), `SyncRunPartialFailureError` (`core:data_sync`) | New exported error classes | ✓ ADDITIVE |
|
|
493
493
|
| API route URLs, response schemas, database schema, event IDs, ACL features, DI names, CLI commands, env vars | No change — the policy adds no configuration | ✓ n/a |
|
|
@@ -609,6 +609,12 @@ Clients use WebAuthn; operators audit key provenance, re-enroll with recovery. [
|
|
|
609
609
|
|
|
610
610
|
**Migration path for existing modules**: none for first-party code. Third-party modules must not register an integration or bundle id that ends in `__oauth_grant` (see `UPGRADE_NOTES.md`).
|
|
611
611
|
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
## Attachment owner access (2026-10-01, #6726)
|
|
615
|
+
|
|
616
|
+
STABLE HTTP/service BREAK (403/404/504), Documents only: org-wide files bypass sharing; bridging would retain disclosure. Discovery/schema additive. [Migration](UPGRADE_NOTES.md#documents-attachments-enforce-owner-permissions-at-host-urls-6726); [spec](.ai/specs/2026-10-01-attachment-access-resolvers.md). [@haxiorz: steps 1–3 waived; migration acknowledged](https://github.com/open-mercato/open-mercato/pull/6829#issuecomment-6505350022).
|
|
617
|
+
|
|
612
618
|
## #7220
|
|
613
619
|
|
|
614
620
|
[Cache fix](UPGRADE_NOTES.md)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"generator": "@open-mercato/cli@0.10.1-develop.
|
|
3
|
+
"generator": "@open-mercato/cli@0.10.1-develop.7748.1.d745ba61aa",
|
|
4
4
|
"files": {
|
|
5
5
|
"AGENTS.md": "b27342ee5f61e805ba52703fdb7ec822b030490f734b4d80f48dfd1e05fa4cf5",
|
|
6
|
-
"BACKWARD_COMPATIBILITY.md": "
|
|
6
|
+
"BACKWARD_COMPATIBILITY.md": "bac9a78af24b35909285d6d52f411d72aa5469204d9f434e9d5b5590ba7edfec"
|
|
7
7
|
}
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/cli",
|
|
3
|
-
"version": "0.10.1-develop.
|
|
3
|
+
"version": "0.10.1-develop.7748.1.d745ba61aa",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"@mikro-orm/decorators": "^7.1.14",
|
|
61
61
|
"@mikro-orm/migrations": "^7.1.14",
|
|
62
62
|
"@mikro-orm/postgresql": "^7.1.14",
|
|
63
|
-
"@open-mercato/events": "0.10.1-develop.
|
|
64
|
-
"@open-mercato/queue": "0.10.1-develop.
|
|
65
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
66
|
-
"@open-mercato/telemetry": "0.10.1-develop.
|
|
63
|
+
"@open-mercato/events": "0.10.1-develop.7748.1.d745ba61aa",
|
|
64
|
+
"@open-mercato/queue": "0.10.1-develop.7748.1.d745ba61aa",
|
|
65
|
+
"@open-mercato/shared": "0.10.1-develop.7748.1.d745ba61aa",
|
|
66
|
+
"@open-mercato/telemetry": "0.10.1-develop.7748.1.d745ba61aa",
|
|
67
67
|
"cross-spawn": "^7.0.6",
|
|
68
68
|
"pg": "8.23.0",
|
|
69
69
|
"semver": "^7.8.5",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"typescript-js": "npm:typescript@6.0.3"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
77
|
+
"@open-mercato/shared": "0.10.1-develop.7748.1.d745ba61aa"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
80
|
+
"@open-mercato/shared": "0.10.1-develop.7748.1.d745ba61aa",
|
|
81
81
|
"@types/jest": "^30.0.0",
|
|
82
82
|
"jest": "^30.4.2",
|
|
83
83
|
"ts-jest": "^29.4.12"
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import os from 'node:os'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import ts from 'typescript-js'
|
|
5
|
+
import type { ModuleEntry, PackageResolver } from '../../resolver'
|
|
6
|
+
import { generateModuleRegistry } from '../module-registry'
|
|
7
|
+
|
|
8
|
+
const REPO_ROOT = path.resolve(__dirname, '../../../../../..')
|
|
9
|
+
let fixtureRoot: string
|
|
10
|
+
|
|
11
|
+
function write(relative: string, content: string): void {
|
|
12
|
+
const target = path.join(fixtureRoot, relative)
|
|
13
|
+
fs.mkdirSync(path.dirname(target), { recursive: true })
|
|
14
|
+
fs.writeFileSync(target, content)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
beforeEach(() => { fixtureRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'attachment-access-generator-')) })
|
|
18
|
+
afterEach(() => fs.rmSync(fixtureRoot, { recursive: true, force: true }))
|
|
19
|
+
|
|
20
|
+
it.each([false, true])('discovers nested attachment policies and removes disabled adopters (standalone=%s)', async (standalone) => {
|
|
21
|
+
const packageRoot = standalone ? 'node_modules/fixture' : 'packages/core'
|
|
22
|
+
const moduleRoot = `${packageRoot}/${standalone ? 'dist' : 'src'}/modules`
|
|
23
|
+
const extension = standalone ? 'js' : 'ts'
|
|
24
|
+
const source = fs.readFileSync(path.join(REPO_ROOT, 'packages/core/src/modules/attachments/generators.ts'), 'utf8')
|
|
25
|
+
const compiled = ts.transpileModule(source, {
|
|
26
|
+
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 },
|
|
27
|
+
}).outputText
|
|
28
|
+
write(`${moduleRoot}/attachments/generators.${extension}`, compiled)
|
|
29
|
+
write(`${moduleRoot}/documents/data/attachment-access.${extension}`, 'export const attachmentAccessResolvers = []; export const protectedAttachmentTargets = []')
|
|
30
|
+
write(`${moduleRoot}/clinical/data/attachment-access.${extension}`, 'export const attachmentAccessResolvers = []')
|
|
31
|
+
const outputDir = path.join(fixtureRoot, '.mercato/generated')
|
|
32
|
+
const entries: ModuleEntry[] = [
|
|
33
|
+
{ id: 'attachments', from: '@open-mercato/core' },
|
|
34
|
+
{ id: 'documents', from: '@open-mercato/documents' },
|
|
35
|
+
{ id: 'clinical', from: '@open-mercato/core' },
|
|
36
|
+
]
|
|
37
|
+
const resolver: PackageResolver = {
|
|
38
|
+
isMonorepo: () => !standalone,
|
|
39
|
+
getRootDir: () => fixtureRoot,
|
|
40
|
+
getAppDir: () => fixtureRoot,
|
|
41
|
+
getOutputDir: () => outputDir,
|
|
42
|
+
getModulesConfigPath: () => path.join(fixtureRoot, 'src/modules.ts'),
|
|
43
|
+
discoverPackages: () => [],
|
|
44
|
+
loadEnabledModules: () => entries,
|
|
45
|
+
getModulePaths: (entry) => ({
|
|
46
|
+
appBase: path.join(fixtureRoot, 'src/modules', entry.id),
|
|
47
|
+
pkgBase: path.join(fixtureRoot, moduleRoot, entry.id),
|
|
48
|
+
}),
|
|
49
|
+
getModuleImportBase: (entry) => ({
|
|
50
|
+
appBase: `@/modules/${entry.id}`,
|
|
51
|
+
pkgBase: `${entry.from}/modules/${entry.id}`,
|
|
52
|
+
}),
|
|
53
|
+
getPackageOutputDir: () => outputDir,
|
|
54
|
+
getPackageRoot: () => path.join(fixtureRoot, packageRoot),
|
|
55
|
+
}
|
|
56
|
+
const first = await generateModuleRegistry({ resolver, quiet: true })
|
|
57
|
+
expect(first.errors).toEqual([])
|
|
58
|
+
const read = (name: string) => fs.readFileSync(path.join(outputDir, name), 'utf8')
|
|
59
|
+
const registry = read('attachment-access.generated.ts')
|
|
60
|
+
expect(registry).toContain('@open-mercato/documents/modules/documents/data/attachment-access')
|
|
61
|
+
expect(registry).toContain('protectedAttachmentTargets')
|
|
62
|
+
expect(registry.indexOf("moduleId: 'documents'")).toBeLessThan(registry.indexOf("moduleId: 'clinical'"))
|
|
63
|
+
expect(read('bootstrap-registrations.generated.ts')).toContain('registerAttachmentAccessResolvers(attachmentAccessEntries)')
|
|
64
|
+
|
|
65
|
+
entries.splice(1, 1)
|
|
66
|
+
const second = await generateModuleRegistry({ resolver, quiet: true })
|
|
67
|
+
expect(second.errors).toEqual([])
|
|
68
|
+
expect(read('attachment-access.generated.ts')).not.toContain('documents/data/attachment-access')
|
|
69
|
+
expect(read('attachment-access.generated.ts')).toContain('clinical/data/attachment-access')
|
|
70
|
+
})
|