@open-mercato/cli 0.10.1-develop.8291.1.6ec3aee41c → 0.10.1

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 (106) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/agentic/guides/module-facts.json +278 -206
  3. package/dist/agentic/guides/module-facts.v2.json +278 -206
  4. package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
  5. package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
  6. package/dist/agentic/guides/modules/api_docs/index.md +1 -1
  7. package/dist/agentic/guides/modules/api_keys/index.md +1 -1
  8. package/dist/agentic/guides/modules/attachments/di-registrations-rich.md +6 -6
  9. package/dist/agentic/guides/modules/attachments/di-service-tokens.md +5 -5
  10. package/dist/agentic/guides/modules/attachments/exact-override-targets.md +6 -6
  11. package/dist/agentic/guides/modules/attachments/index.md +1 -1
  12. package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
  13. package/dist/agentic/guides/modules/auth/index.md +1 -1
  14. package/dist/agentic/guides/modules/availability/index.md +1 -1
  15. package/dist/agentic/guides/modules/business_rules/index.md +1 -1
  16. package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
  17. package/dist/agentic/guides/modules/cart/index.md +1 -1
  18. package/dist/agentic/guides/modules/catalog/index.md +1 -1
  19. package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
  20. package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
  21. package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
  22. package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
  23. package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
  24. package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
  25. package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
  26. package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
  27. package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
  28. package/dist/agentic/guides/modules/checkout/index.md +1 -1
  29. package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
  30. package/dist/agentic/guides/modules/configs/index.md +1 -1
  31. package/dist/agentic/guides/modules/content/index.md +1 -1
  32. package/dist/agentic/guides/modules/currencies/index.md +1 -1
  33. package/dist/agentic/guides/modules/customer_accounts/exact-override-targets.md +4 -4
  34. package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
  35. package/dist/agentic/guides/modules/customer_accounts/setup.md +1 -1
  36. package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
  37. package/dist/agentic/guides/modules/customers/di-registrations-rich.md +6 -5
  38. package/dist/agentic/guides/modules/customers/exact-override-targets.md +6 -5
  39. package/dist/agentic/guides/modules/customers/index.md +2 -2
  40. package/dist/agentic/guides/modules/dashboards/index.md +1 -1
  41. package/dist/agentic/guides/modules/data_sync/index.md +1 -1
  42. package/dist/agentic/guides/modules/design_system/index.md +1 -1
  43. package/dist/agentic/guides/modules/devices/index.md +1 -1
  44. package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
  45. package/dist/agentic/guides/modules/directory/index.md +1 -1
  46. package/dist/agentic/guides/modules/documents/index.md +1 -1
  47. package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
  48. package/dist/agentic/guides/modules/entities/cli-commands.md +1 -0
  49. package/dist/agentic/guides/modules/entities/exact-override-targets.md +1 -0
  50. package/dist/agentic/guides/modules/entities/index.md +1 -1
  51. package/dist/agentic/guides/modules/eudr/index.md +1 -1
  52. package/dist/agentic/guides/modules/events/index.md +1 -1
  53. package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
  54. package/dist/agentic/guides/modules/forms/index.md +1 -1
  55. package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
  56. package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
  57. package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
  58. package/dist/agentic/guides/modules/generators/index.md +1 -1
  59. package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
  60. package/dist/agentic/guides/modules/integrations/index.md +1 -1
  61. package/dist/agentic/guides/modules/messages/index.md +1 -1
  62. package/dist/agentic/guides/modules/notifications/index.md +1 -1
  63. package/dist/agentic/guides/modules/onboarding/index.md +1 -1
  64. package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
  65. package/dist/agentic/guides/modules/perspectives/index.md +1 -1
  66. package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
  67. package/dist/agentic/guides/modules/planner/index.md +1 -1
  68. package/dist/agentic/guides/modules/portal/index.md +1 -1
  69. package/dist/agentic/guides/modules/progress/index.md +1 -1
  70. package/dist/agentic/guides/modules/promotions/index.md +1 -1
  71. package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
  72. package/dist/agentic/guides/modules/query_index/index.md +1 -1
  73. package/dist/agentic/guides/modules/record_locks/index.md +1 -1
  74. package/dist/agentic/guides/modules/resources/index.md +1 -1
  75. package/dist/agentic/guides/modules/sales/index.md +1 -1
  76. package/dist/agentic/guides/modules/scheduler/index.md +1 -1
  77. package/dist/agentic/guides/modules/search/index.md +1 -1
  78. package/dist/agentic/guides/modules/security/index.md +1 -1
  79. package/dist/agentic/guides/modules/seeds/index.md +1 -1
  80. package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
  81. package/dist/agentic/guides/modules/sso/index.md +1 -1
  82. package/dist/agentic/guides/modules/staff/di-registrations-rich.md +8 -8
  83. package/dist/agentic/guides/modules/staff/exact-override-targets.md +8 -8
  84. package/dist/agentic/guides/modules/staff/index.md +1 -1
  85. package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
  86. package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
  87. package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
  88. package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
  89. package/dist/agentic/guides/modules/telemetry/index.md +1 -1
  90. package/dist/agentic/guides/modules/tillio/index.md +1 -1
  91. package/dist/agentic/guides/modules/translations/index.md +1 -1
  92. package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
  93. package/dist/agentic/guides/modules/webhooks/index.md +1 -1
  94. package/dist/agentic/guides/modules/wms/index.md +1 -1
  95. package/dist/agentic/guides/modules/workflows/index.md +1 -1
  96. package/dist/agentic/guides/reference-module-facts.json +1 -1
  97. package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +12 -0
  98. package/dist/agentic/guides/upstream/manifest.json +2 -2
  99. package/dist/agentic/shared/ai/harness/cases.json +4 -4
  100. package/dist/agentic/shared/ai/skills/om-auto-upgrade-0.9.0-to-0.10.0/SKILL.md +269 -0
  101. package/dist/agentic/shared/ai/skills/tiers.json +2 -1
  102. package/dist/lib/module-inspection.js +19 -3
  103. package/dist/lib/module-inspection.js.map +2 -2
  104. package/package.json +8 -9
  105. package/src/lib/__tests__/module-inspection.test.ts +72 -0
  106. package/src/lib/module-inspection.ts +23 -3
@@ -0,0 +1,269 @@
1
+ ---
2
+ name: om-auto-upgrade-0.9.0-to-0.10.0
3
+ description: Migrate downstream Open Mercato code from 0.9.0 to 0.10.0 — add the dictionaries, feature_toggles, business_rules and customer_accounts modules that customers, portal and workflows now require in src/modules.ts, and audit exact-decimal money fields, the production CSP nonce, the Compose tenant encryption key and superadmin bootstrap, nested ACL wildcards, ACL live rows, MCP loopback binding and filtered tools/list, AI tool mutation policy and agent invoke features, file-agent native runtime and GOVERNANCE.json, encrypted custom fields in search, attachment access and storage release, cross-site login refusal, outbound email attachments, workflow CALL_API/webhook limits, event-triggered workflow identity, notification hrefs, catalog 404 scope, staff capacity providers, and the other 0.10.0 behavior changes; validate the app; and report manual work. Use for "upgrade Open Mercato to 0.10.0", "migrate 0.9.0 to 0.10.0", "apply the 0.10.0 upgrade notes", or "zaktualizuj Open Mercato do 0.10.0".
4
+ ---
5
+
6
+ # Auto upgrade 0.9.0 to 0.10.0
7
+
8
+ Apply the mechanical parts of the Open Mercato `0.9.0 → 0.10.0` upgrade to a downstream app. Treat the matching section of `UPGRADE_NOTES.md` as the source of truth and leave every intent-sensitive change as an explicit manual finding.
9
+
10
+ The window is large: `0.10.0` is the first minor after `0.9.0`, so it also carries every fix that 0.9.x patch releases backported. An app already on a 0.9.x patch still runs every check — each is idempotent and a check that matches nothing is reported as a no-match.
11
+
12
+ ## Scope
13
+
14
+ Operate on a standalone app or downstream repository that depends on `@open-mercato/*`. Never modify the framework monorepo, framework-owned `packages/`, dependency pins, lockfiles, generated output, vendored dependencies, or secrets. Run after the user has selected and installed `0.10.0`.
15
+
16
+ ## Arguments
17
+
18
+ - `--path <dir>`: downstream repository root; defaults to the current directory.
19
+ - `--dry-run`: detect, classify, and report without editing files or running mutating commands.
20
+ - `--only <id[,id...]>`: limit work to named checks.
21
+ - `--skip <id[,id...]>`: omit named checks and record the omission in the report.
22
+
23
+ Reject unknown flags and combining `--only` with `--skip`.
24
+
25
+ ## Upgrade checks
26
+
27
+ Rows follow the order of the `0.9.0 → 0.10.0` section of `UPGRADE_NOTES.md`.
28
+
29
+ | ID | Classification | Detect | Action |
30
+ | --- | --- | --- | --- |
31
+ | `outbound-email-attachments-bytes` | Detect and report | Custom `ChannelAdapter` implementations whose capabilities set `fileSharing: true` and that read `attachment.url` in `convertOutbound`; imports of `assembleRfc2822` from `communication_channels/lib/email-mime`; callers writing `channelMetadata.outboundAttachments`; `send-as-user` callers passing `attachments`; tests asserting exact Gmail outbound message bytes | Report that the hub now fills `attachments` with bytes in `NormalizedAttachment.content` and an empty `url`. An adapter with `fileSharing: true` must send `attachment.content` (or use `resolveOutboundAttachmentBytes` from `communication_channels/lib/outbound-attachments`) and must not fetch `attachment.url`. Recommend the async `composeEmailMessage` over the deprecated `assembleRfc2822` (deprecated since 0.10.0, removal no earlier than 0.11.0). `channelMetadata.outboundAttachments` is now hub-owned and caller values are dropped. A malformed `send-as-user` `attachments` field now returns 422 with a stable `code`. Gmail tests may need the new header folding. Tests should assert on `content.attachmentDigests`. Adapters may declare `ChannelCapabilities.maxTotalBytes` (25 MB default) |
32
+ | `eval-case-tool-mocks` | No code action | N/A — additive enterprise eval feature | No action needed. Eval cases may declare `cases[].mocks`. An older CLI rejects eval-set files that use `mocks`, so upgrade every CLI that runs such files |
33
+ | `trace-retention-schedule` | No code action | N/A — operator procedure | Retention now resumes from a per-organization cursor (no migration). Organizations created before the retention worker shipped have no schedule: run `yarn mercato agent_orchestrator trace-retention:schedule` once (`--tenant`/`--org` narrow it; idempotent; needs the scheduler module). Watch for the error code `agent_orchestrator.trace_content_retention_delete_failed` and remove reported objects by hand if needed |
34
+ | `delegate-agent-declared-subagents` | Detect and report | Direct calls to `agent_orchestrator.delegate_agent` outside an agent run, e.g. via `/api/ai_assistant/tools/execute` or MCP clients | Report that `delegate_agent` now runs a target only when the calling agent lists it in `subAgents`. Calls outside a run return `{ ok: false, error: 'no_active_run' }`; undeclared targets return `sub_agent_not_allowed`. Direct callers must run the agent through its run route or an agent tool |
35
+ | `file-agents-native-runtime` | Detect and report | `agents/<id>/AGENT.md` file agents; env vars `OM_OPENCODE_RUN_TIMEOUT_MS`, `OM_AGENT_RUN_TIMEOUT_MS`, `OM_AGENT_FILE_AGENT_RUNTIME`; reports/queries filtering `agent_runs.runtime = 'opencode'` | Report that file agents (except `artifact` outcomes) now run natively, read-only, with no output repair and no file plane. If `OM_OPENCODE_RUN_TIMEOUT_MS` was raised, also raise `OM_AGENT_RUN_TIMEOUT_MS`. Agents that run out of steps need a higher `maxSteps` in the `AGENT.md` frontmatter, followed by `yarn generate`. Dashboards must also count `'native'` and `'in-process'`. `OM_AGENT_FILE_AGENT_RUNTIME=opencode` is a deprecated, temporary fallback that lasts one minor version |
36
+ | `file-agent-governance-json` | Detect and report | `agents/<id>/GOVERNANCE.json` files; exhaustive `switch` over `AiAgentDispatchDeniedCode` / `AgentToolDenyCode`; `callSettings` sent to OpenCode-run agents | Report that an invalid `GOVERNANCE.json` now leaves the agent unregistered. OpenCode-run agents that declare `untrustedInputs`, `modelSettings`, an `intersect` principal, or a `prepare_step` integrity rule are also not registered. `callSettings` sent to OpenCode agents now refuse with `agent_call_settings_unsupported` (`422 dispatch_option_unsupported` on `run-object`): drop them or move the agent to native. Exhaustive switches need a case for the new member |
37
+ | `trace-ignored-call-settings` | No code action | N/A — trace attribute behavior | Settings the provider drops are now left out of `gen_ai.request.*` and listed in `om.params.ignored`. `runAiAgentObject` exposes an optional `warnings` field. Old traces are not rewritten |
38
+ | `agent-run-call-settings` | Detect and report | Callers of `POST /agents/{id}/run`, `POST /agent-api/agents/{id}/run`, `POST /runs/{id}/rerun` sending `callSettings`; workflow definitions with an `INVOKE_AGENT` step whose `config.callSettings` is set | Report that `callSettings` is now validated (422 on a bad value) and applied. Stored `INVOKE_AGENT` `callSettings` that are out of range, use unknown keys, or contain `{{context.*}}` tokens now fail the step. Sending to OpenCode-run agents returns `422 agent_call_settings_unsupported`. A rerun does not reuse the original settings, so pass them again |
39
+ | `mcp-refused-call-audit` | No code action | N/A — audit logging behavior | No action needed. Expect more `ai_assistant.mcp_tool_call` rows. Dashboards that read `outcome: 'denied'` should also check `errorCode` (`NOT_FOUND` / `VALIDATION_ERROR`) |
40
+ | `trace-artifacts-encryption-fail-closed` | No code action | N/A — runtime storage behavior | With `TENANT_DATA_ENCRYPTION` on, a KMS outage now pauses content and artifact capture instead of writing plaintext. To remove plaintext blobs from earlier versions, delete them from the `agent-trace-content`, `agent-trace-artifacts` and `agent-run-artifacts` namespaces |
41
+ | `invoice-delete-row-lock` | Detect and report | Clients or tests of `DELETE /api/sales/invoices` that assert 500 for missing invoices | Report that a stale `x-om-ext-optimistic-lock-expected-updated-at` now answers 409 `optimistic_lock_conflict` under the row lock. A missing or deleted invoice answers 404 instead of 500. No migration |
42
+ | `catalog-price-kind-seed` | Detect and report | Calls to `seedCatalogPriceKinds`, `mercato catalog seed-price-kinds`, catalog `seed:defaults`, `seed-examples`/`seed-examples-bundle` in scripts | Report that seeding now only creates a missing `regular`/`sale` and no longer modifies or moves existing kinds. A soft-deleted `regular`/`sale` is not restored, so restore it before `seed-examples`. Kinds soft-deleted by earlier seeds can be restored with the note's SQL; then check `is_active` and clear the CRUD/API cache or restart |
43
+ | `event-workflow-execution-identity` | Detect and report | Workflow definitions with event triggers that rely on event payload `userId`/`actorUserId` for execution authority | Report that event payload user ids no longer grant authority: configure the definition's explicit grant for event-driven effects. Mismatched persisted event-labelled instances now fail closed. Operators should stop writers and workers, update all replicas together, inventory, cancel, audit, and restart work with a trusted initiator. No migration |
44
+ | `eudr-undo-conflict` | Detect and report | Clients handling EUDR update undo responses; code that auto-retries undos | Report that stale EUDR update undos now return 409 `eudr.errors.undoConflict`. Clients must treat it as final, reload and re-apply by hand, never retry automatically. Restart app and workers together |
45
+ | `compose-tenant-encryption-key` | Detect and report | Compose files/`.env` referencing `TENANT_DATA_ENCRYPTION_FALLBACK_KEY`, `LOOKUP_HASH_PEPPER`, `VAULT_ADDR`, `VAULT_TOKEN`, `TENANT_DATA_ENCRYPTION_OLD_KEY` (report names and files only, never values) | Report that production Compose no longer ships a key, and startup now requires a unique key of at least 32 bytes or Vault. The published key and weak peppers are rejected, and remote Vault must use HTTPS. Adopt the updated Compose environment and preflight together, and keep replicas and sidecars consistent. Never regenerate keys for existing data; follow `starters/docker/encryption-migration.md` |
46
+ | `channel-concurrent-writes` | No code action | N/A — runtime concurrency fix | No API, schema or config change. Restart all workers when deploying |
47
+ | `starter-reuse-optional-ai` | No code action | N/A — setup tooling behavior | `yarn setup` can reuse existing services after confirmation; non-interactive users must pass `--no-infra`. AI provider setup is optional. Setup now verifies PostgreSQL, Redis and Meilisearch credentials first |
48
+ | `person-card-section-subtitle` | Detect and report | Imports of `PersonCard` from `components/detail/PersonCard`; `sectionSubtitle` prop on `LinkedPeopleSection`; widgets on DataTable id `customers.linked_people.list` | Report that `PersonCard` and `LinkedPeopleSectionProps.sectionSubtitle` are deprecated and kept for at least one minor release. New tables should use `Person*Cell` components and `buildPersonRowActionItems`; move subtitle text into `header`. Row action ids are `open`/`unlink` |
49
+ | `search-strategy-pins` | No code action | N/A — runtime search write behavior | `SearchService` writes now honor entity `strategies`. After upgrading all workers, operators should purge entities from indexes they were excluded from, using the existing cleanup operations |
50
+ | `create-app-archive-limits` | No code action | N/A — scaffolding tool limits | `create-mercato-app --app`/`--app-url` archives are capped at 64 MiB download, 10,000 entries and 128 MiB unpacked, and links are rejected. There is no override: trim the app or replace links with files |
51
+ | `agent-search-answer-domain-policy` | No code action | N/A — runtime search behavior | With an allow/deny list, `web_search` `answer` is `null` and `diagnostics.answerWithheld: 'domain_policy'` is set. Use the permitted results. No migration |
52
+ | `production-csp-nonce` | Detect and report | App `next.config.ts`, `src/proxy.ts`, root layout, `AppProviders`; inline `<script>`/`<style>` elements and `next/script` usages without nonce; env vars `OM_CSP_CONNECT_ORIGINS`, `OM_CSP_SCRIPT_ORIGINS`, `OM_CSP_STYLE_ORIGINS`, `OM_CSP_FRAME_ORIGINS`; `srcDoc` previews; third-party browser SDK origins | Report that production CSP now uses nonces and no longer allows inline scripts, eval, or any-origin connections. Adopt the matching `next.config.ts`/`proxy.ts`/layout/`AppProviders` changes together. Configure extra origins via `OM_CSP_*_ORIGINS` at build and runtime. Pass `x-nonce` (server, `headers()`) or `useContentSecurityPolicyNonce` from `@open-mercato/ui/theme/ContentSecurityPolicyProvider` (client) to inline script/style elements. Never copy nonces from input or cache nonce pages separately |
53
+ | `setup-isolation-remote-db` | No code action | N/A — setup tooling behavior | Against a non-loopback PostgreSQL, `yarn setup` now requires `--allow-remote-database=host:port/database`. Isolated stacks use the `mercato-local-v2-*` namespace; old stacks are kept. Nonlocal Redis bindings need a password |
54
+ | `logout-303-redirect` | Detect and report | Clients or tests asserting `307` from `POST /api/auth/logout` | Report that logout now returns `303 See Other`. Accept 303 and follow `Location` with GET |
55
+ | `production-bootstrap-superadmin` | Detect and report | Deployment/bootstrap scripts running `mercato init` with `--skip-password-policy` or `--allow-weak-password`; Compose files referencing `OM_INIT_SUPERADMIN_PASSWORD` (name only, never value) | Report that in production `mercato init` rejects missing, blank or placeholder passwords and ignores the bypass flags. Set a unique `OM_INIT_SUPERADMIN_PASSWORD` securely before first init or reinstall. Rotate the superadmin credential if it was initialized with a predictable password |
56
+ | `private-next-interaction-subjects` | No code action | N/A — data projection behavior plus operator migration | Shared customer projections now return a NULL name for private email interactions; clients should keep an unnamed fallback. Apply the forward-only data migration, complete the customer entity/profile query-index rebuilds, and rebuild fulltext/vector indexes before reopening reads |
57
+ | `setup-encryption-preflight` | Detect and report | Standalone app `scripts/dev.mjs` without `scripts/dev-encryption-preflight.mjs`; custom `SYNC_ROLE_ACLS_COMMAND` implementations | Report that standalone apps must refresh `scripts/dev.mjs` and add `scripts/dev-encryption-preflight.mjs` with the matching helper packages. Custom `SYNC_ROLE_ACLS_COMMAND` should reserve exit status `78` for fatal configuration failures. Keep the original encryption keys and configuration; never regenerate them to bypass a rejection |
58
+ | `customer-comment-author-attribution` | Detect and report | Clients sending `authorUserId` to `PUT /api/customers/comments` or the `customers.comments.update` command | Report that a supplied `authorUserId` is now ignored for ordinary staff and API keys; omit it for body edits. Corrections require a non-API-key superadmin session. Operators should review earlier attribution changes |
59
+ | `money-exact-decimals` | Detect and report | App calculation hooks, shipping/payment providers and gateway adapters; calls to `catalogBuyerPricingService.resolveLinePrice`; imports of `CaptureAmounts`, `resolveCaptureAmounts`, `assertCaptureWithinRemaining` and reserve/settle/release helpers; staff rate resolvers; `resolveCatalogPriceAmount`, `toSubmittedAmount`, `validateExchangeRateForm`; literal amount string comparisons like `'40.0000'` | Report that money columns are now unconstrained `numeric` and new `<field>Exact` decimal strings exist. Use `@open-mercato/shared/lib/decimal` for full precision. Gateways should prefer `input.amountExact`. `resolveLinePrice` callers should read `amountNetExact`/`amountGrossExact` and pass `currencyDecimalPlaces`. Literal string compares must become numeric compares. The capture-ledger bigint helpers are deprecated (no removal before 0.11.0); migrate to `ExactCaptureAmounts` and the `*Exact` helpers. Over-precise or oversized inputs now get 400/422. Back up before any migration `down()` |
60
+ | `encryption-maintenance-confirmations` | Detect and report | Scripts using `--old-key`/`--oldKey` or `entities decrypt-database --deactivate-maps` | Report that `--old-key`/`--oldKey` now require `--allow-unsafe-old-key`; prefer `TENANT_DATA_ENCRYPTION_OLD_KEY` from a secret manager. `--deactivate-maps` requires `--confirm-offline-maintenance <tenantUuid>` with all writers stopped and every replica restarted afterwards |
61
+ | `search-presenter-badge-deprecated` | Detect and report | `badge` set in `presenter` objects in app `search.ts` / `vector.ts`; `SearchResultPresenter.badge` (`@open-mercato/shared/modules/search`), `VectorResultPresenter.badge` (`@open-mercato/shared/modules/vector`) | Report that `badge` is deprecated and slated for removal in 0.11.0. For entity-type labels, delete `badge` and add a `search.entityType.<module>.<entity>` key in the module's own `i18n/*.json`. Move per-record detail into `subtitle`. No runtime change yet |
62
+ | `scim-token-fingerprint` | No code action | N/A — operator migration and credential procedure | Apply the SSO migration before deploying the new code, and deploy every app/worker. Run the read-only `scim_tokens` inventory query. Enroll legacy tokens via a normal IdP sync, or rotate them via `POST`/`DELETE /api/sso/scim/tokens`, until no active unenrolled rows remain. Never log fingerprints or secrets |
63
+ | `signed-body-limits` | Detect and report | Clients posting to `POST /api/channel_discord/interactions` or `POST /api/agent_orchestrator/trace/ingest`; env var `OM_WEBHOOK_MAX_BODY_BYTES` | Report that bodies are capped at 1 MiB by default and overflow returns `413 { error: 'payload_too_large' }`. Trace runtime adapters must split oversized payloads, keep idempotency, and sign each body. Operators should align ingress limits or set a finite `OM_WEBHOOK_MAX_BODY_BYTES` |
64
+ | `search-encrypted-custom-fields` | Detect and report | Manual `new SearchIndexer(` construction; direct `SearchService.index`/`bulkIndex` calls | Report that manually constructed `SearchIndexer` must pass `encryptedCustomFieldKeysResolver` to enable exclusions. Direct clients can pass `IndexableRecord.plaintextExcludedCustomFields` (keys or `'all'`). Operators must reindex fulltext and vector data and review external provider copies |
65
+ | `ai-tool-direct-mutation-forbidden` | Detect and report | Clients calling `POST /api/ai_assistant/tools/execute` for tools declared `isMutation: true` | Report that direct mutation tool calls now return 403, including for superadmins. Migrate to `/api/ai_assistant/ai/chat` or `/api/ai_assistant/ai/run-object` with the tool allowlisted on the agent, following its mutation policy and confirmations. Operators should review earlier direct mutation writes |
66
+ | `nested-acl-wildcards-grant` | Detect and report | Nested wildcard feature strings (`<module>.<entity>.*`, e.g. `sales.order.*`, `catalog.product.*`, `auth.users.*`, `security.mfa.*`) in app `setup.ts` `defaultRoleFeatures`, seeded role/user ACLs, or authorization code that expects nested wildcards to be filtered out | Report that nested wildcards are no longer dropped by the enabled-module filter. They now resolve to their owning module and can grant access that was denied before. Exact grants, module wildcards (`security.*`) and global `*` behave as before. Operators must audit role and per-user ACLs before upgrading and replace unintended wildcards with explicit feature IDs. Module authors must use canonical scoped authorization. No migration needed |
67
+ | `workflow-step-execution-time-deprecated` | Detect and report | Reads of `executionTimeMs` on `StepInstance` or SQL on `step_instances.execution_time_ms`; uses of `OM_WORKFLOWS_MAX_CONDITION_ATTEMPTS`; workflow definitions with long synchronous `WAIT` activities | Report that `StepInstance.executionTimeMs` is `@deprecated`, is `null` for steps over 2^31 − 1 ms, and is scheduled for removal no earlier than 0.11.0. Derive duration from `exitedAt - enteredAt`, or read `eventData.executionTimeMs` on the `STEP_EXITED` event. A sync `WAIT` over one minute that is the last activity of its transition is now queued. A sync `WAIT` over ~24.8 days anywhere else now fails. `OM_WORKFLOWS_MAX_CONDITION_ATTEMPTS` is now only the floor of the poll cap |
68
+ | `mcp-http-loopback-default` | Detect and report | `mcp:serve-http`, `yarn mcp:serve`, `mcp:dev`, `yarn mcp:dev`, `runMcpHttpServer`, `runMcpDevServer` reached over a non-loopback address; an `mcp` service in app Docker Compose files without `MCP_HTTP_HOST`; app `scripts/dev.mjs` / `scripts/dev-mcp.mjs` without `resolveDevMcpHost` | Report that both MCP servers now bind `127.0.0.1` by default. Callers that connect from outside host loopback (compose network, proxy, sidecar) need `--host` / `MCP_HTTP_HOST` (production) or `MCP_DEV_HOST` (dev). The shipped compose files set `MCP_HTTP_HOST: "0.0.0.0"` on the `mcp` service. Apps scaffolded before this release must copy `resolveDevMcpHost` into their `scripts/dev.mjs` / `scripts/dev-mcp.mjs` |
69
+ | `passkey-enrollment-webauthn-required` | Detect and report | Client code or test fixtures calling `PUT /api/security/mfa/provider/passkey` with `{ credentialId, publicKey, challenge }` | Report that the legacy shortcut now returns `400`. Clients must call `POST /api/security/mfa/provider/passkey`, pass its `clientData` to `navigator.credentials.create` (or the SimpleWebAuthn helper), then send `{ setupId, payload: { response, label? } }` to `PUT`. Fixtures that invent public keys need a real or virtual authenticator. Operators should audit passkeys of uncertain provenance and re-enroll them through a trusted ceremony, keeping alternate MFA/recovery access. No migration |
70
+ | `organization-create-undo-tombstone` | Detect and report | App code that queries raw organization rows (`Organization` entity / `directory_organizations` table) to list active organizations without a `deletedAt`/`deleted_at` filter | Report that undoing organization creation now leaves a soft-deleted, deactivated tombstone that keeps its slug. Raw-row readers must exclude soft-deleted records. Supported list APIs already do. No migration. A code rollback does not remove tombstones |
71
+ | `web-research-redirect-domain-rules` | Detect and report | Custom web-research adapters (`@open-mercato/web-research-*`), custom HTTP clients built on `HttpRequestInit`, and adapter descriptors built against `CONTRACT_VERSION` | Report that custom HTTP clients must honor the new optional `HttpRequestInit.assertUrlAllowed(url)` callback and await it before DNS and transmission for the initial request and every redirect. Adapters rebuilt against the current `CONTRACT_VERSION` advertise version 2 and need a host that supports v2, so upgrade the host first. v1 adapters still work. With a nonempty domain allowlist or denylist, browser rendering is skipped and `render: 'always'` returns blocked |
72
+ | `warranty-claim-line-no-unique` | Detect and report | Client or integration code that creates or renumbers warranty claim lines with explicit line numbers, or handles `warranty_claims.errors.duplicateLineNo` | Report that a duplicate line number within a live claim now returns `409` with `code: warranty_claims.errors.duplicateLineNo`, including in initial batches. An undo that would restore an occupied number is refused, so free the number and retry. Existing duplicates are not renumbered. No migration |
73
+ | `workflow-webhook-response-limits` | Detect and report | Workflow definitions (code or seeded JSON) with `CALL_WEBHOOK` activities, especially ones without `timeoutMs` / `timeout` | Report that each attempt now has a default 30-second deadline and a 1 MiB response cap. Oversized or stalled responses fail the activity, and the retry policy still applies. Slow endpoints need an explicit `timeoutMs`. Large endpoints should return a small acknowledgement and move results to a separate retrieval step |
74
+ | `injection-registry-test-setup` | Detect and report | App tests that render `DataTable` with `perspective` or `extensionTableId`, or that call `useInjectionDataWidgets`, without calling `registerCoreInjectionWidgets` / `registerCoreInjectionTables` from `@open-mercato/shared/modules/widgets/injection-loader` | Report that tests and isolated hosts must register both injection registries before expecting rows. Tests without extensions can call `registerCoreInjectionWidgets([])` and `registerCoreInjectionTables([])` in setup. Application bootstrap already registers them |
75
+ | `customer-search-vector-rebuild` | Detect and report | App code that invokes customer vector/search builders directly without a source-context `container` that provides `tenantEncryptionService`; `TENANT_DATA_ENCRYPTION=false` in env (report name and file only) | Report that customer person, company and customer-account vector builders now embed only safe fields. Direct callers must supply `container` with `tenantEncryptionService`, otherwise vector writes are skipped. With `TENANT_DATA_ENCRYPTION=false`, person/company vector writes are skipped entirely. Existing embeddings are not removed: operators must run the purge-and-reindex procedure |
76
+ | `documents-attachment-access-resolvers` | Detect and report | App modules with `data/attachment-access.ts`; code that builds attachment read/link services without DI; app code reading `/api/attachments/file/*` or `/api/attachments/image/*` for documents owners | Report that host attachment routes now enforce Documents sharing and feature checks. `attachments.manage` or organization membership alone no longer grants access to an unshared document's files. Modules can export `attachmentAccessResolvers` and `protectedAttachmentTargets` from `data/attachment-access.ts` and must regenerate after changes. New adopters with existing partitions call `syncAttachmentAccessProtection(em)` during upgrade/setup. Non-DI service construction must provide lazy policy context, otherwise protected reads are denied. Operators run the additive attachments migration before serving the new binaries, then regenerate and build |
77
+ | `public-pay-link-allowlist` | Detect and report | Pay-page extensions or clients of `GET /api/checkout/pay/:slug` that read `logoAttachmentId`, `customFieldsetCode`, `templateId`, `maxCompletions`, `completionCount`, `activeReservationCount`, `isLocked`, `createdAt`, `updatedAt`, or email subject/body/send-flag fields | Report that the public response now returns an allowlist only. Read admin configuration from `GET /api/checkout/links/:id` (`checkout.view`), which is unchanged. On public pages use `logoPreviewUrl` / `logoUrl` and `remainingUses`. Never proxy the admin response to unauthenticated clients. Operators invalidate cached pay-link responses and review email templates for exposed content |
78
+ | `mcp-keys-user-binding` | Detect and report | Custom delegated-key issuers that call `createApiKey`; Business Rules "call Open Mercato" API-key profiles that use MCP keys | Report that new persistent MCP keys are capped by the owner's ACL. Custom delegated-key issuers should pass `sessionUserId` to `createApiKey`, and leave it unset only for independent machine keys. Regenerated MCP keys cannot serve as Business Rules API-key profiles. Operators must revoke and regenerate existing persistent MCP keys in AI Assistant settings and update client secrets |
79
+ | `custom-record-post-create-only` | Detect and report | Clients calling `POST /api/entities/records` with a client-supplied UUID as an upsert; callers of `DataEngine.createCustomEntityRecord` | Report that POST now returns `409` (`custom_entity_record_exists`) when the UUID already exists, including soft-deleted records. Upsert clients must read the record and `PUT` it with the `x-om-ext-optimistic-lock-expected-updated-at` header. `createCustomEntityRecord` still upserts by default, and the new optional `createOnly` flag gives conflict-on-existing behavior |
80
+ | `inbound-webhook-receipt-scope` | Detect and report | App code that does its own inbound webhook receipt lookups or dedup caches keyed by endpoint and message ID | Report that receipt dedup now keys on endpoint, message ID, tenant and organization. Include verified tenant/organization scope in any independent lookup or cache key. Operators apply `Migration20261027193000_receipt_scope` (PostgreSQL 15+, needs a table lock) before resuming inbound traffic |
81
+ | `interaction-author-owner-tenant` | Detect and report | Clients or app code writing customer interactions or legacy activities with author/owner user IDs | Report that foreign-tenant, missing or newly assigned deleted users now get a generic `400`. Send live same-tenant IDs, or `null` to clear optional references on canonical updates. Operators audit foreign-tenant or missing references before replaying command history. No migration |
82
+ | `scim-deactivation-blocks-signin` | Detect and report | App DI overrides that replace the `authService` registration | Report that apps replacing `authService` must keep the SSO module's scoped deactivation check in password verification and in atomic final session issuance. SCIM-deactivated identities are now denied SSO and password sign-in. Restore access through SCIM `active:true` |
83
+ | `scoped-attachment-cache-private` | No code action | N/A — HTTP cache-header behavior | Explain that scoped attachment byte routes now return `Cache-Control: private, max-age=60`. Operators purge shared caches for `/api/attachments/file/*` and `/api/attachments/image/*` (all variants) and make sure cache rules honor origin `private` |
84
+ | `dev-launcher-workspace-claim` | No code action | N/A — dev launcher runtime behavior | Explain that a second mutable `yarn dev` in the same checkout now exits non-zero. Run parallel sessions from separate checkouts and databases. `MCP_PORT` is now a preferred port with automatic fallback, and explicit `MCP_URL` / `OPENCODE_MCP_URL` still win |
85
+ | `dev-mcp-lazy-start` | Detect and report | Dev setups where a container calls the `yarn dev` MCP server with a user-created `omk_` key from a non-loopback peer; uses of `OM_DEV_MCP_TRUSTED_PEERS`, `OM_DEV_MCP_LAZY`, `OM_DEV_WITH_MCP` | Report that the dev MCP server now starts on its first non-health request. Untrusted peers presenting unknown keys get `401`. To allow a trusted container, set `OM_DEV_MCP_TRUSTED_PEERS` to exact IPs. Alternatives: use the provisioned key, connect via loopback, or set `OM_DEV_MCP_LAZY=0` for an eager start |
86
+ | `acl-live-row-canonicalization` | Detect and report | App code that reads `UserAcl` / `RoleAcl` / role memberships (`user_acls`, `role_acls`) without a `deletedAt: null` filter | Report that only live ACL rows and memberships grant access, and a super-admin grant must belong to the user's own tenant. Users with NULL `users.tenant_id` lose global super-admin. The migration soft-deletes duplicate ACL rows. Module authors must filter by `deletedAt: null`. Operators run the read-only audit SQL before deploying, give tenantless admins an owning tenant, drain old instances, and invalidate the shared RBAC cache or wait out its TTL |
87
+ | `traefik-overlay-private-ports` | Detect and report | App deployment files that use `compose.fullapp.traefik.yml`; health probes on `APP_PORT`; `NEXT_PUBLIC_DOCUMENTS_COLLAB_URL` | Report that the Traefik overlay no longer publishes the `app` or `documents-collab` host ports. Requires Docker Compose 2.24.4+. Recreate containers with the full file chain and move health probes to the public HTTPS hostname. For collaboration, set `NEXT_PUBLIC_DOCUMENTS_COLLAB_URL` to a `wss://` proxy URL before rebuilding |
88
+ | `search-encrypted-custom-fields-excluded` | Detect and report | `new SearchIndexer(` or `new VectorIndexService(` in app code without `encryptedCustomFieldKeysResolver`; search sources (`buildSource`, `formatResult`, `resolveUrl`, `resolveLinks`) that read encrypted custom fields | Report that search sources no longer receive encrypted custom fields. An indexer built without the resolver drops all custom fields. Resolve `searchIndexer` from DI, or pass `encryptedCustomFieldKeysResolver: createEncryptedCustomFieldKeysResolver(em.getKysely())` from `@open-mercato/search/di`. Operators reindex searchable entities that have encrypted custom fields and treat previously indexed values as disclosed |
89
+ | `duplicate-module-ids-static-requires` | Detect and report | Duplicate `id` entries in `src/modules.ts` (including conditional registrations); `metadata.requires` in app module `index.ts` that is not a static string-literal array | Report that generation now rejects duplicate enabled module IDs: keep one provider per ID and rerun `yarn mercato generate`. `metadata.requires` must be a static array of string literals. npm preflight needs `npm` and registry access; offline operators install with Yarn, then run `yarn mercato module enable <packageName>` |
90
+ | `setup-docker-preflight` | Detect and report | CI scripts or docs in a generated app that run `yarn setup`, `setup:classic`, `setup:reinstall` or `setup:reinstall:classic` against self-managed PostgreSQL/Redis/Meilisearch | Report that `yarn setup` now starts Docker infrastructure first and exits `2` when Docker is unavailable or a port is taken. Add `--no-infra` to keep the old behavior. Optionally copy `scripts/infra.mjs`, `scripts/dev-infra-preflight.mjs` and the `infra:up` / `infra:down` `package.json` entries from a fresh scaffold |
91
+ | `ai-session-key-live-roles` | No code action | N/A — runtime authorization behavior | Explain that AI session keys now lose removed staff roles on the next request. After granting a new role, issue a fresh session key. Operators restart every process that authenticates API keys and should expect extra database reads. No migration |
92
+ | `cli-module-command-exit-code` | Detect and report | Scripts or CI steps that chain `yarn mercato <module> <command>` with `&&`, check `$?`, or run under `set -e`; app module CLI commands that set `process.exitCode` | Report that module commands now exit with the code they set via `process.exitCode`. For example, `mercato auth setup` with an invalid `--orgSlug` now exits `2`. Audit bootstrap and CI chains that were silently tolerating failures. Output lines are unchanged |
93
+ | `cart-line-busy-503` | Detect and report | Clients of `POST /api/cart/current/lines` and `POST /api/cart/current/lines/bulk` | Report that lock contention lasting the 15-second budget now returns `503` with `code: "cart_busy"` and `Retry-After: 1`. Wait at least one second, then retry with the same body and `Idempotency-Key`. Do not apply this retry rule to other `500`s |
94
+ | `module-runtime-requires` | Automatic when exact; otherwise report | `src/modules.ts` enables `customers` without `progress` / `dictionaries` / `feature_toggles`, `portal` without `customer_accounts` / `feature_toggles`, or `workflows` without `business_rules` | Insert the missing `{ id: '<module>', from: '@open-mercato/core' },` entries (`progress`, `dictionaries`, `feature_toggles`, `business_rules`, `customer_accounts` as applicable) immediately before the exact single-line dependent entry; otherwise report the lines to add. `yarn generate` now fails with `Module dependency check failed` without them. Rerun `yarn generate` |
95
+ | `requires-read-syntactically` | Detect and report | App module `index.ts` files whose exported `metadata.requires` is computed, spread or re-exported rather than a literal string array | Report that `metadata.requires` is now parsed without executing module code. A non-literal list is skipped with a `[generate] ⚠` warning, and that module's dependency check does not run. Write it as a string-literal array. If `yarn generate` fails with `Module dependency check failed`, enable the listed modules |
96
+ | `portal-form-subject-own-customer` | Detect and report | Portal pages that pass a `subjectType` other than `customer` to `EmbeddedForm` / `FormRunner` or through the portal continue page `subjectType` query parameter; clients of `POST /api/forms/form-submissions` | Report that portal submissions now return `403 SUBJECT_FORBIDDEN` unless the subject is the caller's own `customer` id. Start on the caller's own customer subject, or have staff assign actors via `POST /api/forms/submissions/:id/actors`. Operators review earlier cross-subject submissions with the provided SQL; nothing is rewritten |
97
+ | `staff-user-create-org-scope` | Detect and report | Scripts or API-key integrations calling `POST /api/auth/users` or the `auth.users.create` command with an organization-restricted principal; calls to `resolveUserDestinationRoles` from `@open-mercato/core/modules/auth/lib/grantChecks` | Report that creating a user in an organization outside the caller's scope now returns `403`. Grant the principal the target organizations or use an unrestricted principal. `targetUserId` of `resolveUserDestinationRoles` is now optional (additive change) |
98
+ | `ai-baseurl-allowlist-scheme-port` | Detect and report | `AI_RUNTIME_BASEURL_ALLOWLIST` in app env/compose files (report name and file only) | Report that entries now match scheme, hostname and port, and a bare host means HTTPS on 443. List other origins as `scheme://host[:port]` (e.g. `http://localhost:11434`). Saved base URLs that no longer match are ignored and the provider default endpoint is used. Update the allowlist before upgrading |
99
+ | `staff-support-tickets-seed` | Detect and report | Apps that enable the `staff` and `customer_accounts` modules with existing tenants; widgets targeting `staff.time_tracking.settings:tabs`; use of `staffTimeTaskCommentUpdateSchema` | Report that existing tenants must run `yarn mercato staff seed-support-defaults --tenant <tenantId> --org <organizationId>` once per organization, plus `yarn mercato customer_accounts sync-customer-role-acls`. `auth sync-role-acls` is not required. Additive surfaces: spot `staff.time_tracking.settings:tabs`, optional comment `visibility`, `staffTimeTaskCommentUpdateRequestSchema`, `support.referencePrefix` |
100
+ | `attachments-unpaged-limit-100` | Detect and report | Calls to `GET /api/attachments` with `entityId`/`recordId` but no `page`/`pageSize`, especially code that sends loaded IDs back to a save that removes missing attachments | Report that the unpaginated form now returns only the newest 100 attachments. Callers that need every attachment must pass `page` and `pageSize` (at most 100) and request pages until `totalPages` is reached |
101
+ | `tenant-global-catalogue-null-scope` | No code action | N/A — index storage and search read-path behavior | Explain that `reindexEntity()` now writes the projections of catalogues declared through `registerTenantGlobalEntityTypes()` under `tenant_id = NULL, organization_id = NULL`, and that `@open-mercato/search` readers include them through a branch gated on the declaration. Vector work keeps the caller's scope. Module authors need nothing beyond the declaration. Operators must reindex each declared catalogue once after upgrading (`feature_toggles:feature_toggle` plus any type the app's modules declare). The sweep retires caller-scoped copies; the note's manual `DELETE` from `entity_indexes` / `search_tokens` / `entity_index_coverage` is an equivalent cleanup, safe only once the canonical rows exist |
102
+ | `tenant-less-reindex-refused` | Detect and report | Entity types the app indexes whose source table has no `tenant_id` column; existing calls to `registerTenantGlobalEntityTypes` from `@open-mercato/core/modules/query_index/lib/tenant-global`; the log text `Refusing tenant-scoped reindex of a table with no tenant_id column` | Report that a tenant-scoped reindex of a table with no `tenant_id` column now returns an empty result with `refused: 'no-tenant-column' \| 'column-probe-failed'`. It logs a warning, writes a `warn` row to `indexer_status_logs`, and the CLI prints `reindex REFUSED, nothing was indexed`. For per-tenant data, the author must add a `tenant_id` column or index through the event path only. For a platform-wide catalogue, call `registerTenantGlobalEntityTypes('<module>:<entity>')` during module registration (usually `di.ts`). The declaration alone no longer grants global scope: ORM metadata and physical columns must prove both scope columns are absent. Existing private projections are quarantined automatically. Restart app and worker processes after schema migrations. Schema-qualified queries that need the basic fallback are now refused. Operators may optionally delete quarantined `entity_indexes` / `search_tokens` / `entity_index_coverage` rows for the affected types |
103
+ | `customer-create-form-canonical-hosts` | Detect and report | Widgets targeting `crud-form:customers.customer_entity`, `crud-form:customers.person`, or `crud-form:customers.deal` (including their `:fields` spots), and record-scoped widgets that read `recordId` | Report that person creation now publishes `crud-form:customers.person` and still bridges `crud-form:customers.customer_entity` through `legacyInjectionSpotId`. New registrations should use the canonical host. Header widgets registered on both hosts still render twice. Deal creation now uses `CrudForm` on `crud-form:customers.deal`. Create hosts have no `recordId` before the native save, so record-scoped widgets must tolerate a missing id. `onAfterSave` receives the new identity. No migration |
104
+ | `cart-promotions-modules-acl-sync` | No code action | N/A — new modules plus an operator ACL step | Explain the new `cart` and `promotions` modules and that the cart write path now enforces buyer-scoped catalog visibility. Existing tenants must run `yarn mercato auth sync-role-acls`, otherwise staff get `403` on the new UI. To show the "Promotions" menu, run `yarn mercato configs cache structural --all-tenants`. Sweeper schedules show up as pending upgrade actions (`configs.manage`) once the app reports `0.10.0` (the actions are gated at `0.9.1`) |
105
+ | `login-cross-site-403` | Detect and report | Browser code on another origin that posts to `/api/auth/login`, `/api/auth/session/refresh`, `/api/customer_accounts/login`, `/api/customer_accounts/magic-link/verify`, or `/api/customer_accounts/invitations/accept`; env vars `APP_URL`, `NEXT_PUBLIC_APP_URL`, `APP_ALLOWED_ORIGINS` | Report that these routes now answer `403` to cross-site browser requests. `Sec-Fetch-Site: cross-site` is always rejected, and otherwise `Origin` must match `APP_URL`, `NEXT_PUBLIC_APP_URL`, `APP_ALLOWED_ORIGINS`, or `X-Forwarded-Host` / `Host`. Cross-site sign-in forms must move to the app's own origin or call the API from a server. Sibling subdomains need an `APP_ALLOWED_ORIGINS` entry. Operators: set `APP_URL` to the public origin or make the reverse proxy forward `X-Forwarded-Host` |
106
+ | `web-research-browser-egress` | Detect and report | Env var `OM_WEB_RESEARCH_BROWSER_FILTER_SUBRESOURCES`; uses of `filterSubresources` on `SidecarState` or as an `installNavigationGuard` option | Report that all browser sidecar egress is now limited to public addresses, so intranet assets no longer load. `OM_WEB_RESEARCH_BROWSER_FILTER_SUBRESOURCES` is ignored and logs a warning; remove it. `filterSubresources` is `@deprecated` and has no effect. `installNavigationGuard` now throws `SidecarError` (kind `init`) when `context.route()` is unavailable |
107
+ | `cross-process-listener-envelopes` | Detect and report | Calls to `registerCrossProcessEventListener` from `@open-mercato/events/bus`; listener code comparing `originPid` | Report that listeners now also receive `portalBroadcast`-only events. Oversize browser-facing envelopes now arrive as `{ truncated: true, id, entityId, entityType }`. Listeners should filter by flag (`isBroadcastEvent`, `isPortalBroadcastEvent`), tolerate `payload.truncated === true`, and detect their own echo with `envelope.originInstanceId === CROSS_PROCESS_EVENT_INSTANCE_ID` instead of `originPid`. The portal stream now treats trusted emit scope as authoritative |
108
+ | `catalog-out-of-scope-404` | Detect and report | Code or tests expecting `403` from `PUT`/`DELETE` on `/api/catalog/products`, `/api/catalog/variants`, `/api/catalog/prices`, `/api/catalog/offers`, from `POST /api/catalog/variants`, or from the `catalog.products\|variants\|prices\|offers.update\|delete` commands | Report that records outside the caller's tenant or organization now answer `404` instead of `403`. This also applies to catalog product bulk-delete jobs and to commands run with `auth: null` plus `organizationScope`. Treat `404` as "not reachable". Shapes are unchanged |
109
+ | `price-kind-display-mode-omission` | Detect and report | Callers of `PUT /api/catalog/price-kinds` or the `catalog.priceKinds.update` command that omit `displayMode`; uses of `priceKindUpdateSchema` | Report that an omitted `displayMode` is now left unchanged instead of being reset to `excluding-tax`. A caller that relied on the reset must send `displayMode: 'excluding-tax'`. Price kinds already flipped are not repaired; check them in the catalog price kind settings |
110
+ | `integration-state-default-enabled` | No code action | N/A — runtime behavior fix | Explain that `integrationStateService.upsert` now creates missing state rows with the integration's `defaultState`. Send `isEnabled: false` explicitly to create a disabled row. Operators should check **Excel / CSV Import** and **Custom Webhooks** in each organization and re-enable them if an earlier write turned them off |
111
+ | `reaction-toggle-not-found` | Detect and report | Exhaustive switches over `ToggleOutboundReactionResult` (`communication_channels.reaction.toggle_outbound`), code treating `no_channel_link` as a missing message, and clients asserting `403`/`409` from `/api/communication_channels/messages/:messageId/reactions` | Report that both reaction routes now answer `404` for messages outside the caller's personal mailbox or scope. The result type gains a `not_found` member; handle it alongside `no_channel_link`. `409` remains for non-channel-linked messages and duplicate reactions |
112
+ | `forms-participant-pdf-role-slice` | Detect and report | Calls to `PdfSnapshotService.ensureSnapshot(` or `readSnapshot(` that serve a PDF to a request principal | Report that `GET /api/forms/public/submissions/:id/pdf` now returns a role-filtered PDF with `cache-control: private, no-store`. Code serving snapshots to a viewer should call `readSnapshotForViewer({ organizationId, tenantId, submissionId, viewerRole })`. `ensureSnapshot` / `readSnapshot` still return the full snapshot |
113
+ | `notification-href-origin` | Detect and report | Notification `linkHref` / action `href` values built in app code; `notificationService.create*` calls; custom delivery strategies; `NotificationHandlerContext.navigate(` | Report that hrefs must now resolve to the application origin. Backslashes, control characters, other origins, or paths starting with `//` give `400` or a throw, and stored unsafe hrefs are served as `null`. Custom delivery strategies should pass hrefs through `toSafeNotificationHref` (`@open-mercato/core/modules/notifications/lib/safeHref`). The predicate `isSafeNotificationHref` is available from `@open-mercato/shared/modules/notifications/safeHref`. Valid `/backend/...` paths need nothing |
114
+ | `eudr-undo-refusal-code` | Detect and report | Clients calling `POST /api/audit_logs/audit-logs/actions/undo` for `eudr.statements.create\|update` that match on the `error` text | Report that undo now refuses read-only statements with `409` and `code` `eudr.errors.archivedReadOnly`, `eudr.errors.amendWindowElapsed`, or `eudr.errors.referencedDownstream`. Match on `code`, not `error` |
115
+ | `akeneo-media-size-bounds` | Detect and report | Env vars `OM_ATTACHMENT_MAX_UPLOAD_MB`, `OM_ATTACHMENT_TENANT_QUOTA_MB`, `OM_INTEGRATION_AKENEO_REQUEST_TIMEOUT_MS`, `OM_INTEGRATION_AKENEO_MAX_RESPONSE_BYTES`; code reading `contentLength` from `downloadMediaFile()` or catching `AkeneoResponseTooLargeError` | Report that Akeneo media now go through the attachment upload path. Media over the size limit, active content, and executables are skipped with a `sync_akeneo.media_rejected` warning. Imports count against the tenant quota. The request timeout now covers the whole body. Responses over the max bytes throw `AkeneoResponseTooLargeError`. `downloadMediaFile().contentLength` is now the number of bytes received. Operators may raise the quota or timeout, and should check for rejection warnings after the first sync |
116
+ | `oauth-grant-id-suffix` | Detect and report | Integration or bundle ids registered by the app that end in `__oauth_grant` | Report that the suffix is now reserved. `/api/integrations/:id/credentials` answers `404` for such ids, and credential resolution no longer falls through to such a `bundleId`. Rename the id |
117
+ | `attachment-shared-storage-release` | Detect and report | Calls to `releaseScoped(` with `{ flush: false }`; app code that deletes `Attachment` rows and their stored files directly | Report that a stored file is now removed only when no other row references it. Calling `releaseScoped(..., { flush: false })` outside a transaction is deprecated (kept for at least one minor release, logs `[deprecated]`). Call it inside `withAtomicFlush(em, [...], { transaction: true })` and run the returned cleanup after commit. For manual deletes, use `removeAttachmentRecord(em, attachment)` from `@open-mercato/core/modules/attachments/lib/storageReferences` and delete the file only when it reports `releaseStorage: true`. Concurrent losing deletes now get `404`. A migration adds `attachments_storage_reference_idx` (built `CONCURRENTLY`) |
118
+ | `webhook-credential-header-redaction` | Detect and report | Clients reading `customHeaders` from `GET`/`PUT /api/webhooks/:id`; deep imports of `serializeWebhookDetail` from `webhooks/api/helpers` | Report that credential-like header values now show as `••••••••` without `webhooks.secrets`. To keep a value, send `••••••••` back. To change it, send a new value. To delete it, omit the key. A caller without `webhooks.secrets` that changes the URL while keeping a credential header gets `400`. `serializeWebhookDetail()` redacts unless given `{ revealCredentialHeaders: true }`. Grant `webhooks.secrets` to roles that need the stored values |
119
+ | `workflow-call-api-origin` | Detect and report | Workflow definitions (code or seeded JSON) with `CALL_API` activities using absolute endpoints, a hard-coded scheme, or non-`/api/` paths | Report that endpoints must now match `APP_URL`'s exact origin and sit under `/api/` (or `<base path>/api/`), including on every redirect hop (at most three). Embedded credentials are refused. Use a relative `/api/...` path or `{{env.APP_URL}}/api/...`. Do not edit workflow definitions automatically |
120
+ | `mcp-tools-list-acl-pending-actions` | Detect and report | Env vars `MCP_SERVER_API_KEY`, `OM_MCP_MUTATION_MODE`, `OM_MCP_TOOL_ALLOWLIST`, `OM_MCP_TOOL_DENYLIST`, `OM_MCP_AGENT_TOOLS`, `OM_MCP_PENDING_ACTION_TTL_SECONDS` (names only); custom clients of `/api/ai_assistant/ai/actions/:id` and its `/confirm` / `/cancel` | Report that MCP `tools/list` is now filtered by ACL, so a server key with no roles lists only `context_whoami`. Grant roles to a hand-set key, or send `x-om-session-token`; check with `yarn mercato ai_assistant mcp:list-tools --as-api-key <key>`. Pending actions are now owner-scoped (others get `404`); there is a new feature `ai_assistant.pending_actions.approve`. Recommend `OM_MCP_MUTATION_MODE=approval` in production. Requires `yarn db:migrate` (`Migration20261022130536_ai_assistant`) and `yarn mercato auth sync-role-acls`. Tool calls are now audited as `ai_assistant.mcp_tool_call` |
121
+ | `ai-agent-run-recording` | Detect and report | Calls to `runAiAgentText` / `runAiAgentObject` in custom runners that persist their own trace; agents with `executionEngine: 'tool-loop-agent'`; env vars `OM_AI_RUN_TRACE_CAPTURE`, `OM_AI_RUN_TRACE_CAPTURE_PROMPT`, `OM_AI_RUN_TRACE_MAX_PAYLOAD_BYTES`, `AI_AGENT_RUNS_RETENTION_DAYS` | Report that agent runs are now recorded in new encrypted tables (`Migration20261026192929_ai_assistant`, applied by `yarn db:migrate`). Custom runners must pass `trace: { persist: false }` or runs are recorded twice. `tool-loop-agent` agents now receive their system prompt; recheck prompt-level workarounds. New features `ai_assistant.runs.view` / `.runs.view_all` require `yarn mercato auth sync-role-acls`. Refresh the structural cache so the prune schedule registers. Read tools may call `emitCitations` |
122
+ | `agent-invoke-required-features` | Detect and report | `requiredFeatures` in `defineAgent` or `AGENT.md` frontmatter; `INVOKE_AGENT` workflow steps; clients of `POST /api/ai_assistant/ai/run-object` reading `runId`; `defineAgentTool` / `mcpTool`; reads of stored guardrail set bodies with `guardrailSetBodySchema`; env vars `OM_AGENT_INVOKE_ENFORCEMENT`, `OM_AGENT_API_ENABLED`, `OM_AGENT_INTEGRITY` | Report that agents declaring `requiredFeatures` are now enforced at every entry point (`403 agent_invoke_denied`); the roles and workflow grants that run them must hold those features (`OM_AGENT_INVOKE_ENFORCEMENT=off` downgrades the check to a warning). `run-object` now dispatches Agent Orchestrator agents through the orchestrator and returns `agentRunId`, with `runId: null`. Read stored set bodies with `agentGuardrailSetBodySchema`. The agent-token door and `integrity` rules are opt-in |
123
+ | `agent-llm-span-metadata-otel` | Detect and report | Code reading `inputTokens` / `outputTokens` / `finishReason` from `llm` span attributes; custom roles that should manage trace capture; env vars `OM_AGENT_TRACE_CONTENT_DEFAULT`, `OM_AGENT_TRACE_CONTENT_MAX`, `OM_AGENT_OTEL_EXPORT`, `OM_AGENT_OTEL_EXPORT_ENDPOINT` | Report that `llm` spans now carry `gen_ai.*` / `om.*` metadata; read it with `readLlmSpanMetadata`. Changing the capture policy needs the new feature `agent_orchestrator.trace.view_content`; grant it to custom roles that manage capture. OTel export is opt-in; backfill with `yarn mercato agent_orchestrator otel:export`. The `moduleConfigService` cache key changed (no action) |
124
+ | `agent-principals-integrity-routing` | Detect and report | Callers of the `agentPrincipalService.resolve` DI service; `defineAgent({ principal })`; agents relying on auto-approval with `holdsAutoApproval` rules; clients of `/api/agent_orchestrator/identity/token` and `/identity/agent/auth`; env vars `OM_AGENT_TOOL_ACL_MODE`, `OM_AGENT_TRACE_CONTENT_MAX_BYTES`, `OM_AGENT_EVAL_TOOL_FIXTURE_MAX_BYTES` | Report the following. `Migration20261028052954_audit_logs` adds a GIN index (it can be created concurrently before deploy on large `action_logs`). Run `yarn mercato auth sync-role-acls` for `ai_assistant.runs.view` / `.view_all`. The identity routes are now public; bad credentials get `401 invalid_client`. Agents with a declared principal act as it (provision with `yarn mercato agent_orchestrator principals:sync`). `agentPrincipalService.resolve` returns `null` for a disabled principal. Review `holdsAutoApproval` rules. Full trace content capture needs a tenant storage integration. New production dependency `yaml` 2.9.0 in `@open-mercato/enterprise` |
125
+ | `otel-content-export-section-search` | Detect and report | Env vars `OM_AGENT_OTEL_EXPORT_CONTENT`, `OM_AGENT_OTEL_EXPORT_PROTOCOL`, `OM_AGENT_OTEL_EXPORT_TENANT_ENDPOINTS`, `OM_AGENT_OTEL_EXPORT_PRIVATE_HOSTS`; `releaseScoped(` with `{ flush: false }`; `SearchEntityConfig.shouldIndex` | Report that OTel content export, protobuf, and per-tenant endpoints are all opt-in. `releaseScoped(..., { flush: false })` may return a search-only cleanup callback, which callers must invoke after commit. `shouldIndex` is an optional per-record gate. Per-section document search is off by default; when enabled, section text is sent in plaintext. Rolling deploys: drain the `attachments-document-structure` queue or roll workers before web nodes (new `section-search` job kind) |
126
+ | `agent-tool-scope-release-event-search-viewer` | Detect and report | Agent `tools` allowlists; `releaseScoped(` with `{ flush: false }`; `searchService.search(` calls without `viewer`; `SearchEntityConfig.filterResults`; env var `OM_ATTACHMENT_OCR_MAX_CONCURRENCY` | Report the following. `tool_scope` now blocks native runs that call tools outside the agent's effective allowlist; make sure each agent's `tools` lists every tool it calls. OpenCode runs now run base output guardrails. With `flush: false`, `releaseScoped` always returns a cleanup callback, which must be invoked after commit or `attachments.attachment.deleted` is never emitted. OCR now runs on the `attachments-ocr` queue, so a worker must consume it. `search()` without `viewer` no longer returns section hits; pass `viewer` when searching for a user. Re-run `mercato audit_logs projections:backfill` without `--force` if it was run before. Grant `agent_orchestrator.identity.manage` to roles that should sync principals |
127
+ | `mcp-invalid-mutation-mode-fatal` | Detect and report | Env var `OM_MCP_MUTATION_MODE` (report name, file and whether its value is outside `direct`/`deny`/`approval`); calls to `collectMcpExposureWarnings` | Report that an invalid value now stops `mcp:serve`, `mcp:serve-http`, `mcp:dev`, and `mcp:list-tools --effective` from starting; non-server readers treat it as `deny`. Fix it on every MCP host before upgrading. `collectMcpExposureWarnings` is deprecated in favour of `findMcpExposureConfigError` / `assertValidMcpExposureConfig` |
128
+ | `mcp-agent-tool-rate-limit` | Detect and report | MCP clients calling agent tools (`defineAgentTool` / `mcpTool`) in bulk; env vars `RATE_LIMIT_AI_AGENT_TOOL_POINTS`, `RATE_LIMIT_AI_AGENT_TOOL_DURATION`, `RATE_LIMIT_AI_AGENT_TOOL_BLOCK_DURATION`, `RATE_LIMIT_ENABLED` | Report that agent tool calls over MCP and `/tools/execute` are now limited to 30 per 60 s per tenant and key by default (`RATE_LIMITED` / `429`; `RATE_LIMIT_UNAVAILABLE` / `503`). Raise `RATE_LIMIT_AI_AGENT_TOOL_POINTS` for bulk clients |
129
+ | `staff-capacity-provider-async` | Detect and report | Calls to `resolveTimesheetCapacity` or `timeCapacityResolver.resolveCapacity`; overrides of the `timeCapacityResolver` DI key; `CapacityProvider` implementations | Report that both sync APIs are `@deprecated` and never consult `resolveAsync`; recommend `resolveTimesheetCapacityAsync` / `resolveCapacityAsync`. Providers may add `resolveAsync` and `label` / `labelKey`. Validation is now stricter, and invalid answers fall back to the built-in. An override implementing only `resolveCapacity` still works; replace `resolveCapacityAsync` too to report `isBuiltIn` |
130
+ | `time-tracking-entry-mode-key` | Detect and report | `registerTimeTrackingSettingKey({ group: 'defaults', key: 'entryMode'`; exhaustive `Record<TimeTrackingSettingKey, …>`; tests counting `TIME_TRACKING_SETTING_KEYS` | Report that the new built-in `defaults.entryMode` (`'task' \| 'project'`) makes a conflicting contribution throw at load, so rename it. Add an entry for `'defaults.entryMode'` to exhaustive records. `timeEntryDialogPropsSchema` is now exported from `@open-mercato/core/modules/staff/lib/time-tracking-ui/TimeEntryDialog` |
131
+ | `timereporting-last-project-id-deprecated` | Detect and report | Reads or writes of `TimeReportingSettings.lastProjectId` | Report that the field is deprecated and still dual-written for at least one minor version. The shared preference (`GET`/`PUT /api/staff/timesheets/my-preferences` or the `useTimesheetPreference` hook) wins on read, so writing the legacy field alone may not change the preselection. Move to the shared preference before the field is removed |
132
+ | `staff-segment-backfill-irreversible` | No code action | N/A — data migration | Explain that `Migration20260826193000_staff_segment_orphan_backfill` stamps the segments of soft-deleted entries, and its `down()` is a no-op. Take a backup first if the pre-repair rows may be needed; the note's count query sizes the repair |
133
+ | `staff-entries-totals-footer` | Detect and report | Component replacements of `staff.entries_summary_footer`; clients of `GET /api/staff/timesheets/time-entries` | Report the additive `includeTotals=true` → `totals`. The footer now renders inside the table through `data-table:staff.time_entries.list:footer`. Replacements can read `props.totals` (null when unavailable) and may want to drop their outer border. New optional `showActiveFilterChips` prop on `DataTable` / `FilterBar` |
134
+ | `sales-quote-enrichers-detail-hosts` | Detect and report | Response enrichers targeting `sales:sales_quote` or a wildcard; widgets registered on `detail:sales.order:stage-bar`, `detail:sales.order:closure`, `detail:sales.quote:stage-bar`, `detail:sales.quote:closure` | Report that quote reads now run quote-targeted and wildcard enrichers, and these four spots now mount real hosts, so previously dormant code may start running. Review feature gates, scoping, and order/quote assumptions. No migration |
135
+ | `planner-availability-invalid-window` | Detect and report | Callers of `POST /api/planner/availability-weekly` or `POST /api/planner/availability-date-specific` sending `24:00`, overnight windows, or impossible dates | Report that one invalid window now refuses the whole request with `400` (`planner.availability.errors.invalidWindow`) and nothing is written. Split overnight windows, use `23:59`, send only real dates, and resend the full corrected set. Lost hours are not restored. No migration |
136
+ | `time-project-employees-membership` | Detect and report | Clients of `GET /api/staff/timesheets/time-projects/{id}/employees` | Report that callers who are neither members of the project nor holders of `staff.timesheets.projects.manage` now get `404` (`reason: "no_project_access"`). This is a bug fix; do not route around it |
137
+
138
+ ## Workflow
139
+
140
+ ### 1. Gate the target
141
+
142
+ Resolve `--path`, require a regular `package.json`, and confirm at least one dependency or development dependency starts with `@open-mercato/`. Refuse to run when the target has the framework monorepo signature, including its core and shared workspace packages.
143
+
144
+ Inspect installed and pinned Open Mercato versions. Continue when they resolve to `0.10.0`; otherwise warn with the detected versions and require explicit user confirmation before edits. A dry run may continue without confirmation.
145
+
146
+ Exclude `.git/`, `node_modules/`, `.yarn/`, `.next/`, `dist/`, `build/`, `coverage/`, `.mercato/generated/`, generated registries, vendor directories, and framework-owned packages from every scan. Follow symlinks neither while scanning nor editing. Never print environment-variable values or other secret-bearing content: for every check that inspects an environment variable, report only its name, file, and line (and, for `OM_MCP_MUTATION_MODE`, only whether the value is outside `direct`/`deny`/`approval`).
147
+
148
+ ### 2. Build and show the plan
149
+
150
+ Run every selected detection before editing. Report each match as `{checkId, file, line, classification, proposedAction}`. Distinguish exact automatic matches from detect-and-report candidates, and list every no-code-action reminder even when no file match applies.
151
+
152
+ For `module-runtime-requires`, the required modules are:
153
+
154
+ | Enabled module | Must also be enabled |
155
+ | --- | --- |
156
+ | `customers` | `progress`, `dictionaries`, `feature_toggles` |
157
+ | `portal` | `customer_accounts`, `feature_toggles` |
158
+ | `workflows` | `business_rules` |
159
+
160
+ An automatic match requires a regular `src/modules.ts` containing exactly one single-line object literal with `id: '<dependent>'` (or the double-quoted equivalent) and `from: '@open-mercato/core'`, and no entry anywhere in the file for the missing module id. A dependent entry spread across lines, built conditionally, pushed at runtime, or loaded from another file is a detect-and-report candidate. A dependency already present in any position is left where it is — order does not affect the generator check.
161
+
162
+ With `--dry-run`, print the complete plan, all no-code-action reminders, and unresolved manual work, then stop without edits, package-manager commands, generation, tests, or builds.
163
+
164
+ ### 3. Apply bounded edits
165
+
166
+ Ask for confirmation of the displayed plan. Apply one minimal, idempotent edit per exact match:
167
+
168
+ - Insert `{ id: '<missing>', from: '@open-mercato/core' },` on its own line immediately before the exact dependent entry in `src/modules.ts`, once per missing module id, copying that line's indentation, quote style, and trailing-comma convention. When two dependents need the same module (`feature_toggles` for both `customers` and `portal`), insert it once, before the first of them.
169
+
170
+ Preserve file encoding, line endings, and unrelated formatting. Re-scan after editing: `src/modules.ts` must contain exactly one entry per required module id, while every manual candidate remains listed. Never perform repository-wide string replacement, and never run a database migration, a seed, an ACL sync, a reindex, or any other operator command without the user's explicit go-ahead.
171
+
172
+ ### 4. Verify
173
+
174
+ Use the package manager and scripts declared by the downstream app; do not assume monorepo-only commands exist. Run, in order when present:
175
+
176
+ 1. the configured generation script (this proves the `module-runtime-requires` dependencies are satisfied and surfaces duplicate module ids and non-literal `metadata.requires`);
177
+ 2. the configured typecheck script (this surfaces the exact-decimal `*Exact` fields, the new `ToggleOutboundReactionResult` member, the `defaults.entryMode` setting key and other type-level changes);
178
+ 3. the smallest affected test script, otherwise the configured test script;
179
+ 4. the configured build script.
180
+
181
+ Stop at the first new failure caused by an automatic edit, revert only that edit, and move the match to manual follow-up. Preserve and report pre-existing failures rather than rewriting unrelated code or weakening checks.
182
+
183
+ ### 5. Report
184
+
185
+ Report:
186
+
187
+ - the target path and detected Open Mercato versions;
188
+ - the complete pre-edit plan and user confirmation;
189
+ - every edited file grouped by automatic check ID;
190
+ - every detect-and-report finding, with exact file and line;
191
+ - every no-code-action reminder, no-match check, and skipped check;
192
+ - validation commands and outcomes;
193
+ - the operational follow-ups below that apply to the app, as an explicit checklist.
194
+
195
+ Report the actual number of selected checks run and record any exclusions, even when no code changes were required. Recommend reviewing the complete `0.9.0 → 0.10.0` section of `UPGRADE_NOTES.md` before deployment.
196
+
197
+ ## Operational follow-ups
198
+
199
+ Report these as unresolved operator work; never run them on the user's behalf without explicit confirmation.
200
+
201
+ - Run `yarn mercato agent_orchestrator trace-retention:schedule` for organizations that existed before the retention worker shipped, and watch for the error code `agent_orchestrator.trace_content_retention_delete_failed`.
202
+ - Raise `OM_AGENT_RUN_TIMEOUT_MS` if `OM_OPENCODE_RUN_TIMEOUT_MS` was raised. After raising `maxSteps` in an `AGENT.md`, run `yarn generate`.
203
+ - Optionally delete plaintext blobs left by earlier versions from the `agent-trace-content`, `agent-trace-artifacts` and `agent-run-artifacts` namespaces.
204
+ - Restore price kinds that earlier seeds soft-deleted, using the note's SQL, before `seed-examples`. Then check `is_active` and clear the CRUD/API cache or restart.
205
+ - Stop workflow writers and workers, update all replicas together, then inventory, cancel and audit event-labelled workflow instances.
206
+ - Restart app and worker processes together for the EUDR undo fix; restart all workers for the communication channel concurrency fix.
207
+ - Provide a unique tenant encryption key of at least 32 bytes or Vault (`VAULT_ADDR`/`VAULT_TOKEN`) plus a dedicated `LOOKUP_HASH_PEPPER` where required. Use HTTPS for remote Vault, keep old keys and pepper, never regenerate keys for existing data, and follow `starters/docker/encryption-migration.md`.
208
+ - After upgrading all workers, purge entities from indexes their strategy pins exclude.
209
+ - Set the `OM_CSP_CONNECT_ORIGINS` / `OM_CSP_SCRIPT_ORIGINS` / `OM_CSP_STYLE_ORIGINS` / `OM_CSP_FRAME_ORIGINS` env vars at build and runtime.
210
+ - Pass `--allow-remote-database=host:port/database` for non-loopback PostgreSQL during setup.
211
+ - Set a unique `OM_INIT_SUPERADMIN_PASSWORD` before production init or reinstall, and rotate a superadmin credential that was set predictably.
212
+ - Apply the private next-interaction forward-only data migration, rebuild the customer entity/profile query indexes, and rebuild fulltext/vector indexes.
213
+ - Refresh `scripts/dev.mjs` and add `scripts/dev-encryption-preflight.mjs` in standalone apps. Keep the original encryption keys and Forms master key. Reserve exit status `78` in a custom `SYNC_ROLE_ACLS_COMMAND`.
214
+ - Review earlier customer comment attribution changes.
215
+ - Back up before rolling back the money migrations; their `down()` narrows precision.
216
+ - Use `TENANT_DATA_ENCRYPTION_OLD_KEY` for key rotation. `--deactivate-maps` requires an offline maintenance window and a restart of every replica.
217
+ - Apply the SSO migration before deploying the new code. Then enroll or rotate legacy SCIM tokens until the inventory query returns no rows.
218
+ - Align ingress limits with the 1 MiB signed-body cap, or set `OM_WEBHOOK_MAX_BODY_BYTES`.
219
+ - Reindex fulltext and vector data after the encrypted custom-field exclusion fix, and review copies held by external providers.
220
+ - Find integrations that use `/api/ai_assistant/tools/execute` for writes, migrate them, and review earlier direct mutations.
221
+ - Audit role ACLs and per-user ACLs for nested wildcard grants before upgrading, and replace unintended ones with explicit feature IDs.
222
+ - Set `MCP_HTTP_HOST` / `--host` or `MCP_DEV_HOST` for MCP servers reached from outside host loopback.
223
+ - Audit passkeys of uncertain provenance and re-enroll them through a trusted ceremony, keeping alternate MFA access.
224
+ - Customer search vectors: deploy to every app and worker, pause and drain vector jobs, purge `customers:customer_person_profile`, `customers:customer_company_profile` and `customer_accounts:customer_user` per scope, then `POST /api/search/embeddings/reindex` with `purgeFirst: true`. Also run `POST /api/search/reindex` if `purgeEntity` was used. Review external provider retention.
225
+ - Run the additive attachments migration (`attachment_partitions.access_resolver_requirements` plus backfill) before serving the new binaries, regenerate and build, and purge CDN copies.
226
+ - Invalidate cached public pay-link responses and review email templates for exposed content.
227
+ - Revoke and regenerate persistent MCP keys, then update client secrets.
228
+ - Apply `Migration20261027193000_receipt_scope` on PostgreSQL 15+ (needs a table lock) before resuming inbound traffic.
229
+ - Audit foreign-tenant or missing interaction author/owner references before replaying command history.
230
+ - Purge shared caches for `/api/attachments/file/*` and `/api/attachments/image/*`.
231
+ - Run the read-only ACL audit SQL before deployment, give tenantless super-admins an owning tenant, drain old instances, and invalidate the shared RBAC cache or wait out its TTL.
232
+ - Use Docker Compose 2.24.4+, recreate containers with the full file chain, move app-port health probes to the HTTPS hostname, and set `NEXT_PUBLIC_DOCUMENTS_COLLAB_URL` to a `wss://` URL.
233
+ - Reindex searchable entities that have encrypted custom fields, and apply data-retention handling to previously indexed values.
234
+ - Use `yarn setup --no-infra` for self-managed infrastructure.
235
+ - Restart every process that authenticates API keys.
236
+ - Audit CI and bootstrap scripts that chain `yarn mercato` commands.
237
+ - Review portal form submissions on other subjects using the provided SQL.
238
+ - Update `AI_RUNTIME_BASEURL_ALLOWLIST` to `scheme://host[:port]` entries before upgrading.
239
+ - Run `yarn mercato staff seed-support-defaults --tenant <tenantId> --org <organizationId>` per organization, then `yarn mercato customer_accounts sync-customer-role-acls`.
240
+ - Reindex each declared global catalogue once after upgrade (`feature_toggles:feature_toggle` plus app-declared types); the manual SQL cleanup is optional
241
+ - Restart app and worker processes after schema migrations. Optional cleanup of quarantined `entity_indexes` / `search_tokens` / `entity_index_coverage` rows
242
+ - Run `yarn mercato auth sync-role-acls` for cart/promotions grants, then `yarn mercato configs cache structural --all-tenants`. Apply the pending cart/promotions upgrade actions
243
+ - Set `APP_URL`, `APP_ALLOWED_ORIGINS`, or reverse-proxy `X-Forwarded-Host` if users get a `403` on sign-in
244
+ - Remove `OM_WEB_RESEARCH_BROWSER_FILTER_SUBRESOURCES` from the environment
245
+ - Re-check and re-enable price kind display modes changed by partial updates
246
+ - Re-enable Excel / CSV Import and Custom Webhooks where an earlier write turned them off
247
+ - Tune `OM_ATTACHMENT_TENANT_QUOTA_MB` and `OM_INTEGRATION_AKENEO_REQUEST_TIMEOUT_MS`, and check `sync_akeneo.media_rejected` warnings after the first sync
248
+ - Migration adds `attachments_storage_reference_idx`, built `CONCURRENTLY`
249
+ - Grant `webhooks.secrets` to roles that must read stored credential header values
250
+ - Fix `CALL_API` endpoints in workflow definitions
251
+ - `yarn db:migrate` (`Migration20261022130536_ai_assistant`) and `yarn mercato auth sync-role-acls`. Make sure a hand-set `MCP_SERVER_API_KEY` key carries roles. Consider `OM_MCP_MUTATION_MODE=approval`, and add `ai_assistant.mcp_tool_call` to `AUDIT_LOGS_CORE_RESOURCE_KINDS_EXTRA` for longer retention
252
+ - `yarn db:migrate` (`Migration20261026192929_ai_assistant`), `yarn mercato auth sync-role-acls`, and refresh the structural cache so the `ai-agent-run-prune` schedule registers
253
+ - Grant `agent_orchestrator.trace.view_content` to custom roles that manage capture. Optional OTel backfill with `yarn mercato agent_orchestrator otel:export`
254
+ - `Migration20261028052954_audit_logs`: on large `action_logs` tables, pre-create the GIN index `concurrently`. Run `yarn mercato auth sync-role-acls` and `yarn mercato agent_orchestrator principals:sync`. Configure tenant storage for full content capture
255
+ - Drain the `attachments-document-structure` queue or roll workers before web nodes. Optionally run `mercato attachments structure search-sync --partition <code>`
256
+ - Run a worker consuming `attachments-ocr` and size `OM_ATTACHMENT_OCR_MAX_CONCURRENCY` per worker. Re-run `mercato audit_logs projections:backfill` without `--force`. Grant `agent_orchestrator.identity.manage`. Review `tool_scope` block rows
257
+ - Validate `OM_MCP_MUTATION_MODE` on every MCP host before upgrading
258
+ - Raise `RATE_LIMIT_AI_AGENT_TOOL_POINTS` for bulk MCP clients
259
+ - Back up before `Migration20260826193000_staff_segment_orphan_backfill` if pre-repair rows may be needed; its rollback is a no-op
260
+ - Re-enter availability hours already lost through invalid windows
261
+
262
+ ## Rules
263
+
264
+ - Every automatic edit must be exact, bounded, minimal, and idempotent; the only automatic edit in this window is adding required module ids to `src/modules.ts`.
265
+ - Never change dependency versions, lockfiles, generated output, vendor files, framework-owned packages, or secrets.
266
+ - Never rewrite workflow definitions, agent definitions or `GOVERNANCE.json`, ACL grants, encryption configuration, CSP configuration, money arithmetic, search sources, attachment access resolvers, or adapter code automatically — every such match in this window is intent-sensitive.
267
+ - Never regenerate, rotate, or print an encryption key, pepper, superadmin password, API key, or any other secret; report only the variable name, file, and line.
268
+ - Never weaken typecheck, tests, or build to make the upgrade appear green.
269
+ - Always show the edit plan before mutation and the exact changed-file list afterward.
@@ -174,7 +174,8 @@
174
174
  "om-auto-upgrade-0.6.6-to-0.6.7",
175
175
  "om-auto-upgrade-0.6.7-to-0.7.0",
176
176
  "om-auto-upgrade-0.7.0-to-0.8.0",
177
- "om-auto-upgrade-0.8.0-to-0.9.0"
177
+ "om-auto-upgrade-0.8.0-to-0.9.0",
178
+ "om-auto-upgrade-0.9.0-to-0.10.0"
178
179
  ]
179
180
  }
180
181
  }
@@ -47,6 +47,22 @@ function isModernYarnProject(appDir) {
47
47
  directory = parent;
48
48
  }
49
49
  }
50
+ const YARN_SETTING_UNREADABLE = "YARN_SETTING_UNREADABLE";
51
+ function yarnSettingError(message) {
52
+ return Object.assign(new Error(message), { code: YARN_SETTING_UNREADABLE });
53
+ }
54
+ function isYarnSettingError(error) {
55
+ return error instanceof Error && "code" in error && error.code === YARN_SETTING_UNREADABLE;
56
+ }
57
+ function parseYarnConfigValue(setting, stdout) {
58
+ const output = stdout.trim();
59
+ if (output === "" || output === "undefined") return void 0;
60
+ try {
61
+ return JSON.parse(output);
62
+ } catch {
63
+ throw yarnSettingError(`Yarn setting ${setting} returned output that is not JSON.`);
64
+ }
65
+ }
50
66
  function yarnNpmConfiguration(appDir, packageName, temporaryDir) {
51
67
  if (!isModernYarnProject(appDir)) return [];
52
68
  const settings = /* @__PURE__ */ new Map();
@@ -57,8 +73,8 @@ function yarnNpmConfiguration(appDir, packageName, temporaryDir) {
57
73
  stdio: ["ignore", "pipe", "pipe"],
58
74
  timeout: 15e3
59
75
  });
60
- if (result.error || result.status !== 0) throw new Error("Cannot inspect project package registry configuration");
61
- settings.set(setting, JSON.parse(result.stdout));
76
+ if (result.error || result.status !== 0) throw yarnSettingError(`Yarn setting ${setting} could not be read (exit ${result.status ?? "none"}).`);
77
+ settings.set(setting, parseYarnConfigValue(setting, result.stdout));
62
78
  }
63
79
  const scope = packageName.startsWith("@") ? packageName.slice(1).split("/")[0] : void 0;
64
80
  const scopeSettings = scope ? record(record(settings.get("npmScopes"))[scope]) : {};
@@ -112,7 +128,7 @@ function inspectNpmModuleTarget(packageSpec, packageName, appDir, requiredModule
112
128
  if (inspected.version !== packed.version) throw new Error("Packed artifact version disagrees with resolution");
113
129
  return { packageName, packageSpec, ...inspected, locator: `npm:${packageName}` };
114
130
  } catch (error) {
115
- const safeDetail = isModulePackageExportError(error) && error instanceof Error ? ` ${error.message}` : "";
131
+ const safeDetail = (isModulePackageExportError(error) || isYarnSettingError(error)) && error instanceof Error ? ` ${error.message}` : "";
116
132
  throw new Error(`Cannot inspect the exact module artifact for "${packageName}" while trying to ${inspectionStep}.${safeDetail} Check project registry credentials, package access and shipped src/dist module descriptors before retrying. No package was installed.`);
117
133
  } finally {
118
134
  fs.rmSync(temporaryDir, { recursive: true, force: true });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/lib/module-inspection.ts"],
4
- "sourcesContent": ["import fs from 'node:fs'\nimport os from 'node:os'\nimport path from 'node:path'\nimport { execFileSync } from 'node:child_process'\nimport spawn from 'cross-spawn'\nimport { assertModulePackageExports, isModulePackageExportError } from './module-package'\n\nexport type InspectedModuleTarget = {\n packageName: string\n packageSpec: string\n moduleIds: string[]\n locator?: string\n version?: string\n}\n\ntype ArtifactInspection = { moduleIds: string[]; version?: string }\n\nfunction record(value: unknown): Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction inspectFiles(manifest: Record<string, unknown>, packageName: string, files: string[], requiredModuleIds: readonly string[], readSource: (relativePath: string) => string): ArtifactInspection {\n if (manifest.name !== packageName) throw new Error(`Inspected package does not match \"${packageName}\". No package was installed.`)\n const moduleIds = [...new Set(files.flatMap((file) => {\n const match = /^src\\/modules\\/([a-z0-9]+(?:_[a-z0-9]+)*)\\/index\\.ts$/.exec(file)\n return match && files.includes(`dist/modules/${match[1]}/index.js`) ? [match[1]] : []\n }))]\n const checkedModuleIds = requiredModuleIds.length ? requiredModuleIds : moduleIds.length === 1 ? moduleIds : []\n for (const moduleId of checkedModuleIds) {\n if (!moduleIds.includes(moduleId)) throw new Error(`Package \"${packageName}\" is missing source or compiled descriptors for \"${moduleId}\". No package was installed.`)\n assertModulePackageExports(manifest, packageName, moduleId, files, readSource)\n }\n if (moduleIds.length === 0) throw new Error(`Package \"${packageName}\" is missing source or compiled module descriptors. Build the package before retrying. No package was installed.`)\n return { moduleIds, ...(typeof manifest.version === 'string' ? { version: manifest.version } : {}) }\n}\n\nfunction inspectArchive(archive: string, packageName: string, requiredModuleIds: readonly string[]): ArtifactInspection {\n const manifest = record(JSON.parse(execFileSync('tar', ['-xOf', archive, 'package/package.json'], { encoding: 'utf8', timeout: 15_000 })))\n const files = execFileSync('tar', ['-tf', archive], { encoding: 'utf8', timeout: 15_000, maxBuffer: 16 * 1024 * 1024 }).split('\\n').filter((file) => file.startsWith('package/')).map((file) => file.slice('package/'.length))\n return inspectFiles(manifest, packageName, files, requiredModuleIds, (relativePath) => execFileSync('tar', ['-xOf', archive, `package/${relativePath}`], { encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024 }))\n}\n\nfunction packageFiles(packageRoot: string, relativeDir = ''): string[] {\n return fs.readdirSync(path.join(packageRoot, relativeDir), { withFileTypes: true }).flatMap((entry) => {\n if (entry.name === 'node_modules' || entry.name.startsWith('.')) return []\n const relativePath = path.posix.join(relativeDir, entry.name)\n return entry.isDirectory() ? packageFiles(packageRoot, relativePath) : entry.isFile() ? [relativePath] : []\n })\n}\n\nfunction isModernYarnProject(appDir: string): boolean {\n let directory = appDir\n while (true) {\n if (fs.existsSync(path.join(directory, '.yarnrc.yml'))) return true\n const manifestPath = path.join(directory, 'package.json')\n if (fs.existsSync(manifestPath)) {\n const manifest = record(JSON.parse(fs.readFileSync(manifestPath, 'utf8')))\n if (typeof manifest.packageManager === 'string' && /^yarn@(?:[2-9]|[1-9][0-9]+)\\./.test(manifest.packageManager)) return true\n }\n const parent = path.dirname(directory)\n if (parent === directory) return false\n directory = parent\n }\n}\n\nfunction yarnNpmConfiguration(appDir: string, packageName: string, temporaryDir: string): string[] {\n if (!isModernYarnProject(appDir)) return []\n const settings = new Map<string, unknown>()\n for (const setting of ['npmRegistryServer', 'npmScopes', 'npmRegistries', 'npmAuthToken', 'npmAuthIdent']) {\n const result = spawn.sync(process.platform === 'win32' ? 'yarn.cmd' : 'yarn', ['config', 'get', setting, '--json', '--no-redacted'], {\n cwd: appDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 15_000,\n })\n if (result.error || result.status !== 0) throw new Error('Cannot inspect project package registry configuration')\n settings.set(setting, JSON.parse(result.stdout))\n }\n const scope = packageName.startsWith('@') ? packageName.slice(1).split('/')[0] : undefined\n const scopeSettings = scope ? record(record(settings.get('npmScopes'))[scope]) : {}\n const registry = typeof scopeSettings.npmRegistryServer === 'string' ? scopeSettings.npmRegistryServer : settings.get('npmRegistryServer')\n if (typeof registry !== 'string') throw new Error('Missing project package registry')\n const registryUrl = new URL(registry)\n if (!['http:', 'https:'].includes(registryUrl.protocol) || registryUrl.username || registryUrl.password) throw new Error('Invalid project package registry')\n const registryKey = `//${registryUrl.host}${registryUrl.pathname}`.replace(/\\/$/, '')\n const registries = record(settings.get('npmRegistries'))\n const registrySettings = record(registries[registry.replace(/\\/$/, '')] ?? registries[registryKey] ?? registries[`${registryKey}/`])\n const auth = scopeSettings.npmAuthToken || scopeSettings.npmAuthIdent ? scopeSettings\n : registrySettings.npmAuthToken || registrySettings.npmAuthIdent ? registrySettings\n : { npmAuthToken: settings.get('npmAuthToken'), npmAuthIdent: settings.get('npmAuthIdent') }\n const userConfig = process.env.NPM_CONFIG_USERCONFIG ?? process.env.npm_config_userconfig ?? path.join(os.homedir(), '.npmrc')\n const existingConfig = fs.existsSync(userConfig) ? fs.readFileSync(userConfig, 'utf8') : ''\n const lines = [existingConfig, `registry=${JSON.stringify(registry)}`]\n if (scope) lines.push(`@${scope}:registry=${JSON.stringify(registry)}`)\n if (typeof auth.npmAuthToken === 'string' && auth.npmAuthToken) lines.push(`${registryKey}/:_authToken=${JSON.stringify(auth.npmAuthToken)}`)\n else if (typeof auth.npmAuthIdent === 'string' && auth.npmAuthIdent) lines.push(`${registryKey}/:_auth=${Buffer.from(auth.npmAuthIdent).toString('base64')}`)\n const configPath = path.join(temporaryDir, 'inspection.npmrc')\n fs.writeFileSync(configPath, `${lines.join('\\n')}\\n`, { mode: 0o600 })\n return ['--userconfig', configPath, '--registry', registry, ...(scope ? [`--@${scope}:registry=${registry}`] : [])]\n}\n\nexport function inspectNpmModuleTarget(packageSpec: string, packageName: string, appDir: string, requiredModuleIds: readonly string[] = []): InspectedModuleTarget {\n const filePrefix = `${packageName}@file:`\n if (packageSpec.startsWith(filePrefix)) {\n const packageRoot = path.resolve(appDir, packageSpec.slice(filePrefix.length))\n if (fs.statSync(packageRoot).isFile()) return { packageName, packageSpec, ...inspectArchive(packageRoot, packageName, requiredModuleIds) }\n const manifest = record(JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8')))\n const inspected = inspectFiles(manifest, packageName, packageFiles(packageRoot), requiredModuleIds, (relativePath) => fs.readFileSync(path.join(packageRoot, relativePath), 'utf8'))\n return { packageName, packageSpec, ...inspected }\n }\n\n const temporaryDir = fs.mkdtempSync(path.join(os.tmpdir(), 'mercato-module-inspection-'))\n let inspectionStep = 'read the project registry configuration'\n try {\n const configurationArgs = yarnNpmConfiguration(appDir, packageName, temporaryDir)\n inspectionStep = 'fetch the exact npm artifact'\n const packedProcess = spawn.sync(process.platform === 'win32' ? 'npm.cmd' : 'npm', ['pack', packageSpec, '--ignore-scripts', '--json', '--pack-destination', temporaryDir, ...configurationArgs], {\n cwd: appDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60_000, maxBuffer: 16 * 1024 * 1024,\n })\n if (packedProcess.error || packedProcess.status !== 0) throw new Error('Artifact inspection failed')\n inspectionStep = 'parse the npm artifact response'\n const packages: unknown = JSON.parse(packedProcess.stdout)\n const packed = record(Array.isArray(packages) ? packages[0] : undefined)\n if (packed.name !== packageName || typeof packed.version !== 'string' || !/^[0-9A-Za-z.+-]+$/.test(packed.version)\n || typeof packed.filename !== 'string' || path.basename(packed.filename) !== packed.filename) throw new Error('Invalid packed manifest')\n inspectionStep = 'validate the packed module artifact'\n const inspected = inspectArchive(path.join(temporaryDir, packed.filename), packageName, requiredModuleIds)\n if (inspected.version !== packed.version) throw new Error('Packed artifact version disagrees with resolution')\n return { packageName, packageSpec, ...inspected, locator: `npm:${packageName}` }\n } catch (error) {\n const safeDetail = isModulePackageExportError(error) && error instanceof Error ? ` ${error.message}` : ''\n throw new Error(`Cannot inspect the exact module artifact for \"${packageName}\" while trying to ${inspectionStep}.${safeDetail} Check project registry credentials, package access and shipped src/dist module descriptors before retrying. No package was installed.`)\n } finally {\n fs.rmSync(tem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O,aAAa,YAAY,KAAK,SAAS,OAAO,QAAQ,MAAM,OAAO,SAAU,OAAM,IAAI,MAAM,yBAAyB;AACzI,qBAAiB;AACjB,UAAM,YAAY,eAAe,KAAK,KAAK,cAAc,OAAO,QAAQ,GAAG,aAAa,iBAAiB;AACzG,QAAI,UAAU,YAAY,OAAO,QAAS,OAAM,IAAI,MAAM,mDAAmD;AAC7G,WAAO,EAAE,aAAa,aAAa,GAAG,WAAW,SAAS,OAAO,WAAW,GAAG;AAAA,EACjF,SAAS,OAAO;AACd,UAAM,aAAa,2BAA2B,KAAK,KAAK,iBAAiB,QAAQ,IAAI,MAAM,OAAO,KAAK;AACvG,UAAM,IAAI,MAAM,iDAAiD,WAAW,qBAAqB,cAAc,IAAI,UAAU,wIAAwI;AAAA,EACvQ,UAAE;AACA,OAAG,OAAO,cAAc,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EAC1D;AACF;",
4
+ "sourcesContent": ["import fs from 'node:fs'\nimport os from 'node:os'\nimport path from 'node:path'\nimport { execFileSync } from 'node:child_process'\nimport spawn from 'cross-spawn'\nimport { assertModulePackageExports, isModulePackageExportError } from './module-package'\n\nexport type InspectedModuleTarget = {\n packageName: string\n packageSpec: string\n moduleIds: string[]\n locator?: string\n version?: string\n}\n\ntype ArtifactInspection = { moduleIds: string[]; version?: string }\n\nfunction record(value: unknown): Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction inspectFiles(manifest: Record<string, unknown>, packageName: string, files: string[], requiredModuleIds: readonly string[], readSource: (relativePath: string) => string): ArtifactInspection {\n if (manifest.name !== packageName) throw new Error(`Inspected package does not match \"${packageName}\". No package was installed.`)\n const moduleIds = [...new Set(files.flatMap((file) => {\n const match = /^src\\/modules\\/([a-z0-9]+(?:_[a-z0-9]+)*)\\/index\\.ts$/.exec(file)\n return match && files.includes(`dist/modules/${match[1]}/index.js`) ? [match[1]] : []\n }))]\n const checkedModuleIds = requiredModuleIds.length ? requiredModuleIds : moduleIds.length === 1 ? moduleIds : []\n for (const moduleId of checkedModuleIds) {\n if (!moduleIds.includes(moduleId)) throw new Error(`Package \"${packageName}\" is missing source or compiled descriptors for \"${moduleId}\". No package was installed.`)\n assertModulePackageExports(manifest, packageName, moduleId, files, readSource)\n }\n if (moduleIds.length === 0) throw new Error(`Package \"${packageName}\" is missing source or compiled module descriptors. Build the package before retrying. No package was installed.`)\n return { moduleIds, ...(typeof manifest.version === 'string' ? { version: manifest.version } : {}) }\n}\n\nfunction inspectArchive(archive: string, packageName: string, requiredModuleIds: readonly string[]): ArtifactInspection {\n const manifest = record(JSON.parse(execFileSync('tar', ['-xOf', archive, 'package/package.json'], { encoding: 'utf8', timeout: 15_000 })))\n const files = execFileSync('tar', ['-tf', archive], { encoding: 'utf8', timeout: 15_000, maxBuffer: 16 * 1024 * 1024 }).split('\\n').filter((file) => file.startsWith('package/')).map((file) => file.slice('package/'.length))\n return inspectFiles(manifest, packageName, files, requiredModuleIds, (relativePath) => execFileSync('tar', ['-xOf', archive, `package/${relativePath}`], { encoding: 'utf8', timeout: 15_000, maxBuffer: 1024 * 1024 }))\n}\n\nfunction packageFiles(packageRoot: string, relativeDir = ''): string[] {\n return fs.readdirSync(path.join(packageRoot, relativeDir), { withFileTypes: true }).flatMap((entry) => {\n if (entry.name === 'node_modules' || entry.name.startsWith('.')) return []\n const relativePath = path.posix.join(relativeDir, entry.name)\n return entry.isDirectory() ? packageFiles(packageRoot, relativePath) : entry.isFile() ? [relativePath] : []\n })\n}\n\nfunction isModernYarnProject(appDir: string): boolean {\n let directory = appDir\n while (true) {\n if (fs.existsSync(path.join(directory, '.yarnrc.yml'))) return true\n const manifestPath = path.join(directory, 'package.json')\n if (fs.existsSync(manifestPath)) {\n const manifest = record(JSON.parse(fs.readFileSync(manifestPath, 'utf8')))\n if (typeof manifest.packageManager === 'string' && /^yarn@(?:[2-9]|[1-9][0-9]+)\\./.test(manifest.packageManager)) return true\n }\n const parent = path.dirname(directory)\n if (parent === directory) return false\n directory = parent\n }\n}\n\nconst YARN_SETTING_UNREADABLE = 'YARN_SETTING_UNREADABLE'\n\nfunction yarnSettingError(message: string): Error {\n return Object.assign(new Error(message), { code: YARN_SETTING_UNREADABLE })\n}\n\nfunction isYarnSettingError(error: unknown): error is Error {\n return error instanceof Error && 'code' in error && error.code === YARN_SETTING_UNREADABLE\n}\n\nfunction parseYarnConfigValue(setting: string, stdout: string): unknown {\n const output = stdout.trim()\n if (output === '' || output === 'undefined') return undefined\n try {\n return JSON.parse(output)\n } catch {\n throw yarnSettingError(`Yarn setting ${setting} returned output that is not JSON.`)\n }\n}\n\nfunction yarnNpmConfiguration(appDir: string, packageName: string, temporaryDir: string): string[] {\n if (!isModernYarnProject(appDir)) return []\n const settings = new Map<string, unknown>()\n for (const setting of ['npmRegistryServer', 'npmScopes', 'npmRegistries', 'npmAuthToken', 'npmAuthIdent']) {\n const result = spawn.sync(process.platform === 'win32' ? 'yarn.cmd' : 'yarn', ['config', 'get', setting, '--json', '--no-redacted'], {\n cwd: appDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 15_000,\n })\n if (result.error || result.status !== 0) throw yarnSettingError(`Yarn setting ${setting} could not be read (exit ${result.status ?? 'none'}).`)\n settings.set(setting, parseYarnConfigValue(setting, result.stdout))\n }\n const scope = packageName.startsWith('@') ? packageName.slice(1).split('/')[0] : undefined\n const scopeSettings = scope ? record(record(settings.get('npmScopes'))[scope]) : {}\n const registry = typeof scopeSettings.npmRegistryServer === 'string' ? scopeSettings.npmRegistryServer : settings.get('npmRegistryServer')\n if (typeof registry !== 'string') throw new Error('Missing project package registry')\n const registryUrl = new URL(registry)\n if (!['http:', 'https:'].includes(registryUrl.protocol) || registryUrl.username || registryUrl.password) throw new Error('Invalid project package registry')\n const registryKey = `//${registryUrl.host}${registryUrl.pathname}`.replace(/\\/$/, '')\n const registries = record(settings.get('npmRegistries'))\n const registrySettings = record(registries[registry.replace(/\\/$/, '')] ?? registries[registryKey] ?? registries[`${registryKey}/`])\n const auth = scopeSettings.npmAuthToken || scopeSettings.npmAuthIdent ? scopeSettings\n : registrySettings.npmAuthToken || registrySettings.npmAuthIdent ? registrySettings\n : { npmAuthToken: settings.get('npmAuthToken'), npmAuthIdent: settings.get('npmAuthIdent') }\n const userConfig = process.env.NPM_CONFIG_USERCONFIG ?? process.env.npm_config_userconfig ?? path.join(os.homedir(), '.npmrc')\n const existingConfig = fs.existsSync(userConfig) ? fs.readFileSync(userConfig, 'utf8') : ''\n const lines = [existingConfig, `registry=${JSON.stringify(registry)}`]\n if (scope) lines.push(`@${scope}:registry=${JSON.stringify(registry)}`)\n if (typeof auth.npmAuthToken === 'string' && auth.npmAuthToken) lines.push(`${registryKey}/:_authToken=${JSON.stringify(auth.npmAuthToken)}`)\n else if (typeof auth.npmAuthIdent === 'string' && auth.npmAuthIdent) lines.push(`${registryKey}/:_auth=${Buffer.from(auth.npmAuthIdent).toString('base64')}`)\n const configPath = path.join(temporaryDir, 'inspection.npmrc')\n fs.writeFileSync(configPath, `${lines.join('\\n')}\\n`, { mode: 0o600 })\n return ['--userconfig', configPath, '--registry', registry, ...(scope ? [`--@${scope}:registry=${registry}`] : [])]\n}\n\nexport function inspectNpmModuleTarget(packageSpec: string, packageName: string, appDir: string, requiredModuleIds: readonly string[] = []): InspectedModuleTarget {\n const filePrefix = `${packageName}@file:`\n if (packageSpec.startsWith(filePrefix)) {\n const packageRoot = path.resolve(appDir, packageSpec.slice(filePrefix.length))\n if (fs.statSync(packageRoot).isFile()) return { packageName, packageSpec, ...inspectArchive(packageRoot, packageName, requiredModuleIds) }\n const manifest = record(JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8')))\n const inspected = inspectFiles(manifest, packageName, packageFiles(packageRoot), requiredModuleIds, (relativePath) => fs.readFileSync(path.join(packageRoot, relativePath), 'utf8'))\n return { packageName, packageSpec, ...inspected }\n }\n\n const temporaryDir = fs.mkdtempSync(path.join(os.tmpdir(), 'mercato-module-inspection-'))\n let inspectionStep = 'read the project registry configuration'\n try {\n const configurationArgs = yarnNpmConfiguration(appDir, packageName, temporaryDir)\n inspectionStep = 'fetch the exact npm artifact'\n const packedProcess = spawn.sync(process.platform === 'win32' ? 'npm.cmd' : 'npm', ['pack', packageSpec, '--ignore-scripts', '--json', '--pack-destination', temporaryDir, ...configurationArgs], {\n cwd: appDir, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60_000, maxBuffer: 16 * 1024 * 1024,\n })\n if (packedProcess.error || packedProcess.status !== 0) throw new Error('Artifact inspection failed')\n inspectionStep = 'parse the npm artifact response'\n const packages: unknown = JSON.parse(packedProcess.stdout)\n const packed = record(Array.isArray(packages) ? packages[0] : undefined)\n if (packed.name !== packageName || typeof packed.version !== 'string' || !/^[0-9A-Za-z.+-]+$/.test(packed.version)\n || typeof packed.filename !== 'string' || path.basename(packed.filename) !== packed.filename) throw new Error('Invalid packed manifest')\n inspectionStep = 'validate the packed module artifact'\n const inspected = inspectArchive(path.join(temporaryDir, packed.filename), packageName, requiredModuleIds)\n if (inspected.version !== packed.version) throw new Error('Packed artifact version disagrees with resolution')\n return { packageName, packageSpec, ...inspected, locator: `npm:${packageName}` }\n } catch (error) {\n const safeDetail = (isModulePackageExportError(error) || isYarnSettingError(error)) && error instanceof Error ? ` ${error.message}` : ''\n throw new Error(`Cannot inspect the exact module artifact for \"${packageName}\" while trying to ${inspectionStep}.${safeDetail} Check project registry credentials, package access and shipped src/dist module descriptors before retrying. No package was installed.`)\n } finally {\n fs.rmSync(temporaryDir, { recursive: true, force: true })\n }\n}\n"],
5
+ "mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,4BAA4B,kCAAkC;AAYvE,SAAS,OAAO,OAAyC;AACvD,SAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM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AACnG,qBAAiB;AACjB,UAAM,WAAoB,KAAK,MAAM,cAAc,MAAM;AACzD,UAAM,SAAS,OAAO,MAAM,QAAQ,QAAQ,IAAI,SAAS,CAAC,IAAI,MAAS;AACvE,QAAI,OAAO,SAAS,eAAe,OAAO,OAAO,YAAY,YAAY,CAAC,oBAAoB,KAAK,OAAO,OAAO,KAC5G,OAAO,OAAO,aAAa,YAAY,KAAK,SAAS,OAAO,QAAQ,MAAM,OAAO,SAAU,OAAM,IAAI,MAAM,yBAAyB;AACzI,qBAAiB;AACjB,UAAM,YAAY,eAAe,KAAK,KAAK,cAAc,OAAO,QAAQ,GAAG,aAAa,iBAAiB;AACzG,QAAI,UAAU,YAAY,OAAO,QAAS,OAAM,IAAI,MAAM,mDAAmD;AAC7G,WAAO,EAAE,aAAa,aAAa,GAAG,WAAW,SAAS,OAAO,WAAW,GAAG;AAAA,EACjF,SAAS,OAAO;AACd,UAAM,cAAc,2BAA2B,KAAK,KAAK,mBAAmB,KAAK,MAAM,iBAAiB,QAAQ,IAAI,MAAM,OAAO,KAAK;AACtI,UAAM,IAAI,MAAM,iDAAiD,WAAW,qBAAqB,cAAc,IAAI,UAAU,wIAAwI;AAAA,EACvQ,UAAE;AACA,OAAG,OAAO,cAAc,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EAC1D;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/cli",
3
- "version": "0.10.1-develop.8291.1.6ec3aee41c",
3
+ "version": "0.10.1",
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.8291.1.6ec3aee41c",
64
- "@open-mercato/queue": "0.10.1-develop.8291.1.6ec3aee41c",
65
- "@open-mercato/shared": "0.10.1-develop.8291.1.6ec3aee41c",
66
- "@open-mercato/telemetry": "0.10.1-develop.8291.1.6ec3aee41c",
63
+ "@open-mercato/events": "0.10.1",
64
+ "@open-mercato/queue": "0.10.1",
65
+ "@open-mercato/shared": "0.10.1",
66
+ "@open-mercato/telemetry": "0.10.1",
67
67
  "cross-spawn": "^7.0.6",
68
68
  "minisearch": "7.2.0",
69
69
  "pg": "8.23.0",
@@ -75,10 +75,10 @@
75
75
  "typescript-js": "npm:typescript@6.0.3"
76
76
  },
77
77
  "peerDependencies": {
78
- "@open-mercato/shared": "0.10.1-develop.8291.1.6ec3aee41c"
78
+ "@open-mercato/shared": "0.10.1"
79
79
  },
80
80
  "devDependencies": {
81
- "@open-mercato/shared": "0.10.1-develop.8291.1.6ec3aee41c",
81
+ "@open-mercato/shared": "0.10.1",
82
82
  "@types/jest": "^30.0.0",
83
83
  "jest": "^30.4.2",
84
84
  "ts-jest": "^29.4.12"
@@ -90,6 +90,5 @@
90
90
  "type": "git",
91
91
  "url": "https://github.com/open-mercato/open-mercato",
92
92
  "directory": "packages/cli"
93
- },
94
- "stableVersion": "0.10.0"
93
+ }
95
94
  }