@open-mercato/cli 0.6.7-develop.6685.1.77c0a5591b → 0.6.7-develop.6687.1.46a258e592
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -3
- package/build.mjs +21 -5
- package/dist/agentic/claude-code/hooks/entity-migration-check.ts +32 -88
- package/dist/agentic/codex/enforcement-rules.md +2 -16
- package/dist/agentic/cursor/hooks/entity-migration-check.mjs +19 -50
- package/dist/agentic/cursor/rules/entity-guard.mdc +9 -21
- package/dist/agentic/cursor/rules/generated-guard.mdc +3 -5
- package/dist/agentic/cursor/rules/open-mercato.mdc +3 -29
- package/dist/agentic/guides/ai-workflows.md +76 -0
- package/dist/agentic/guides/architecture.md +107 -0
- package/dist/agentic/guides/backend-ui.md +80 -0
- package/dist/agentic/guides/contracts.md +92 -0
- package/dist/agentic/guides/extensions.md +104 -0
- package/dist/agentic/guides/integrations.md +81 -0
- package/dist/agentic/guides/module-facts.json +217 -81
- package/dist/agentic/guides/module-system.md +12 -127
- package/dist/agentic/guides/modules/ai_assistant.md +1 -1
- package/dist/agentic/guides/modules/api_docs.md +1 -1
- package/dist/agentic/guides/modules/api_keys.md +1 -1
- package/dist/agentic/guides/modules/attachments.md +2 -2
- package/dist/agentic/guides/modules/audit_logs.md +2 -2
- package/dist/agentic/guides/modules/auth.md +1 -1
- package/dist/agentic/guides/modules/business_rules.md +1 -1
- package/dist/agentic/guides/modules/catalog.md +5 -5
- package/dist/agentic/guides/modules/channel_gmail.md +1 -1
- package/dist/agentic/guides/modules/channel_imap.md +1 -1
- package/dist/agentic/guides/modules/checkout.md +1 -1
- package/dist/agentic/guides/modules/communication_channels.md +1 -1
- package/dist/agentic/guides/modules/configs.md +1 -1
- package/dist/agentic/guides/modules/content.md +1 -1
- package/dist/agentic/guides/modules/currencies.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts.md +1 -1
- package/dist/agentic/guides/modules/customers.md +2 -2
- package/dist/agentic/guides/modules/dashboards.md +1 -1
- package/dist/agentic/guides/modules/data_sync.md +1 -1
- package/dist/agentic/guides/modules/dictionaries.md +1 -1
- package/dist/agentic/guides/modules/directory.md +1 -1
- package/dist/agentic/guides/modules/entities.md +2 -2
- package/dist/agentic/guides/modules/events.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe.md +1 -1
- package/dist/agentic/guides/modules/generators.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops.md +1 -1
- package/dist/agentic/guides/modules/integrations.md +1 -1
- package/dist/agentic/guides/modules/messages.md +1 -1
- package/dist/agentic/guides/modules/notifications.md +1 -1
- package/dist/agentic/guides/modules/onboarding.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways.md +1 -1
- package/dist/agentic/guides/modules/perspectives.md +1 -1
- package/dist/agentic/guides/modules/planner.md +1 -1
- package/dist/agentic/guides/modules/portal.md +1 -1
- package/dist/agentic/guides/modules/progress.md +1 -1
- package/dist/agentic/guides/modules/query_index.md +2 -2
- package/dist/agentic/guides/modules/record_locks.md +1 -1
- package/dist/agentic/guides/modules/resources.md +1 -1
- package/dist/agentic/guides/modules/sales.md +17 -17
- package/dist/agentic/guides/modules/scheduler.md +1 -1
- package/dist/agentic/guides/modules/search.md +1 -1
- package/dist/agentic/guides/modules/security.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers.md +1 -1
- package/dist/agentic/guides/modules/sso.md +1 -1
- package/dist/agentic/guides/modules/staff.md +2 -2
- package/dist/agentic/guides/modules/storage_s3.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo.md +1 -1
- package/dist/agentic/guides/modules/sync_excel.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays.md +1 -1
- package/dist/agentic/guides/modules/translations.md +1 -1
- package/dist/agentic/guides/modules/webhooks.md +2 -2
- package/dist/agentic/guides/modules/wms.md +2 -2
- package/dist/agentic/guides/modules/workflows.md +1 -1
- package/dist/agentic/guides/testing-debugging.md +74 -0
- package/dist/agentic/guides/upstream/AGENTS.md +297 -0
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +303 -0
- package/dist/agentic/guides/upstream/manifest.json +8 -0
- package/dist/agentic/shared/AGENTS.md.template +123 -311
- package/dist/agentic/shared/ai/agentic.config.json +1 -0
- package/dist/agentic/shared/ai/harness/README.md +48 -0
- package/dist/agentic/shared/ai/harness/RELEASE.md +57 -0
- package/dist/agentic/shared/ai/harness/cases.json +13487 -0
- package/dist/agentic/shared/ai/harness/cases.schema.json +132 -0
- package/dist/agentic/shared/ai/harness/fixtures/index.json +49 -0
- package/dist/agentic/shared/ai/harness/fixtures/seeds.json +162 -0
- package/dist/agentic/shared/ai/harness/generated-code-review-policy.md +20 -0
- package/dist/agentic/shared/ai/harness/generated-code-review-response.schema.json +43 -0
- package/dist/agentic/shared/ai/harness/generated-code-review-result.schema.json +110 -0
- package/dist/agentic/shared/ai/harness/release-matrix.json +133 -0
- package/dist/agentic/shared/ai/harness/release-result.schema.json +219 -0
- package/dist/agentic/shared/ai/harness/result.schema.json +76 -0
- package/dist/agentic/shared/ai/harness/routing-response.schema.json +12 -0
- package/dist/agentic/shared/ai/harness/target-validation-result.schema.json +73 -0
- package/dist/agentic/shared/ai/harness/validators.json +78 -0
- package/dist/agentic/shared/ai/harness/writable-ast-oracles.mjs +1768 -0
- package/dist/agentic/shared/ai/harness/writable-behavior-oracles.mjs +1096 -0
- package/dist/agentic/shared/ai/review-checklist.md +36 -0
- package/dist/agentic/shared/ai/skills/om-auto-review-pr/SKILL.md +4 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/SKILL.md +20 -241
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/crud-surfaces.md +16 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/frontend-and-design-system.md +53 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/page-and-navigation.md +13 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/quality-states.md +11 -0
- package/dist/agentic/shared/ai/skills/om-build-workflow/SKILL.md +30 -0
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/activity-contracts.md +12 -0
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/durability-and-progress.md +13 -0
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/workflow-design.md +14 -0
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/SKILL.md +28 -0
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/attachments-and-overrides.md +12 -0
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/module-agents-and-tools.md +22 -0
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/orchestrator-agents.md +12 -0
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/surface-selector.md +19 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/SKILL.md +16 -601
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/integrity-and-concurrency.md +19 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/migration-workflow.md +13 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/schema-design.md +14 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/sensitive-data.md +10 -0
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/SKILL.md +14 -310
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/references/decision-and-procedure.md +17 -0
- package/dist/agentic/shared/ai/skills/om-evolve-harness/SKILL.md +28 -0
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-template.md +89 -0
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-workflow.md +16 -0
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/owner-selection.md +17 -0
- package/dist/agentic/shared/ai/skills/om-framework-context/SKILL.md +25 -0
- package/dist/agentic/shared/ai/skills/om-framework-context/references/resolver-procedure.md +11 -0
- package/dist/agentic/shared/ai/skills/om-framework-context/references/skew-and-escalation.md +13 -0
- package/dist/agentic/shared/ai/skills/om-help/SKILL.md +15 -97
- package/dist/agentic/shared/ai/skills/om-help/references/delivery-workflows.md +17 -0
- package/dist/agentic/shared/ai/skills/om-help/references/task-families.md +20 -0
- package/dist/agentic/shared/ai/skills/om-implement-spec/SKILL.md +15 -156
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/phases-and-gates.md +12 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/SKILL.md +24 -708
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/package-and-activation.md +16 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/provider-families.md +14 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/security-and-reliability.md +15 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/sync-and-files.md +12 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +20 -820
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/api-and-domain.md +19 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/business-one-shot-blueprints.md +107 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/data-and-migrations.md +12 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/discovery-surface-catalog.md +83 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/module-surfaces.md +21 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/planning.md +11 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/runtime-cache-and-queues.md +22 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/verification.md +13 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/SKILL.md +19 -843
- package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-branches.md +18 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/references/mechanism-selector.md +25 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/references/read-write-roundtrip.md +13 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/references/unified-overrides.md +38 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/references/verification.md +11 -0
- package/dist/agentic/shared/ai/skills/om-trim-unused-modules/SKILL.md +15 -63
- package/dist/agentic/shared/ai/skills/om-trim-unused-modules/references/dependency-and-redirect.md +15 -0
- package/dist/agentic/shared/ai/skills/om-troubleshooter/SKILL.md +16 -467
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/diagnosis-map.md +16 -0
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/regression-oracles.md +14 -0
- package/dist/agentic/shared/ai/skills/tiers.json +137 -20
- package/dist/agentic/shared/ai/skills/tiers.schema.json +52 -40
- package/dist/agentic/shared/scripts/agent-harness-tool-server.mjs +174 -0
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +2783 -0
- package/dist/agentic/shared/scripts/execution-sandbox.mjs +329 -0
- package/dist/agentic/shared/scripts/framework-context.mjs +894 -0
- package/dist/agentic/shared/scripts/install-skills.mjs +1029 -0
- package/dist/agentic/shared/scripts/install-skills.sh +4 -694
- package/dist/agentic/shared/scripts/prepare-agent-harness-fixture.mjs +222 -0
- package/dist/agentic/shared/scripts/run-agent-harness-release.mjs +1761 -0
- package/dist/lib/__integration__/TC-INT-008.spec.js +87 -8
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-init.js +13 -3
- package/dist/lib/agentic-init.js.map +2 -2
- package/dist/lib/agentic-setup.js +418 -186
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/generators/extensions/injection-widgets.js +20 -0
- package/dist/lib/generators/extensions/injection-widgets.js.map +2 -2
- package/dist/lib/generators/module-facts-discovery.js +41 -7
- package/dist/lib/generators/module-facts-discovery.js.map +2 -2
- package/dist/lib/generators/module-facts.js +65 -17
- package/dist/lib/generators/module-facts.js.map +2 -2
- package/dist/lib/generators/module-registry.js +5 -4
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/dist/lib/resolver.js +2 -0
- package/dist/lib/resolver.js.map +2 -2
- package/package.json +5 -5
- package/src/lib/__integration__/TC-INT-008.spec.ts +103 -8
- package/src/lib/__tests__/agentic-init.test.ts +41 -5
- package/src/lib/__tests__/agentic-setup.ownership.test.ts +380 -0
- package/src/lib/__tests__/injection-widget-id-validation.test.ts +184 -0
- package/src/lib/agentic-init.ts +15 -3
- package/src/lib/agentic-setup.ts +526 -224
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +6 -0
- package/src/lib/generators/__tests__/module-facts.customers.fixture.test.ts +1 -0
- package/src/lib/generators/__tests__/module-facts.discovery.test.ts +54 -10
- package/src/lib/generators/__tests__/module-facts.extension-hosts.test.ts +108 -0
- package/src/lib/generators/__tests__/module-subset.test.ts +18 -0
- package/src/lib/generators/extensions/injection-widgets.ts +51 -0
- package/src/lib/generators/module-facts-discovery.ts +58 -7
- package/src/lib/generators/module-facts.ts +84 -20
- package/src/lib/generators/module-registry.ts +8 -4
- package/src/lib/resolver.ts +3 -0
- package/dist/agentic/guides/cache.md +0 -45
- package/dist/agentic/guides/core.md +0 -453
- package/dist/agentic/guides/events.md +0 -117
- package/dist/agentic/guides/queue.md +0 -53
- package/dist/agentic/guides/search.md +0 -115
- package/dist/agentic/guides/shared.md +0 -108
- package/dist/agentic/guides/ui.md +0 -347
- package/dist/agentic/shared/ai/skills/om-auto-continue-pr-loop/SKILL.md +0 -27
- package/dist/agentic/shared/ai/skills/om-auto-create-pr-loop/SKILL.md +0 -27
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/ui-components.md +0 -260
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/mikro-orm-cheatsheet.md +0 -146
- package/dist/agentic/shared/ai/skills/om-help/references/skills-catalog.md +0 -84
- package/dist/agentic/shared/ai/skills/om-help/references/workflow-sequences.md +0 -193
- package/dist/agentic/shared/ai/skills/om-integration-builder/STANDALONE.md +0 -34
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/adapter-contracts.md +0 -762
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/naming-conventions.md +0 -50
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/navigation-patterns.md +0 -97
- package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-contracts.md +0 -271
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/diagnostic-commands.md +0 -101
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# search — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/search 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# security — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# shipping_carriers — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sso — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# staff — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|---|---|---|---|---|
|
|
8
8
|
| staff:staff_team | StaffTeam | staff_teams | yes | no |
|
|
9
9
|
| staff:staff_team_role | StaffTeamRole | staff_team_roles | yes | no |
|
|
10
|
-
| staff:staff_team_member | StaffTeamMember | staff_team_members | yes |
|
|
10
|
+
| staff:staff_team_member | StaffTeamMember | staff_team_members | yes | yes |
|
|
11
11
|
| staff:staff_leave_request | StaffLeaveRequest | staff_leave_requests | yes | no |
|
|
12
12
|
| staff:staff_team_member_comment | StaffTeamMemberComment | staff_team_member_comments | yes | no |
|
|
13
13
|
| staff:staff_team_member_activity | StaffTeamMemberActivity | staff_team_member_activities | yes | no |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# storage_s3 — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/storage-s3 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_akeneo — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/sync-akeneo 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_excel — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# system_status_overlays — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# translations — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# webhooks — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/webhooks 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -43,7 +43,7 @@ _none_
|
|
|
43
43
|
## Host extension points
|
|
44
44
|
|
|
45
45
|
- Entity IDs: webhooks:webhook_entity · webhooks:webhook_delivery_entity · webhooks:webhook_inbound_receipt_entity
|
|
46
|
-
- Table IDs: webhooks.deliveries · webhooks.list
|
|
46
|
+
- Table IDs: webhooks.deliveries · webhooks.integration-deliveries · webhooks.list
|
|
47
47
|
|
|
48
48
|
## Notifications
|
|
49
49
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# wms — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -66,7 +66,7 @@ _none_
|
|
|
66
66
|
## Host extension points
|
|
67
67
|
|
|
68
68
|
- Entity IDs: _none_
|
|
69
|
-
- Table IDs:
|
|
69
|
+
- Table IDs: wms.config.inventoryProfiles · wms.config.locations · wms.config.warehouses · wms.config.zones · wms.location.activity · wms.location.items · wms.lot.activity · wms.lot.distribution · wms.lots.list · wms.sku.activity · wms.sku.distribution
|
|
70
70
|
|
|
71
71
|
## Notifications
|
|
72
72
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# workflows — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6687.1.46a258e592; core 0.6.7-develop.6687.1.46a258e592 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Testing and Root-Cause Debugging
|
|
2
|
+
|
|
3
|
+
Diagnose before editing, fix the smallest knowledge/code owner, and prove the regression through the real runtime path.
|
|
4
|
+
|
|
5
|
+
## Context Restraint
|
|
6
|
+
|
|
7
|
+
Name the areas the failure spans before loading anything, from the SYMPTOM and not only from the cause: a value that will not render, a session/locale/hydration mismatch, or a stale form spans `backend-ui`; wrong or lost records, commands, or events span `module-data`; an installed module's own surface spans `umes`; an external provider call spans `integration`.
|
|
8
|
+
|
|
9
|
+
A fix is always `debugging` plus every area you just named. Proving the fix with a regression oracle is part of `debugging` and does NOT add `testing`; a request that explicitly asks for tests, coverage, or app-level verification also selects `testing`. Load exactly this guide, each named area's guide, and `om-troubleshooter` — that is what selects those routes.
|
|
10
|
+
|
|
11
|
+
Add an area's authoring skill when the fix **introduces or reworks** a contract there — a concurrency header on existing calls, a new field or UI surface, a new command, a new invalidation, a new guard, or a provider's pagination cursor, bounded retry, idempotency, or reconciliation — because you are then designing that surface, not just repairing it. Provider cursor/retry/idempotency fixes therefore load `om-integration-builder` even when the request is framed as a bug fix. Load `om-troubleshooter` alone when you only correct existing behavior, such as a hydration mismatch or a value that fails to round-trip.
|
|
12
|
+
|
|
13
|
+
Then stop. Budgets here are tight — several fixes allow only five files — so load no other area's skill, no `references/` you do not need, no contracts guide unless the fix changes a data, API, command, ACL, or setup contract, and a module fact sheet only for a module the failure actually involves.
|
|
14
|
+
|
|
15
|
+
## Investigation Order
|
|
16
|
+
|
|
17
|
+
1. Reproduce with the smallest stable command, request, or UI path and capture expected versus actual behavior.
|
|
18
|
+
2. Classify the failing bootstrap: browser/server, API, CLI, worker, queue, generated registry, package artifact, or external provider.
|
|
19
|
+
3. Read the routed guide plus generated module facts. Use `om-framework-context` only when exact installed implementation is necessary.
|
|
20
|
+
4. Trace from the public call site to the first incorrect invariant. Check scope, auth, validation, state transition, transaction boundary, side effects, and response serialization in that order.
|
|
21
|
+
5. Add a regression oracle that fails before the fix (`unit-regression-oracle` when that decision vocabulary is requested). Implement the minimal complete repair and rerun affected plus safety cases.
|
|
22
|
+
|
|
23
|
+
## Frequent Failure Families
|
|
24
|
+
|
|
25
|
+
| Symptom | Check first |
|
|
26
|
+
|---|---|
|
|
27
|
+
| 401 loop/all-organizations failure | Null-scope behavior, session refresh ownership, and fail-closed versus intentionally global paths. |
|
|
28
|
+
| Missing/extra tenant data | Every query/write/filter/cache/job payload; scope derived from auth, not body. |
|
|
29
|
+
| Field does not save/clear | Validator → command → entity → response transform → form initial value; truthy/default fallbacks. |
|
|
30
|
+
| Concurrent update overwrites | `updated_at` projection, client header, aggregate command guard, conflict surface. |
|
|
31
|
+
| Partial state after failure | Transaction/`withAtomicFlush`, query between mutation/flush, side effects before commit. |
|
|
32
|
+
| Stale list/search | Command side-effect aliases, cache tags/invalidation, query-index convergence/reindex. |
|
|
33
|
+
| Works in web but not CLI/worker | Bootstrap/registry initialization, package exports, generated imports, runtime scope. |
|
|
34
|
+
| Duplicate registry/provider | Bundler chunk singleton or `instanceof`; use global registry/structural guard. |
|
|
35
|
+
| Hydration mismatch | Server/client locale, timezone, randomness, browser-only environment, initial async state. |
|
|
36
|
+
| UI access differs from API/PDF/export | Compare every alternate route's metadata/features and wildcard matching. |
|
|
37
|
+
| Provider loses/duplicates records | Idempotency key, cursor commit point, webhook/poll race, external mapping and reconciliation. |
|
|
38
|
+
|
|
39
|
+
## Generated and Package Diagnostics
|
|
40
|
+
|
|
41
|
+
- Never edit generated output to prove a theory. Inspect the source discovery path, run `yarn generate`, and compare the affected registry entry.
|
|
42
|
+
- When an app imports a symbol but workspace tests pass, inspect package exports and packed/installed `dist` plus types.
|
|
43
|
+
- Search ignored installed source only through the bounded resolver output. Record resolved package versions and fact stamps.
|
|
44
|
+
- If a stale chunk/cache is suspected, prove the source/generator is correct before using the app's documented reset escape hatch.
|
|
45
|
+
|
|
46
|
+
## Data and Security Regression Oracles
|
|
47
|
+
|
|
48
|
+
- Create fixtures for two tenants and two organizations; assert allowed, denied, null-scope, and wildcard-feature behavior.
|
|
49
|
+
- Inject failure between multi-phase writes; assert no partial rows/state and no premature event/cache/index side effect.
|
|
50
|
+
- Exercise update and delete with current, stale, and missing versions.
|
|
51
|
+
- Test malformed IDs/filters and ensure invalid input cannot widen a query.
|
|
52
|
+
- Test retry, duplicate delivery, cancellation, and worker restart for external/queued operations.
|
|
53
|
+
- Provider failure/retry/idempotency tests use an ephemeral test environment (`ephemeral-test-environment`) with mock effects, assert secrets are absent and diagnostics redacted (`health-retry-redaction`), and surface every real failure (`honest-test-result`).
|
|
54
|
+
|
|
55
|
+
## UI Regression Oracles
|
|
56
|
+
|
|
57
|
+
- Use API-created fixtures and clean them in `finally`; do not depend on demo data.
|
|
58
|
+
- Cover loading, empty, validation, server error, conflict, retry, success, and authorization.
|
|
59
|
+
- Save/reload/edit/clear fields and verify API plus rendered values.
|
|
60
|
+
- Render under at least two locales/timezones when hydration or formatting is involved.
|
|
61
|
+
- Prefer semantic assertions and stable IDs over full DOM/file snapshots.
|
|
62
|
+
|
|
63
|
+
## Validation Ladder
|
|
64
|
+
|
|
65
|
+
Before authoring a test file, read `.ai/skills/om-module-scaffold/references/verification.md` for the scaffold's test-runner contract.
|
|
66
|
+
|
|
67
|
+
1. Focused unit/regression test.
|
|
68
|
+
2. `yarn generate` when discovery is involved.
|
|
69
|
+
3. Focused package/app typecheck or test.
|
|
70
|
+
4. `yarn typecheck`, `yarn lint`, `yarn test`, `yarn build` for broad/contract changes.
|
|
71
|
+
5. `yarn test:integration:ephemeral` or a filtered integration run for affected API/UI paths.
|
|
72
|
+
6. Packed/Verdaccio standalone validation when package exports or compiled discovery are involved.
|
|
73
|
+
|
|
74
|
+
Do not replace deterministic convergence with sleeps. Do not suppress failing tests, weaken assertions, or call a bug fixed because only one bootstrap path passes.
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# Agents Guidelines
|
|
2
|
+
|
|
3
|
+
Leverage the module system and follow strict naming and coding conventions to keep the system consistent and safe to extend.
|
|
4
|
+
|
|
5
|
+
> **Instruction budget:** this file must stay under **32,768 bytes** (Codex's default
|
|
6
|
+
> `project_doc_max_bytes`, shared with the nested `AGENTS.md` files below it) — anything past
|
|
7
|
+
> that byte offset never reaches the agent. Keep hard rules and routing here, put long-form
|
|
8
|
+
> procedure in `.ai/docs/*`, and run `yarn agents:check-budget`. See
|
|
9
|
+
> [`.ai/docs/agent-instructions.md`](.ai/docs/agent-instructions.md).
|
|
10
|
+
|
|
11
|
+
## Always
|
|
12
|
+
|
|
13
|
+
- Check the Task Router below before research or coding; a single task may match multiple rows, and all relevant guides apply.
|
|
14
|
+
- Check `.ai/specs/` and `.ai/specs/enterprise/` for existing specs before modifying a module.
|
|
15
|
+
- Enter plan mode for non-trivial tasks with 3+ steps or architectural decisions.
|
|
16
|
+
- Identify the reference module (`customers`) when building CRUD features.
|
|
17
|
+
- Preserve behavior unless the user or a spec explicitly asks for a behavior change.
|
|
18
|
+
- Keep changes minimal, focused, and integrated through real call sites.
|
|
19
|
+
- Use the closest package/module `AGENTS.md` for local architecture, imports, and validation commands.
|
|
20
|
+
- Follow `BACKWARD_COMPATIBILITY.md` before touching any contract surface.
|
|
21
|
+
- Run `yarn generate` after adding or modifying module files that rely on auto-discovery.
|
|
22
|
+
- Support optimistic locking on every NEW user-editable entity and edit/delete form (it is **default ON**): give the entity an `updated_at` column, return `updatedAt` in its list/detail API responses, and let `CrudForm` auto-derive the header from `initialValues.updatedAt` (covers update **and** delete) — or, for custom non-`CrudForm` handlers, wrap the mutating call with `withScopedApiRequestHeaders(buildOptimisticLockHeader(record.updatedAt), …)` and surface conflicts via `surfaceRecordConflict(err, t)`. When a form's `onSubmit` mutates OTHER entities, override the parent header per child with that child's own version (avoid false 409s). Enforced by `optimistic-lock-editable-entities.test.ts` and `optimistic-lock-ui-coverage.test.ts`. Details: the Task Router row.
|
|
23
|
+
|
|
24
|
+
## Ask First
|
|
25
|
+
|
|
26
|
+
- Ask before reducing scope, changing architecture, changing public contracts, adding production dependencies, or touching multiple modules in a way not covered by an existing spec.
|
|
27
|
+
- Ask before changing branch/PR automation, pipeline labels, QA flow, release behavior, or external official-module submodule pointers.
|
|
28
|
+
- Ask before applying database migrations locally with `yarn db:migrate`; normal PRs should include migration files and snapshots.
|
|
29
|
+
- Ask before introducing provider-specific preconfiguration outside the provider package.
|
|
30
|
+
|
|
31
|
+
## Never
|
|
32
|
+
|
|
33
|
+
- Never expose cross-tenant data or skip tenant/organization scoping.
|
|
34
|
+
- Never edit generated files by hand.
|
|
35
|
+
- Never add code directly under `apps/mercato/src/` except committed, typed `*.generated.ts` registries described below.
|
|
36
|
+
- Never create direct ORM relationships between modules.
|
|
37
|
+
- Never bypass mutation guards, command side effects, encryption helpers, RBAC wildcard matching, or shared UI data-call helpers.
|
|
38
|
+
- Never hard-code user-facing strings or design-system status colors.
|
|
39
|
+
- Never commit credentials, raw tokens, private keys, local-only ops files, or fork-only infrastructure notes into upstream-friendly branches.
|
|
40
|
+
|
|
41
|
+
## Validation Commands
|
|
42
|
+
|
|
43
|
+
Choose the smallest relevant set for the change:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
yarn generate
|
|
47
|
+
yarn build:packages
|
|
48
|
+
yarn typecheck
|
|
49
|
+
yarn lint
|
|
50
|
+
yarn test
|
|
51
|
+
yarn build:app
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The full CI-mirroring gate (used by review/automation skills) is the ordered `validation.commands` list in `.ai/agentic.config.json`.
|
|
55
|
+
|
|
56
|
+
**Where to run them:** decide once per gate sequence — Docker mode when a compose `app` container is running (then `yarn X` becomes `node scripts/docker-exec.mjs X`), otherwise local mode — and record the chosen runner in your output. Probe order and exact rules: [`.ai/docs/agent-instructions.md`](.ai/docs/agent-instructions.md).
|
|
57
|
+
|
|
58
|
+
## Task Router — Where to Find Detailed Guidance
|
|
59
|
+
|
|
60
|
+
IMPORTANT: Before any research or coding, match the task to this table. A single task often maps to **multiple rows** — "add a new module with search" needs both the Module Development and Search guides. Read **all** matching guides first; they carry the imports, patterns and constraints you need. Only use Explore agents for topics no AGENTS.md covers.
|
|
61
|
+
|
|
62
|
+
Guide shorthand: `<pkg>` = `packages/<pkg>/AGENTS.md` (so `core` = `packages/core/AGENTS.md`, `ui` = `packages/ui/AGENTS.md`), `core:<module>` = `packages/core/src/modules/<module>/AGENTS.md`, `ui:backend` = `packages/ui/src/backend/AGENTS.md`. `→ Section` names the heading to read inside that file.
|
|
63
|
+
|
|
64
|
+
| Task | Guide |
|
|
65
|
+
|------|-------|
|
|
66
|
+
| **Module Development** | |
|
|
67
|
+
| New module, scaffolding, auto-discovery paths | `core` + [`.ai/docs/module-development.md`](.ai/docs/module-development.md). **Standalone apps**: the `om-module-scaffold` skill scaffolds a module end-to-end |
|
|
68
|
+
| Official modules via the `external/official-modules` submodule, activation (`yarn official-modules`, `official-modules.json`), committing to the submodule's git | [`.ai/docs/official-modules.md`](.ai/docs/official-modules.md) |
|
|
69
|
+
| CRUD API routes, OpenAPI specs, `makeCrudRoute`, query engine integration | `core` → API Routes |
|
|
70
|
+
| `setup.ts` tenant init, role features, syncing ACL grants to roles, seeding defaults/examples | `core` → Module Setup |
|
|
71
|
+
| Typed events with `createModuleEvents`, CRUD/lifecycle events, subscribers | `core` → Events |
|
|
72
|
+
| In-app notifications, subscriber-based alerts, renderers; reactive handlers (`notifications.handlers.ts`), `useNotificationEffect` | `core` → Notifications + `ui` |
|
|
73
|
+
| Injecting UI widgets into other modules, spot IDs, cross-module UI extensions | `core` → Widgets |
|
|
74
|
+
| Headless injection widgets (menu items, columns, fields), `InjectionPosition`, `useInjectionDataWidgets`; DataTable extension widgets (columns/row actions/bulk actions/filters); CrudForm field widgets (`crud-form:<entityId>:fields`) | `core` → Widget Injection + `ui` → DataTable / CrudForm Guidelines |
|
|
75
|
+
| Menu items into main/settings/profile sidebars or topbar dropdown (`useInjectedMenuItems`, `mergeMenuItems`) | `ui` |
|
|
76
|
+
| API route interceptors (`api/interceptors.ts`, before/after hooks, body/query rewrite) | `core` → API Interceptors |
|
|
77
|
+
| Bulk operations, DataTable bulk actions, selected-row mutations, long-running operations with progress | `core:progress` + `ui` → DataTable Guidelines + `queue` |
|
|
78
|
+
| Replacing/wrapping UI components via `widgets/components.ts` (`replace`/`wrapper`/`props`) | `core` → Component Replacement + `ui` |
|
|
79
|
+
| Custom fields/entities, DSL helpers (`defineLink`, `cf.*`), `ce.ts` | `core` → Custom Fields |
|
|
80
|
+
| Entity extensions, cross-module data links, `data/extensions.ts` | `core` → Extensions |
|
|
81
|
+
| Coupling one module to another (events / widget injection + enrichers / FK-id + snapshot / soft-optional `tryResolve`), depending on an OPTIONAL integration | `core` → Cross-Module Coupling + `packages/core/src/__tests__/module-decoupling.test.ts` |
|
|
82
|
+
| RBAC features in `acl.ts`, declarative guards, permission checks | `core` → Access Control |
|
|
83
|
+
| Wildcard ACL handling in feature-gated runtime helpers (menus, notification handlers, mutation guards, command interceptors, AI tools) | `core` → Access Control + `shared` + `ui` + `core:auth` (portal: `core:customer_accounts`) |
|
|
84
|
+
| Encrypted queries (`findWithDecryption`), encryption defaults, GDPR fields | `core` → Encryption |
|
|
85
|
+
| Response enrichers for other modules' API responses | `core` → Response Enrichers |
|
|
86
|
+
| Filtering CRUD list APIs by multiple IDs (`?ids=uuid1,uuid2`), interceptor-driven ID narrowing | `core` → API Interceptors + `shared` |
|
|
87
|
+
| Optimistic locking / concurrent-edit conflicts: `updated_at` versioning (**default ON** for every `makeCrudRoute` entity, opt out with `OM_OPTIMISTIC_LOCK=off`), the 409 body, client helpers (`buildOptimisticLockHeader`, `extractOptimisticLockConflict`), command-pattern writes (`enforceCommandOptimisticLock`, the DI-overridable `createCommandOptimisticLockGuardService`), the unified conflict bar (`surfaceRecordConflict`) | `apps/docs/docs/framework/data-integrity/concurrency-locking.mdx` (§ Protecting command/action endpoints) + `.ai/specs/implemented/2026-05-25-oss-optimistic-locking.md` + `.ai/specs/2026-05-28-optimistic-locking-coverage-completion.md` + `packages/shared/src/lib/crud/optimistic-lock{,-command}.ts` + `packages/ui/src/backend/conflicts/` |
|
|
88
|
+
| DOM Event Bridge (SSE real-time events to browser), `useAppEvent`, `useOperationProgress` | `events` → DOM Event Bridge |
|
|
89
|
+
| Customer portal pages, portal auth, portal nav injection, portal event bridge | `ui` → Portal Extension + `om-backend-ui-design` skill |
|
|
90
|
+
| Widget event handlers (`onFieldChange`, `onBeforeNavigate`, transformers) | `ui` |
|
|
91
|
+
| AI agents/tools (`ai-agents.ts`, `ai-tools.ts`, tool packs, mutation approval via `prepareMutation`, attachments, provider/model selection) | `.ai/skills/om-create-ai-agent/SKILL.md` + `ai-assistant` + `apps/docs/docs/framework/ai-assistant/*.mdx` |
|
|
92
|
+
| AI agent loop controls + overrides (`loop.stopWhen/prepareStep/budget`, per-tenant settings, replacing/disabling agents/tools, `entry.overrides`) | `ai-assistant` → Loop controls + How to Override; in `.ai/specs/implemented/`: `2026-04-28-ai-agents-agentic-loop-controls`, `2026-04-30-ai-overrides-and-module-disable`, `2026-05-04-modules-ts-unified-overrides` |
|
|
93
|
+
| **Specific Modules** | |
|
|
94
|
+
| Module-specific work (customers as CRUD reference, plus sales, catalog, auth, customer_accounts, currencies, workflows, integrations, data_sync, progress) | `packages/core/src/modules/<module>/AGENTS.md` |
|
|
95
|
+
| Webhooks (outbound/inbound, Standard Webhooks signing, delivery queues, admin UI) | `webhooks` (cross-refs `queue`, `events`, `core:integrations`, `ui`) |
|
|
96
|
+
| New integration provider (adapter, health check, credentials, bundle wiring) | `.ai/skills/om-integration-builder/SKILL.md` + `core:integrations` + `core:data_sync` |
|
|
97
|
+
| **Packages** | |
|
|
98
|
+
| Reusable utilities, encryption helpers, i18n (`useT`/`resolveTranslations`), boolean parsing, data engine types, request scoping | `shared` |
|
|
99
|
+
| Structured logging / replacing raw `console.*` with the facade (`createLogger`, `child()`, `OM_LOG_LEVEL`), advisory `yarn logger:check-console` | `apps/docs/docs/framework/runtime/logging.mdx` + `.ai/specs/2026-07-02-structured-logging-facade.md` + `shared` |
|
|
100
|
+
| Forms (`CrudForm`), data tables (`DataTable`), loading/error states, flash messages, `FormHeader`/`FormFooter`, dialog UX | `ui` + `om-backend-ui-design` skill (+ `om-ds-guardian` for DS-token compliance) |
|
|
101
|
+
| Reusing backend component families (charts/KPIs, filters, detail sections, schedule, messages, notifications, page scaffolding, banners) — check BEFORE building any from scratch | [`.ai/ui-backend-components.md`](.ai/ui-backend-components.md) + `ui` |
|
|
102
|
+
| Backend page components, `apiCall` usage, `RowActions` ids, `LoadingMessage`/`ErrorMessage` | `ui:backend` + `om-backend-ui-design` skill |
|
|
103
|
+
| Fulltext/vector/token search, `search.ts`, reindexing entities, debugging search, search CLI | `search` |
|
|
104
|
+
| MCP tools (`registerMcpTool`), OpenCode config, AI chat debugging, session tokens, command palette, two-tier auth | `ai-assistant` |
|
|
105
|
+
| Generators (`yarn generate`), migrations (`yarn db:generate`), module scaffolding, build order | `cli` |
|
|
106
|
+
| Event bus architecture, ephemeral vs persistent subscriptions, queue integration, event workers | `events` |
|
|
107
|
+
| Cache in a module, tag-based invalidation, tenant-scoped caching, strategy (memory/SQLite/Redis) | `cache` |
|
|
108
|
+
| Background workers, concurrency (I/O vs CPU-bound), idempotent jobs, queue strategies | `queue` |
|
|
109
|
+
| Operation progress in the top bar, `ProgressJob`s, client-local progress events | `core:progress` + `events` → DOM Event Bridge |
|
|
110
|
+
| Onboarding wizard steps, tenant setup hooks (`onTenantCreated`/`seedDefaults`), welcome/invitation emails | `onboarding` |
|
|
111
|
+
| Static content pages (privacy policies, terms, legal pages) | `content` |
|
|
112
|
+
| Standalone apps with Verdaccio, publishing packages, canary releases, template scaffolding | `create-app` |
|
|
113
|
+
| Editing `apps/mercato/src/app/**` or env vars in `apps/mercato/.env.example` — MUST mirror into the create-app template in the same task | `create-app` → Template Sync Checklist |
|
|
114
|
+
| Deploying a scaffolded app to Railway with `mercato deploy railway` | [`.ai/specs/2026-05-12-railway-one-command-deploy.md`](.ai/specs/2026-05-12-railway-one-command-deploy.md) + [`apps/docs/docs/deployment/railway.mdx`](apps/docs/docs/deployment/railway.mdx) + `cli` |
|
|
115
|
+
| **Performance** | |
|
|
116
|
+
| Profiling dev-mode memory (`yarn dev:profile`), ranking memory hogs, watcher / Vite-vs-Turbopack tradeoffs | `.ai/specs/2026-05-27-dev-mode-memory-quick-wins.md` + `scripts/profile-dev-rss.mjs` |
|
|
117
|
+
| **Migration** | |
|
|
118
|
+
| Migrating custom module code from MikroORM v6 to v7 (decorators, persist/flush, Knex→Kysely, ORM config, Jest setup) | `.ai/skills/om-migrate-mikro-orm/SKILL.md` |
|
|
119
|
+
| **Testing** | |
|
|
120
|
+
| Integration testing, Playwright tests, converting markdown test cases to TypeScript, CI test pipeline | `.ai/qa/AGENTS.md` + `.agents/skills/om-integration-tests/SKILL.md` |
|
|
121
|
+
| Refreshing standalone-app AI harness coverage after module, extension-point, contract, generator/discovery, or release changes | `.ai/skills/om-refresh-standalone-harness/SKILL.md` + `packages/create-app/agentic/shared/ai/skills/om-evolve-harness/SKILL.md` |
|
|
122
|
+
| **Spec & PR Automation** | |
|
|
123
|
+
| Spec lifecycle (pre-implement → implement → write/update), code review, DS review | `.agents/skills/{om-spec-writing,om-code-review}/SKILL.md` + `.ai/skills/{om-pre-implement-spec,om-implement-spec,om-ds-guardian}/SKILL.md` + `.ai/specs/AGENTS.md` + `.ai/ds-rules.md` |
|
|
124
|
+
| PR/issue automation (one-shot auto-PR, resumable loop variants, review/merge-buddy, post-merge sync, changelog, UI QA). **Default for one-off bug fixes / small features:** `om-auto-create-pr` | `.agents/skills/{om-auto-create-pr,om-auto-continue-pr,om-auto-create-pr-loop,om-auto-continue-pr-loop,om-auto-review-pr,om-auto-qa-pr,om-merge-buddy,om-review-prs,om-close-fixed-issues,om-auto-update-changelog,om-prepare-issue}/SKILL.md` |
|
|
125
|
+
| **Agent harness itself** | |
|
|
126
|
+
| Editing this file or a package `AGENTS.md`; the instruction budget and boundary labels | [`.ai/docs/agent-instructions.md`](.ai/docs/agent-instructions.md) + `scripts/check-agents-md-budget.mjs` (`yarn agents:check-budget`) |
|
|
127
|
+
|
|
128
|
+
Most `om-*` automation skills come from the shared [open-mercato/skills](https://github.com/open-mercato/skills) collection; `yarn install-skills` installs and updates them. Repo-specific settings live in `.ai/agentic.config.json` (+ the tracker descriptor `.ai/trackers/github.md`); a folder under `.ai/skills/` matching an external skill name is a repo-local override those skills follow on top of their built-in workflow, and the remaining `.ai/skills/` folders are repo-local skills installed by tier (`.ai/skills/tiers.json`). Both sources install into **one canonical directory**, `.agents/skills/` (Claude Code cannot read it, so it also gets a symlink layer under `.claude/skills/`). Installer flags: [`.ai/skills/README.md`](.ai/skills/README.md).
|
|
129
|
+
|
|
130
|
+
## Core Principles
|
|
131
|
+
|
|
132
|
+
- **Simplicity First**: Make every change as simple as possible. Impact minimal code.
|
|
133
|
+
- **No Laziness**: Find root causes. No temporary fixes. Senior developer standards.
|
|
134
|
+
- **Minimal Impact**: Changes should only touch what's necessary. Avoid introducing bugs.
|
|
135
|
+
|
|
136
|
+
## Workflow Orchestration
|
|
137
|
+
|
|
138
|
+
1. **Spec-first**: Enter plan mode for non-trivial tasks (3+ steps or architectural decisions). Check `.ai/specs/` and `.ai/specs/enterprise/` before coding; name new spec files `{YYYY-MM-DD}-{kebab-case-title}.md`. Skip for small fixes. Skills: `om-spec-writing` (research/phasing), `om-pre-implement-spec` (readiness audit), `om-implement-spec` (execution).
|
|
139
|
+
2. **Subagent strategy**: Use subagents liberally to keep main context clean. Offload research and parallel analysis. One task per subagent.
|
|
140
|
+
3. **Self-improvement**: After corrections, update `.ai/lessons.md` or relevant AGENTS.md. Write rules that prevent the same mistake.
|
|
141
|
+
4. **Verification**: Run tests, check build, suggest user verification. Ask: "Would a staff engineer approve this?"
|
|
142
|
+
5. **Elegance**: For non-trivial changes, pause and ask "is there a more elegant way?" Skip for simple fixes.
|
|
143
|
+
6. **Autonomous bug fixing**: When given a bug report, just fix it. Point at logs/errors, then resolve. Zero hand-holding.
|
|
144
|
+
|
|
145
|
+
## PR Workflow
|
|
146
|
+
|
|
147
|
+
Full policy — label taxonomy, priority/risk inference tables, pipeline transitions, the automated-verification exemption, the self-QA exception and the auto-skill claim protocol: [`.ai/docs/pr-workflow.md`](.ai/docs/pr-workflow.md). The boundaries:
|
|
148
|
+
|
|
149
|
+
- Pipeline labels are mutually exclusive: `review`, `changes-requested`, `qa`, `qa-failed`, `merge-queue`, `blocked`, `do-not-merge`. A ready non-draft PR carries `review` unless it is already in another pipeline state.
|
|
150
|
+
- Category (`bug`, `feature`, `refactor`, `security`, `dependencies`, `enterprise`, `documentation`) and meta (`needs-qa`, `skip-qa`, `qa-approved`, `qa-self-verified`, `in-progress`, `screenshots`) labels are additive.
|
|
151
|
+
- Every non-draft PR carries **exactly one** priority label (`priority-low|medium|high|extreme`, urgency) and **exactly one** risk label (`risk-low|medium|high`, blast radius). They are orthogonal; when signals conflict pick the higher one and say why in the label comment.
|
|
152
|
+
- **QA-approval merge gate (hard rule): a PR carrying `needs-qa` MUST NOT be merged unless it also carries `qa-approved`**, even when every other check is green. `skip-qa` is the explicit opt-out; never combine it with `needs-qa`/`qa-approved`. `qa-failed`, `do-not-merge` and `blocked` are likewise hard merge blocks.
|
|
153
|
+
- **Automated-verification exemption:** a change touching no UI-rendering file (no `.tsx` outside tests, nothing under `packages/ui/src/` or `**/components/**`) takes `skip-qa` — **but only** with the database structure and API surface unchanged, no `BACKWARD_COMPATIBILITY.md` contract broken, and automated tests for the changed behavior in the same PR; otherwise it keeps `needs-qa`.
|
|
154
|
+
- `qa-approved`/`qa-self-verified` are label writes: a `read`-permission contributor posts the QA evidence comment and a maintainer applies the labels; a skill that cannot apply them MUST report it stopped there.
|
|
155
|
+
- The `qa` pipeline label means manual QA is **in progress** and is set by QA reviewers only — `om-auto-*` skills request QA with `needs-qa` and never touch `qa`.
|
|
156
|
+
- Auto-skills claim a PR/issue with all three signals (assignee, `in-progress` label, claim comment), release `in-progress` even on failure, and comment the rationale whenever they change a pipeline/meta label.
|
|
157
|
+
|
|
158
|
+
### Documentation and Specifications
|
|
159
|
+
|
|
160
|
+
- OSS specs live in `.ai/specs/`; commercial/enterprise specs live in `.ai/specs/enterprise/` — see `.ai/specs/AGENTS.md` for naming, structure, and changelog conventions. Always check for existing specs before modifying a module, and update them when implementing significant changes.
|
|
161
|
+
- For every new feature, the spec MUST list integration coverage for all affected API paths and key UI paths, and those integration tests MUST ship in the same change — see `.ai/qa/AGENTS.md`.
|
|
162
|
+
- Integration tests MUST be self-contained: create required fixtures in test setup (prefer API fixtures), clean up created records in teardown/finally, and remain stable without relying on seeded/demo data.
|
|
163
|
+
|
|
164
|
+
## Monorepo Structure
|
|
165
|
+
|
|
166
|
+
### Apps (`apps/`)
|
|
167
|
+
|
|
168
|
+
- **mercato**: Main Next.js app. Put user-created modules in `apps/mercato/src/modules/`.
|
|
169
|
+
- **docs**: Documentation site.
|
|
170
|
+
|
|
171
|
+
### Packages (`packages/`)
|
|
172
|
+
|
|
173
|
+
All packages use the `@open-mercato/<package>` naming convention: **shared** (cross-cutting utilities, types, DSL helpers, i18n, data engine), **ui**, **core** (business modules: auth, catalog, customers, sales), **cli**, **cache** (always via DI, never raw Redis/SQLite), **queue** (background jobs via the worker contract, never custom queues), **events**, **search**, **ai-assistant**, **content**, **onboarding**, **enterprise** (commercial-only modules and overlays).
|
|
174
|
+
|
|
175
|
+
### Where to Put Code
|
|
176
|
+
|
|
177
|
+
- Put core platform features in `packages/<package>/src/modules/<module>/`
|
|
178
|
+
- Put every external integration provider in a dedicated npm workspace package under `packages/<provider-package>/` (for example `packages/gateway-stripe`, `packages/carrier-inpost`) — do not add provider modules inside `packages/core/src/modules/`
|
|
179
|
+
- Put shared utilities and types in `packages/shared/src/lib/` or `packages/shared/src/modules/`
|
|
180
|
+
- Put UI components in `packages/ui/src/`
|
|
181
|
+
- Put user/app-specific modules in `apps/mercato/src/modules/<module>/`
|
|
182
|
+
- MUST NOT add code directly in `apps/mercato/src/` — it's a boilerplate for user apps. Narrow exception: committed, typed *generated registries* (`*.generated.ts`) that must survive `yarn clean-generated` and travel with the repo — see [Generated Files: versioned vs ephemeral](.ai/docs/module-development.md#generated-files-versioned-vs-ephemeral).
|
|
183
|
+
|
|
184
|
+
### `external/official-modules/` (git submodule)
|
|
185
|
+
|
|
186
|
+
An optional, uncommitted git submodule. When present it is **real working code** — first-class for search, grep and refactoring, not vendored build output. Edits there commit to the submodule's own git and ship as a separate PR; **never `git add external/official-modules`** (pointer bump) unless explicitly asked. Activation, module-id convention and cross-repo merge order: [`.ai/docs/official-modules.md`](.ai/docs/official-modules.md).
|
|
187
|
+
|
|
188
|
+
### When You Need an Import
|
|
189
|
+
|
|
190
|
+
Each package's AGENTS.md is the authoritative cheat sheet for its own imports: UI primitives, backend utilities (`apiCall`, `CrudForm`) and portal hooks → `ui` + `ui:backend`; AI helpers (`defineAiAgent`, `defineAiTool`, `prepareMutation`, `<AiChat>`) → `ai-assistant`; cross-cutting helpers (i18n, commands, encryption, scoped payloads, boolean parsing, data/query engine types, overrides) → `shared`; customer/portal auth helpers, custom-field helpers, CRUD/Indexer types → `shared` + `core`; everything else → the matching package.
|
|
191
|
+
|
|
192
|
+
Examples worth memorising (used everywhere): `apiCall` from `@open-mercato/ui/backend/utils/apiCall`, `useT` from `@open-mercato/shared/lib/i18n/context`, `resolveTranslations` from `@open-mercato/shared/lib/i18n/server`, `Spinner` from `@open-mercato/ui/primitives/spinner`.
|
|
193
|
+
|
|
194
|
+
Import strategy:
|
|
195
|
+
- Prefer package-level imports (`@open-mercato/<package>/...`) over deep relative imports (`../../../...`) when crossing module boundaries, referencing shared module internals, or importing from deeply nested files.
|
|
196
|
+
- Keep short relative imports for same-folder/local siblings (`./x`, `../x`) where they are clearer than package paths.
|
|
197
|
+
|
|
198
|
+
## Conventions
|
|
199
|
+
|
|
200
|
+
- Modules: plural, snake_case (folders and `id`). Special cases: `auth`, `example`.
|
|
201
|
+
- **Event IDs**: `module.entity.action` (singular entity, past tense action, e.g., `pos.cart.completed`). use dots as separators.
|
|
202
|
+
- `clientBroadcast: true` in EventDefinition bridges events to browser via SSE (DOM Event Bridge)
|
|
203
|
+
- `portalBroadcast: true` in EventDefinition bridges events to customer portal via SSE (Portal Event Bridge)
|
|
204
|
+
- JS/TS fields and identifiers: camelCase.
|
|
205
|
+
- Database tables and columns: snake_case; table names plural.
|
|
206
|
+
- Common columns: `id`, `created_at`, `updated_at`, `deleted_at`, `is_active`, `organization_id`, `tenant_id`.
|
|
207
|
+
- UUID PKs, explicit FKs, junction tables for many-to-many.
|
|
208
|
+
- Keep code minimal and focused; avoid side effects across modules.
|
|
209
|
+
- Keep modules self-contained; re-use common utilities via `src/lib/`.
|
|
210
|
+
|
|
211
|
+
## Backward Compatibility Contract
|
|
212
|
+
|
|
213
|
+
> **Full specification**: [`BACKWARD_COMPATIBILITY.md`](BACKWARD_COMPATIBILITY.md) — MUST be read before modifying any contract surface. It enumerates the 13 contract-surface categories (auto-discovery files, types, signatures, import paths, event IDs, widget spot IDs, API routes, DB schema, DI keys, ACL features, notification IDs, CLI commands, generated files) and their FROZEN / STABLE / ADDITIVE-ONLY classification.
|
|
214
|
+
|
|
215
|
+
Third-party module developers depend on stable platform APIs. Any change to a **contract surface** is a breaking change that blocks merge unless the deprecation protocol is followed.
|
|
216
|
+
|
|
217
|
+
**Deprecation protocol** (summary): (1) never remove in one release, (2) add `@deprecated` JSDoc, (3) provide a bridge (re-export/alias/dual-emit) for ≥1 minor version, (4) document in UPGRADE_NOTES.md, (5) reference a spec with "Migration & Backward Compatibility" section.
|
|
218
|
+
|
|
219
|
+
## Boundary Labels for Agent Rules
|
|
220
|
+
|
|
221
|
+
Use `Always`, `Ask First`, `Never`, and `Validation Commands` headings when adding or reorganizing agent rules — definitions and the instruction-budget contract: [`.ai/docs/agent-instructions.md`](.ai/docs/agent-instructions.md).
|
|
222
|
+
|
|
223
|
+
## Architecture, Data, UI, and Code Rules
|
|
224
|
+
|
|
225
|
+
These are critical project-wide rules. The top-level `Always`, `Ask First`, and `Never` sections summarize their boundaries; this section keeps the detailed requirements.
|
|
226
|
+
|
|
227
|
+
### Architecture
|
|
228
|
+
|
|
229
|
+
- **NO direct ORM relationships between modules** — use foreign key IDs, fetch separately
|
|
230
|
+
- Always filter by `organization_id` for tenant-scoped entities
|
|
231
|
+
- Never expose cross-tenant data from API handlers
|
|
232
|
+
- Use DI (Awilix) to inject services; avoid `new`-ing directly
|
|
233
|
+
- Modules must remain isomorphic and independent
|
|
234
|
+
- When extending another module's data, add a separate extension entity and declare a link in `data/extensions.ts`
|
|
235
|
+
|
|
236
|
+
### Data & Security
|
|
237
|
+
|
|
238
|
+
- Validate all inputs with zod; place validators in `data/validators.ts`
|
|
239
|
+
- Derive TypeScript types from zod via `z.infer<typeof schema>`
|
|
240
|
+
- Use `findWithDecryption`/`findOneWithDecryption` instead of `em.find`/`em.findOne`
|
|
241
|
+
- Default migration workflow: update ORM entities, run `yarn db:generate`, and review the generated SQL plus `migrations/.snapshot-open-mercato.json`
|
|
242
|
+
- Coding-agent exception: if `yarn db:generate` emits unrelated migrations, delete the unrelated output, keep or write only the intended SQL migration for this entity change, and update the affected module's `.snapshot-open-mercato.json`. Never run `yarn db:migrate` just to make the generator quiet.
|
|
243
|
+
- Hash passwords with bcryptjs (cost >=10), never log credentials
|
|
244
|
+
- Return minimal error messages for auth (avoid revealing whether email exists)
|
|
245
|
+
- RBAC: prefer declarative guards (`requireAuth`, `requireFeatures`) in page metadata; avoid `requireRoles` — role names are mutable and can be spoofed; use feature-based guards with immutable IDs from `acl.ts` instead
|
|
246
|
+
- Portal RBAC: use `requireCustomerAuth` and `requireCustomerFeatures` in page metadata for portal pages
|
|
247
|
+
|
|
248
|
+
### UI & HTTP
|
|
249
|
+
|
|
250
|
+
- Use `apiCall`/`apiCallOrThrow`/`readApiResultOrThrow` from `@open-mercato/ui/backend/utils/apiCall` — never use raw `fetch`
|
|
251
|
+
- If a backend page cannot use `CrudForm`, wrap every write (`POST`/`PUT`/`PATCH`/`DELETE`) in `useGuardedMutation(...).runMutation(...)` and include `retryLastMutation` in the injection context
|
|
252
|
+
- For CRUD forms: `createCrud`/`updateCrud`/`deleteCrud` (auto-handle `raiseCrudError`)
|
|
253
|
+
- For local validation errors: throw `createCrudFormError(message, fieldErrors?)` from `@open-mercato/ui/backend/utils/serverErrors`
|
|
254
|
+
- Read JSON defensively: `readJsonSafe(response, fallback)` — never `.json().catch(() => ...)`
|
|
255
|
+
- Use `LoadingMessage`/`ErrorMessage` from `@open-mercato/ui/backend/detail`
|
|
256
|
+
- i18n: `useT()` client-side, `resolveTranslations()` server-side
|
|
257
|
+
- Never hard-code user-facing strings — use locale files
|
|
258
|
+
- Prefix purely internal `throw new Error(...)` / `createCrudFormError(...)` / `toast.*(...)` messages with `[internal]` so the i18n hardcoded-string checker treats them as opted out; user-facing variants MUST route through `t('module.errors.<key>')`. Run `yarn i18n:check-hardcoded` (and `yarn i18n:check-values` for non-English coverage) to inspect the surface — both are advisory in Phase 1 of `.ai/specs/2026-05-26-missing-translations-audit-and-remediation.md`. Use `<module>/i18n/.hardcoded-allowlist.json` for module-scoped exceptions (legal copy, framework chrome).
|
|
259
|
+
- Every dialog: `Cmd/Ctrl+Enter` submit, `Escape` cancel
|
|
260
|
+
- Keep `pageSize` at or below 100
|
|
261
|
+
|
|
262
|
+
### Code Quality
|
|
263
|
+
|
|
264
|
+
- No `any` types — use zod schemas with `z.infer`, narrow with runtime checks
|
|
265
|
+
- Prefer functional, data-first utilities over classes
|
|
266
|
+
- No one-letter variable names, no inline comments (self-documenting code)
|
|
267
|
+
- Don't add docstrings/comments/type annotations to code you didn't change
|
|
268
|
+
- Boolean parsing: use `parseBooleanToken`/`parseBooleanWithDefault` from `@open-mercato/shared/lib/boolean`
|
|
269
|
+
- Confirm project still builds after changes
|
|
270
|
+
|
|
271
|
+
## Design System Rules
|
|
272
|
+
|
|
273
|
+
> Foundations (token tables, decision trees, color/spacing/typography rules): `.ai/ds-rules.md`
|
|
274
|
+
> Component reference (variants, sizes, props, examples, MUST rules per primitive): `.ai/ui-components.md`
|
|
275
|
+
> Workflow guidance (CrudForm, DataTable, Loading, Flash, Notifications, Portal): `packages/ui/AGENTS.md`
|
|
276
|
+
|
|
277
|
+
- NEVER use hardcoded Tailwind status colors (`text-red-*`, `bg-green-*`, `text-amber-*`, etc.) — use `{property}-status-{status}-{role}` tokens
|
|
278
|
+
- NEVER use arbitrary values (`text-[13px]`, `p-[13px]`, `rounded-[24px]`, `z-[9999]`) — use DS scale
|
|
279
|
+
- NEVER add `dark:` overrides on semantic/status tokens — they already handle dark mode
|
|
280
|
+
- NEVER hardcode hex/rgb in `className` — always use CSS token names
|
|
281
|
+
- NEVER use hardcoded Tailwind color shades for borders (`border-gray-300`) — use `border-border`, `border-input`
|
|
282
|
+
|
|
283
|
+
**Boy Scout Rule**: When touching a file that has hardcoded status colors, arbitrary text sizes, or `dark:` overrides on status colors, migrate at minimum the lines you touched to semantic tokens.
|
|
284
|
+
|
|
285
|
+
## Key Commands
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
yarn dev # Compact dev runtime; press `d` for raw logs (`:verbose`, `:app`, `:greenfield` variants)
|
|
289
|
+
yarn dev:reset # Clear .mercato/next/dev plus legacy .next caches when Turbopack serves stale chunks
|
|
290
|
+
yarn build # Build everything (`build:packages` / `build:app` for one side)
|
|
291
|
+
yarn lint # Lint all packages
|
|
292
|
+
yarn test # Run unit tests (`test:integration` for Playwright, headless)
|
|
293
|
+
yarn generate # Run module generators
|
|
294
|
+
yarn db:generate # Generate database migrations (`db:migrate` applies them — ask first)
|
|
295
|
+
yarn initialize # Full project initialization
|
|
296
|
+
yarn agents:check-budget # Verify AGENTS.md files fit the agent instruction budget
|
|
297
|
+
```
|