@open-mercato/cli 0.10.1-develop.7826.1.5e82b7c668 → 0.10.1-develop.7827.1.5c631908e4

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 (92) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/agentic/guides/module-facts.json +162 -162
  3. package/dist/agentic/guides/module-facts.v2.json +162 -162
  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/index.md +1 -1
  9. package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
  10. package/dist/agentic/guides/modules/auth/index.md +1 -1
  11. package/dist/agentic/guides/modules/availability/index.md +1 -1
  12. package/dist/agentic/guides/modules/business_rules/index.md +1 -1
  13. package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
  14. package/dist/agentic/guides/modules/cart/index.md +1 -1
  15. package/dist/agentic/guides/modules/catalog/index.md +1 -1
  16. package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
  17. package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
  18. package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
  19. package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
  20. package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
  21. package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
  22. package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
  23. package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
  24. package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
  25. package/dist/agentic/guides/modules/checkout/index.md +1 -1
  26. package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
  27. package/dist/agentic/guides/modules/configs/index.md +1 -1
  28. package/dist/agentic/guides/modules/content/index.md +1 -1
  29. package/dist/agentic/guides/modules/currencies/index.md +1 -1
  30. package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
  31. package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
  32. package/dist/agentic/guides/modules/customers/index.md +1 -1
  33. package/dist/agentic/guides/modules/dashboards/index.md +1 -1
  34. package/dist/agentic/guides/modules/data_sync/index.md +1 -1
  35. package/dist/agentic/guides/modules/design_system/index.md +1 -1
  36. package/dist/agentic/guides/modules/devices/index.md +1 -1
  37. package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
  38. package/dist/agentic/guides/modules/directory/index.md +1 -1
  39. package/dist/agentic/guides/modules/documents/index.md +1 -1
  40. package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
  41. package/dist/agentic/guides/modules/entities/index.md +1 -1
  42. package/dist/agentic/guides/modules/eudr/index.md +1 -1
  43. package/dist/agentic/guides/modules/events/index.md +1 -1
  44. package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
  45. package/dist/agentic/guides/modules/forms/index.md +1 -1
  46. package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
  47. package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
  48. package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
  49. package/dist/agentic/guides/modules/generators/index.md +1 -1
  50. package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
  51. package/dist/agentic/guides/modules/integrations/index.md +1 -1
  52. package/dist/agentic/guides/modules/messages/index.md +1 -1
  53. package/dist/agentic/guides/modules/notifications/index.md +1 -1
  54. package/dist/agentic/guides/modules/onboarding/index.md +1 -1
  55. package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
  56. package/dist/agentic/guides/modules/perspectives/index.md +1 -1
  57. package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
  58. package/dist/agentic/guides/modules/planner/index.md +1 -1
  59. package/dist/agentic/guides/modules/portal/index.md +1 -1
  60. package/dist/agentic/guides/modules/progress/index.md +1 -1
  61. package/dist/agentic/guides/modules/promotions/index.md +1 -1
  62. package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
  63. package/dist/agentic/guides/modules/query_index/index.md +1 -1
  64. package/dist/agentic/guides/modules/record_locks/index.md +1 -1
  65. package/dist/agentic/guides/modules/resources/index.md +1 -1
  66. package/dist/agentic/guides/modules/sales/index.md +1 -1
  67. package/dist/agentic/guides/modules/scheduler/index.md +1 -1
  68. package/dist/agentic/guides/modules/search/index.md +1 -1
  69. package/dist/agentic/guides/modules/security/index.md +1 -1
  70. package/dist/agentic/guides/modules/seeds/index.md +1 -1
  71. package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
  72. package/dist/agentic/guides/modules/sso/index.md +1 -1
  73. package/dist/agentic/guides/modules/staff/index.md +1 -1
  74. package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
  75. package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
  76. package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
  77. package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
  78. package/dist/agentic/guides/modules/telemetry/index.md +1 -1
  79. package/dist/agentic/guides/modules/tillio/index.md +1 -1
  80. package/dist/agentic/guides/modules/translations/index.md +1 -1
  81. package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
  82. package/dist/agentic/guides/modules/webhooks/index.md +1 -1
  83. package/dist/agentic/guides/modules/wms/index.md +1 -1
  84. package/dist/agentic/guides/modules/workflows/index.md +1 -1
  85. package/dist/agentic/guides/reference-module-facts.json +2 -2
  86. package/dist/agentic/guides/reference-modules/example/index.md +1 -1
  87. package/dist/agentic/guides/upstream/manifest.json +1 -1
  88. package/dist/agentic/shared/AGENTS.md.template +11 -11
  89. package/dist/agentic/shared/ai/harness/source-link-inventory.json +117 -3
  90. package/dist/agentic/shared/ai/skills/om-data-model-design/references/sensitive-data.md +13 -1
  91. package/dist/agentic/shared/ai/skills/om-module-scaffold/references/api-and-domain.md +3 -2
  92. package/package.json +7 -7
@@ -1,5 +1,5 @@
1
1
  # staff — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/core/src/modules/staff
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # storage_s3 — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/storage-s3 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/storage-s3 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/storage-s3/src/modules/storage_s3
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # sync_akeneo — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/sync-akeneo 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/sync-akeneo 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/sync-akeneo/src/modules/sync_akeneo
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # sync_excel — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/core/src/modules/sync_excel
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # system_status_overlays — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/enterprise 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/enterprise 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/enterprise/src/modules/system_status_overlays
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # telemetry — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/telemetry 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/telemetry 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/telemetry/src/modules/telemetry
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # tillio — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/tillio 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/tillio 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/tillio/src/modules/tillio
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # translations — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/core/src/modules/translations
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # warranty_claims — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/core/src/modules/warranty_claims
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # webhooks — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/webhooks 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/webhooks 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/webhooks/src/modules/webhooks
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # wms — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/core/src/modules/wms
4
4
 
5
5
  ## Sections
@@ -1,5 +1,5 @@
1
1
  # workflows — module facts (generated, do not edit)
2
- <!-- generated from @open-mercato/core 0.10.1-develop.7826.1.5e82b7c668; core 0.10.1-develop.7826.1.5e82b7c668 — R1 staleness stamp -->
2
+ <!-- generated from @open-mercato/core 0.10.1-develop.7827.1.5c631908e4; core 0.10.1-develop.7827.1.5c631908e4 — R1 staleness stamp -->
3
3
  Source root: node_modules/@open-mercato/core/src/modules/workflows
4
4
 
5
5
  ## Sections
@@ -4,7 +4,7 @@
4
4
  "projectionKind": "activated-reference",
5
5
  "sourceKind": "local-reference",
6
6
  "runtimeSelected": false,
7
- "sourceFingerprint": "2fc1776f1ad64b61fdc0daa2884172ce84f6b5ddb2ab489dcdd42bbea01b11f0",
7
+ "sourceFingerprint": "7da2b6dd1cbf271bd509629a8092e7e75b4605dba5af3e888f1e980a792af2b1",
8
8
  "taxonomyFingerprint": "b6afb1c19fa5325d47cb28db4b5bf6f6e88088a6707d311c322f157230975553",
9
9
  "factCoverage": [
10
10
  {
@@ -1185,7 +1185,7 @@
1185
1185
  "facts": {
1186
1186
  "title": "Example Module",
1187
1187
  "description": "Demonstrates pages, APIs, entities and DI.",
1188
- "coreVersion": "0.10.1-develop.7826.1.5e82b7c668",
1188
+ "coreVersion": "0.10.1-develop.7827.1.5c631908e4",
1189
1189
  "sourcePackage": null,
1190
1190
  "sourceVersion": null,
1191
1191
  "sourceRoot": "src/modules/example",
@@ -1,5 +1,5 @@
1
1
  # example — module facts (generated reference projection, do not edit)
2
- <!-- generated from local reference src/modules/example; source-fingerprint 2fc1776f1ad64b61fdc0daa2884172ce84f6b5ddb2ab489dcdd42bbea01b11f0; taxonomy-fingerprint b6afb1c19fa5325d47cb28db4b5bf6f6e88088a6707d311c322f157230975553 — R1 staleness stamp -->
2
+ <!-- generated from local reference src/modules/example; source-fingerprint 7da2b6dd1cbf271bd509629a8092e7e75b4605dba5af3e888f1e980a792af2b1; taxonomy-fingerprint b6afb1c19fa5325d47cb28db4b5bf6f6e88088a6707d311c322f157230975553 — R1 staleness stamp -->
3
3
  > Reference projection: `example` is not selected by the current runtime. Its activations and exact override targets describe behavior only after opt-in in `src/modules.ts`.
4
4
  Source root: src/modules/example
5
5
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "generator": "@open-mercato/cli@0.10.1-develop.7826.1.5e82b7c668",
3
+ "generator": "@open-mercato/cli@0.10.1-develop.7827.1.5c631908e4",
4
4
  "files": {
5
5
  "AGENTS.md": "b27342ee5f61e805ba52703fdb7ec822b030490f734b4d80f48dfd1e05fa4cf5",
6
6
  "BACKWARD_COMPATIBILITY.md": "d47c2fbbf55f4363511576ac9ad009895afb5f4433c5b1527342e2ea1037b701"
@@ -1,12 +1,12 @@
1
1
  # {{PROJECT_NAME}} — Standalone App Agent Rules
2
2
 
3
- Route first; never probe unmatched context.
3
+ Route first; skip unmatched context.
4
4
 
5
5
  ## Always
6
6
 
7
7
  - Route all axes; missing context: `yarn mercato agentic:init --update-harness`.
8
8
  - Lessons: scan `.ai/lessons.md` tags; open/update one matching record + row.
9
- - App code: `src/modules/<id>/`; framework context only for named gaps.
9
+ - App code: `src/modules/<id>/`.
10
10
  - Derive trusted `tenantId` + `organizationId` and fail closed. Only an installed contract may use system scope (`organizationId: null`).
11
11
  - Use commands/`makeCrudRoute`/`CrudForm`/`DataTable`, DI/events/UMES; effects stay post-commit.
12
12
  - Put entities in `src/modules/<id>/data/entities.ts`; API routes need per-method `metadata` + `openApi`.
@@ -34,11 +34,11 @@ Broad: `yarn generate && yarn typecheck && yarn lint && yarn ds:check && yarn te
34
34
 
35
35
  ## Production Deployment
36
36
 
37
- Route production deployment, go-live, or security-readiness work to `architecture` and read `.ai/guides/production-deployment.md`. During routing, do not open `.env*`; the guide carries the safe configuration inventory. During the later readiness review, inspect only names and comments in the checked-in `.env.example`; never read or report live `.env` values. Ask before touching credentials, billable infrastructure, or a live deployment.
37
+ Route production deployment/go-live/security-readiness to `architecture` + `.ai/guides/production-deployment.md`. During routing, do not open `.env*`; use its inventory. Readiness: only names and comments in checked-in `.env.example`; never read or report live `.env` values. Ask before touching credentials, billable infrastructure, or live deployments.
38
38
 
39
39
  ## Three-Axis Context Assembler
40
40
 
41
- Routes are additive: ownership says WHO; other axes say WHAT. Select every match.
41
+ Select all matches on all axes.
42
42
 
43
43
  `debugging` is additive. A scalar-ID/snapshot fix to persisted records or commands linked to an installed record MUST use `module-data` + `umes` and load `om-data-model-design` + `om-system-extension`.
44
44
 
@@ -68,7 +68,7 @@ API/command/record/status/event/UI changes/guards = `umes`; app persistence = `m
68
68
 
69
69
  ### Axis 2 — Work Units
70
70
 
71
- Match every work-unit row; OPEN its skill before selection.
71
+ Open every matched work-unit skill before selection.
72
72
 
73
73
  | Route | Work unit | Skill/context |
74
74
  |---|---|---|
@@ -91,7 +91,7 @@ Match every work-unit row; OPEN its skill before selection.
91
91
  | `framework-context` | Exact installed contract still unknown | `.ai/guides/framework-contracts.md`, then bounded `om-framework-context`, last |
92
92
  | `debugging` + `testing` | Add/fix recurring harness case/test | `om-evolve-harness` |
93
93
 
94
- `framework-context`: resolve one named fact first. Use bounded source only if the guide leaves current behavior, authorization, dependents, or safest customization seam unresolved; never for “installed contracts” alone.
94
+ `framework-context`: resolve a named fact first; bounded source only for current behavior, authorization, dependents, or safest customization seam gaps left by the guide, never “installed contracts” alone.
95
95
 
96
96
  ### Axis 3 — SDLC and Delivery
97
97
 
@@ -107,8 +107,8 @@ Read `.agents/skills/<id>/SKILL.md` AND any `.ai/skills/<id>/SKILL.md` override.
107
107
 
108
108
  ### Token-Efficient Assembly Policy
109
109
 
110
- - Load matched guides once, then only needed references/facts.
111
- - Hard budgets: guide > skill > references; open a reference only for its named subject.
110
+ - Load matched guides once; only needed references/facts.
111
+ - Budget order: guide > skill > references; only subject-matched references.
112
112
  - `spec-pr` reads template via spec-delivery.
113
113
  - Inspect app call sites before bounded `framework-context`.
114
114
  - Additive page/form/table/conflict UI skips it.
@@ -116,14 +116,14 @@ Read `.agents/skills/<id>/SKILL.md` AND any `.ai/skills/<id>/SKILL.md` override.
116
116
 
117
117
  ## Module-Specific Facts
118
118
 
119
- Mechanisms: events/subscribers→events; long operation/progress→progress; provider settings/health/OAuth→integrations; sync/import→data_sync. Hosts: session/auth→auth; customer/contact/deal/pipeline→customers; product/price/stock/inventory→catalog; currency/money→currencies; cart/checkout/shopper→checkout; portal→portal+customer_accounts; quote/order/invoice/sales assistant→sales; notification→notifications; webhook/callback→webhooks; schedule/reminder→scheduler; workflow/activity/user task→workflows; assistant→ai_assistant; maintained query index/reindex→query_index; search convergence→search. staff/employee≠optional staff; audit/record-who≠audit_logs unless extended. App primitives skip api_docs/search/query_index unless changed. Big fact-sheets: read in sections.
119
+ Mechanisms: events/subscribers→events; long operation/progress→progress; provider settings/health/OAuth→integrations; sync/import→data_sync. Hosts: session/auth→auth; customer/contact/deal/pipeline→customers; product/price/stock/inventory→catalog; currency/money→currencies; cart/checkout/shopper→checkout; portal→portal+customer_accounts; quote/order/invoice/sales assistant→sales; notification→notifications; webhook/callback→webhooks; schedule/reminder→scheduler; workflow/activity/user task→workflows; assistant→ai_assistant; query index/reindex or encrypted search box/filter by name→query_index; search convergence→search. staff/employee≠optional staff; audit/record-who≠audit_logs unless extended. Primitives skip api_docs/search/query_index unless changed or filtering encrypted text. Read big facts by section.
120
120
 
121
121
  <!-- om:module-guides:start -->
122
122
  <!-- om:module-guides:end -->
123
123
 
124
124
  ## Working Sequence
125
125
 
126
- 1. Route, then implement the smallest complete slice through real call sites.
127
- 2. Discovery change: run `yarn generate`; then the smallest gate/integration paths.
126
+ 1. Route; implement a minimal complete slice via real call sites.
127
+ 2. Discovery: `yarn generate`; then focused gates/integration paths.
128
128
 
129
129
  Precedence: root→BC→installed `AGENTS.md`→facts; stop on skew/conflict; never guess.
@@ -3,9 +3,9 @@
3
3
  "generatedNote": "Derived asset — the app-facing projection of the repository source-link inventory, regenerated with `yarn workspace create-mercato-app harness:generate-source-link-inventory`. Never hand-edit. Harness cases resolve `context.sourceReferenceIds` against `referenceId` here; a record with `readStatus: \"qa-only\"` is validation evidence only and is refused as a case reference.",
4
4
  "derived": {
5
5
  "ownerCount": 32,
6
- "recordCount": 150,
7
- "sourceRequiredCount": 125,
8
- "readableCount": 150,
6
+ "recordCount": 155,
7
+ "sourceRequiredCount": 130,
8
+ "readableCount": 155,
9
9
  "baselineSha": "f7c941570003f3abe920b1765995cbef98dcad0b"
10
10
  },
11
11
  "notCovered": [
@@ -2093,6 +2093,99 @@
2093
2093
  "core"
2094
2094
  ]
2095
2095
  },
2096
+ {
2097
+ "referenceId": "om-data-model-design/sensitive-data:api/todos/route.ts",
2098
+ "requirement": "source-required",
2099
+ "originAsset": ".ai/skills/om-data-model-design/references/sensitive-data.md",
2100
+ "heading": "Encrypted list search",
2101
+ "href": "../../../../src/modules/example/api/todos/route.ts",
2102
+ "targetKind": "canonical-example",
2103
+ "readStatus": "readable",
2104
+ "resolvedPath": "src/modules/example/api/todos/route.ts",
2105
+ "moduleId": "example",
2106
+ "capabilityIds": [
2107
+ "api.crud-query-engine-custom-fields",
2108
+ "search.encrypted-column-list-filter"
2109
+ ],
2110
+ "presets": [
2111
+ "classic",
2112
+ "crm",
2113
+ "empty",
2114
+ "wms"
2115
+ ],
2116
+ "tiers": [
2117
+ "core"
2118
+ ]
2119
+ },
2120
+ {
2121
+ "referenceId": "om-data-model-design/sensitive-data:encryption.ts",
2122
+ "requirement": "source-required",
2123
+ "originAsset": ".ai/skills/om-data-model-design/references/sensitive-data.md",
2124
+ "heading": "Encrypted list search",
2125
+ "href": "../../../../src/modules/example/encryption.ts",
2126
+ "targetKind": "canonical-example",
2127
+ "readStatus": "readable",
2128
+ "resolvedPath": "src/modules/example/encryption.ts",
2129
+ "moduleId": "example",
2130
+ "capabilityIds": [
2131
+ "data.encryption-map"
2132
+ ],
2133
+ "presets": [
2134
+ "classic",
2135
+ "crm",
2136
+ "empty",
2137
+ "wms"
2138
+ ],
2139
+ "tiers": [
2140
+ "core"
2141
+ ]
2142
+ },
2143
+ {
2144
+ "referenceId": "om-data-model-design/sensitive-data:node_modules/@open-mercato/shared/src/lib/query/engine.ts",
2145
+ "requirement": "source-required",
2146
+ "originAsset": ".ai/skills/om-data-model-design/references/sensitive-data.md",
2147
+ "heading": "Encrypted list search",
2148
+ "href": "../../../../node_modules/@open-mercato/shared/src/lib/query/engine.ts",
2149
+ "targetKind": "installed-package",
2150
+ "readStatus": "readable",
2151
+ "resolvedPath": "node_modules/@open-mercato/shared/src/lib/query/engine.ts",
2152
+ "moduleId": null,
2153
+ "capabilityIds": [],
2154
+ "packageName": "@open-mercato/shared",
2155
+ "packageRelativePath": "src/lib/query/engine.ts",
2156
+ "presets": [
2157
+ "classic",
2158
+ "crm",
2159
+ "empty",
2160
+ "wms"
2161
+ ],
2162
+ "tiers": [
2163
+ "core"
2164
+ ]
2165
+ },
2166
+ {
2167
+ "referenceId": "om-data-model-design/sensitive-data:search.ts",
2168
+ "requirement": "source-required",
2169
+ "originAsset": ".ai/skills/om-data-model-design/references/sensitive-data.md",
2170
+ "heading": "Encrypted list search",
2171
+ "href": "../../../../src/modules/example/search.ts",
2172
+ "targetKind": "canonical-example",
2173
+ "readStatus": "readable",
2174
+ "resolvedPath": "src/modules/example/search.ts",
2175
+ "moduleId": "example",
2176
+ "capabilityIds": [
2177
+ "search.module-config"
2178
+ ],
2179
+ "presets": [
2180
+ "classic",
2181
+ "crm",
2182
+ "empty",
2183
+ "wms"
2184
+ ],
2185
+ "tiers": [
2186
+ "core"
2187
+ ]
2188
+ },
2096
2189
  {
2097
2190
  "referenceId": "om-data-model-design:references/surface-map.md",
2098
2191
  "requirement": "source-required",
@@ -2369,6 +2462,27 @@
2369
2462
  "core"
2370
2463
  ]
2371
2464
  },
2465
+ {
2466
+ "referenceId": "om-module-scaffold/api-and-domain:.ai/skills/om-data-model-design/references/sensitive-data.md",
2467
+ "requirement": "source-required",
2468
+ "originAsset": ".ai/skills/om-module-scaffold/references/api-and-domain.md",
2469
+ "heading": "API and Domain Writes",
2470
+ "href": "../../om-data-model-design/references/sensitive-data.md#encrypted-list-search",
2471
+ "targetKind": "local-owner",
2472
+ "readStatus": "readable",
2473
+ "resolvedPath": ".ai/skills/om-data-model-design/references/sensitive-data.md",
2474
+ "moduleId": null,
2475
+ "capabilityIds": [],
2476
+ "presets": [
2477
+ "classic",
2478
+ "crm",
2479
+ "empty",
2480
+ "wms"
2481
+ ],
2482
+ "tiers": [
2483
+ "core"
2484
+ ]
2485
+ },
2372
2486
  {
2373
2487
  "referenceId": "om-module-scaffold/api-and-domain:README.md",
2374
2488
  "requirement": "source-required",
@@ -5,6 +5,18 @@ Load this reference when records contain PII, credentials, addresses, contact in
5
5
  1. Classify data sensitivity, lookup needs, retention/deletion, logs/search/export exposure, and access features.
6
6
  2. In module `encryption.ts`, import `ModuleEncryptionMap` from `@open-mercato/shared/modules/encryption`, declare `defaultEncryptionMaps: ModuleEncryptionMap[] = [{ entityId: '<module>:<entity>', fields: [{ field: '<database_field>' }] }]`, then `export default defaultEncryptionMaps` for generated registry compatibility. The entries are field-rule objects, not string names. Use a sibling `hashField` only for deterministic equality lookup. Let `TenantDataEncryptionService` populate it during encrypted writes, and query it with `lookupHashCandidates(value)` from `@open-mercato/shared/lib/encryption/aes`; use `hashForLookup(value)` from the same import only when the installed write contract explicitly requires a single keyed value. Never use raw SHA-256 for low-entropy PII such as email or phone values.
7
7
  3. Import `findWithDecryption`, `findOneWithDecryption`, or `findAndCountWithDecryption` from `@open-mercato/shared/lib/encryption/find` and make a concrete call in every implemented direct sensitive-record read path; an unused import or encryption map alone is not a decrypted read. For `makeCrudRoute`, its `entityId` + `fields` factory QueryEngine owns list decryption and `list` has no `findAndCount` override key—do not insert a decryption helper as an unsupported option. Put trusted tenant/organization constraints in each direct helper query `where` **and** pass `{ tenantId, organizationId }` as the fifth-argument decryption scope. The scope selects keys; it does not authorize or scope the ORM query. Use a null/global scope only when the installed contract explicitly permits it. Audit detail/export/search/worker/CLI and other direct ORM paths.
8
- 4. Keep secrets out of responses, logs, errors, events, snapshots, cache keys, search documents, vector sources, and test artifacts. Exclude encrypted source values from `search.ts` field policies and indexes; index only an explicitly approved hash-only sibling for exact equality. Never sort or fuzzy-filter ciphertext.
8
+ 4. Keep secrets out of responses, logs, errors, events, snapshots, cache keys, search documents, vector sources, and test artifacts. Exclude sensitive plaintext from fulltext/vector `search.ts` policies and exports. A keyed hash-only sibling supports exact equality; encrypted text filtering has a separate scoped token-index contract below. Never sort or fuzzy-filter ciphertext with raw SQL.
9
9
  5. Seed/update encryption configuration through the supported command; never hand-roll KMS/AES. For every new or changed map, use an isolated initialized test tenant to reconcile the map, read back its registration, insert a fixture through the real write path, and assert the sensitive database columns are ciphertext before claiming runtime coverage. A fresh test tenant does not prove existing tenants are covered: maps are seeded only when a tenant is created, and nothing re-seeds tenants that already exist. When you add a map, or a field to an existing map, in a module that may already be deployed, ship a backfill migration in the same module: `this.addSql(buildEncryptionMapBackfillSql({ entityId, fields }))` from `@open-mercato/shared/lib/encryption/migration-backfill`. It inserts the map for every existing (tenant, organization) scope that already has active maps (`NOT EXISTS` guard) and appends missing fields to existing maps. Write the entity id and fields literally in the migration and leave `down()` empty. `yarn db:generate` warns when the local database shows an unbackfilled field. Plaintext rows written before the backfill are encrypted by `yarn mercato entities rotate-encryption-key --tenant <id>` without `--old-key`.
10
10
  6. Test authorized decryption, cross-scope denial, redaction, missing keys, export/search behavior, and cleanup/retention.
11
+
12
+ ## Encrypted list search
13
+
14
+ For QueryEngine list filters (`makeCrudRoute` with `entityId` + `fields`), use the normal `$ilike` filter. The engine owns encrypted-field token lookup and tenant/organization scoping; do not duplicate it with manual ID narrowing. For a raw ORM or Kysely read, use `findEntityIdsBySearchTokens` from `@open-mercato/shared/lib/search/tokenLookup` with trusted scope, then constrain IDs before a scoped decrypted read. `matched: false` means the index was not consulted, not a successful empty match; never fall back to SQL ILIKE against ciphertext.
15
+
16
+ The required invariant is populated `search_tokens` for the filtered entity/field/records in the same tenant and organization scope. Declare `indexer` on the real write path, verify its events/worker run, and reindex existing records when adopting the module. Token generation is independent of `search.ts`: the query index tokenizes decrypted documents into hashes, even when fulltext/vector policies exclude the field. Adding `search.ts` alone cannot populate missing tokens. Search must also be enabled and the query must produce tokens at the configured minimum length.
17
+
18
+ Prove the pairing against a disposable database: create an encrypted fixture through the real API, wait for its scoped tokens, search that value through the list API, and assert exactly that record is returned; verify a different organization cannot find it. A green build or mocked command suite does not prove token population. Clean up both the record and its indexed state.
19
+
20
+ A `no-search-tokens` warning means the missing index can make an ordinary empty HTTP 200 misleading. Outside production, QueryEngine-backed list responses also expose `meta.ciphertextSearchWarnings` with safe entity/field/reason/hint metadata on every affected response; production keeps the existing server log only. No diagnostic contains the search text or decrypted value. Inspect that metadata and the query-index worker/reindex status before interpreting an empty search as no matching record.
21
+
22
+ Canonical installed contract: `@open-mercato/shared/AGENTS.md`, Search Tokens; engine implementation: [`query/engine.ts`](../../../../node_modules/@open-mercato/shared/src/lib/query/engine.ts). Reference implementation: [`api/todos/route.ts`](../../../../src/modules/example/api/todos/route.ts), [`encryption.ts`](../../../../src/modules/example/encryption.ts), and [`search.ts`](../../../../src/modules/example/search.ts).
@@ -7,8 +7,9 @@ the authority for this layer's import paths and carries MUST rules that are easy
7
7
  by writing something that merely compiles — in particular: use the `badRequest` / `forbidden`
8
8
  / `notFound` / `conflict` / `assertFound` helpers from
9
9
  `@open-mercato/shared/lib/crud/errors` rather than hand-rolling `new CrudHttpError(404, …)`;
10
- read encrypted columns through `@open-mercato/shared/lib/encryption/find`; and never `$ilike`
11
- a column an encryption map covers — use `@open-mercato/shared/lib/search/tokenLookup`.
10
+ read direct ORM results through `@open-mercato/shared/lib/encryption/find`; and follow
11
+ [encrypted list search](../../om-data-model-design/references/sensitive-data.md#encrypted-list-search)
12
+ for the QueryEngine `$ilike` versus raw ORM token-lookup distinction and its populated-index precondition.
12
13
 
13
14
  There is no `@open-mercato/shared/lib/http/types`. A hand-written route handler takes the
14
15
  platform `Request` (`export async function GET(request: Request)`) and returns a platform
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/cli",
3
- "version": "0.10.1-develop.7826.1.5e82b7c668",
3
+ "version": "0.10.1-develop.7827.1.5c631908e4",
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.7826.1.5e82b7c668",
64
- "@open-mercato/queue": "0.10.1-develop.7826.1.5e82b7c668",
65
- "@open-mercato/shared": "0.10.1-develop.7826.1.5e82b7c668",
66
- "@open-mercato/telemetry": "0.10.1-develop.7826.1.5e82b7c668",
63
+ "@open-mercato/events": "0.10.1-develop.7827.1.5c631908e4",
64
+ "@open-mercato/queue": "0.10.1-develop.7827.1.5c631908e4",
65
+ "@open-mercato/shared": "0.10.1-develop.7827.1.5c631908e4",
66
+ "@open-mercato/telemetry": "0.10.1-develop.7827.1.5c631908e4",
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.7826.1.5e82b7c668"
78
+ "@open-mercato/shared": "0.10.1-develop.7827.1.5c631908e4"
79
79
  },
80
80
  "devDependencies": {
81
- "@open-mercato/shared": "0.10.1-develop.7826.1.5e82b7c668",
81
+ "@open-mercato/shared": "0.10.1-develop.7827.1.5c631908e4",
82
82
  "@types/jest": "^30.0.0",
83
83
  "jest": "^30.4.2",
84
84
  "ts-jest": "^29.4.12"