@open-mercato/cli 0.6.8-develop.6961.1.5b7ca407e7 → 0.6.8-develop.6963.1.04a6d320e9
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/build.mjs +16 -7
- package/dist/agentic/guides/architecture.md +2 -2
- package/dist/agentic/guides/extensions.md +1 -1
- package/dist/agentic/guides/module-facts.json +112 -112
- package/dist/agentic/guides/module-facts.v2.json +112 -112
- package/dist/agentic/guides/module-system.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/acl-features.md +18 -0
- package/dist/agentic/guides/modules/ai_assistant/ai-tools-mcp-capabilities.md +18 -0
- package/dist/agentic/guides/modules/ai_assistant/backend-pages.md +18 -0
- package/dist/agentic/guides/modules/ai_assistant/cli-commands.md +19 -0
- package/dist/agentic/guides/modules/ai_assistant/contribution-resolutions.md +22 -0
- package/dist/agentic/guides/modules/ai_assistant/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/ai_assistant/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/ai_assistant/entities.md +21 -0
- package/dist/agentic/guides/modules/ai_assistant/events.md +17 -0
- package/dist/agentic/guides/modules/ai_assistant/exact-override-targets.md +51 -0
- package/dist/agentic/guides/modules/ai_assistant/index.md +27 -0
- package/dist/agentic/guides/modules/ai_assistant/notifications.md +11 -0
- package/dist/agentic/guides/modules/ai_assistant/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/ai_assistant/setup.md +11 -0
- package/dist/agentic/guides/modules/ai_assistant/umes-contributions.md +22 -0
- package/dist/agentic/guides/modules/ai_assistant/umes-hosts.md +28 -0
- package/dist/agentic/guides/modules/ai_assistant/workers.md +12 -0
- package/dist/agentic/guides/modules/api_docs/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/api_docs/exact-override-targets.md +12 -0
- package/dist/agentic/guides/modules/api_docs/frontend-pages.md +11 -0
- package/dist/agentic/guides/modules/api_docs/index.md +15 -0
- package/dist/agentic/guides/modules/api_docs/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/api_keys/acl-features.md +13 -0
- package/dist/agentic/guides/modules/api_keys/backend-pages.md +12 -0
- package/dist/agentic/guides/modules/api_keys/cli-commands.md +11 -0
- package/dist/agentic/guides/modules/api_keys/entities.md +11 -0
- package/dist/agentic/guides/modules/api_keys/exact-override-targets.md +17 -0
- package/dist/agentic/guides/modules/api_keys/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/api_keys/index.md +21 -0
- package/dist/agentic/guides/modules/api_keys/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/api_keys/setup.md +11 -0
- package/dist/agentic/guides/modules/api_keys/umes-diagnostics.md +9 -0
- package/dist/agentic/guides/modules/api_keys/umes-hosts.md +20 -0
- package/dist/agentic/guides/modules/attachments/acl-features.md +12 -0
- package/dist/agentic/guides/modules/attachments/backend-pages.md +12 -0
- package/dist/agentic/guides/modules/attachments/cli-commands.md +11 -0
- package/dist/agentic/guides/modules/attachments/custom-entities.md +11 -0
- package/dist/agentic/guides/modules/attachments/di-registrations-rich.md +13 -0
- package/dist/agentic/guides/modules/attachments/di-service-tokens.md +12 -0
- package/dist/agentic/guides/modules/attachments/entities.md +13 -0
- package/dist/agentic/guides/modules/attachments/events.md +13 -0
- package/dist/agentic/guides/modules/attachments/exact-override-targets.md +20 -0
- package/dist/agentic/guides/modules/attachments/incoming-installed-contributions.md +12 -0
- package/dist/agentic/guides/modules/attachments/index.md +25 -0
- package/dist/agentic/guides/modules/attachments/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/attachments/setup.md +11 -0
- package/dist/agentic/guides/modules/attachments/umes-hosts.md +16 -0
- package/dist/agentic/guides/modules/attachments/workers.md +11 -0
- package/dist/agentic/guides/modules/audit_logs/acl-features.md +16 -0
- package/dist/agentic/guides/modules/audit_logs/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/audit_logs/cli-commands.md +11 -0
- package/dist/agentic/guides/modules/audit_logs/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/audit_logs/di-service-tokens.md +12 -0
- package/dist/agentic/guides/modules/audit_logs/encryption.md +12 -0
- package/dist/agentic/guides/modules/audit_logs/entities.md +12 -0
- package/dist/agentic/guides/modules/audit_logs/exact-override-targets.md +23 -0
- package/dist/agentic/guides/modules/audit_logs/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/audit_logs/index.md +24 -0
- package/dist/agentic/guides/modules/audit_logs/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/audit_logs/setup.md +11 -0
- package/dist/agentic/guides/modules/audit_logs/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/audit_logs/umes-hosts.md +30 -0
- package/dist/agentic/guides/modules/auth/acl-features.md +18 -0
- package/dist/agentic/guides/modules/auth/active-extension-bindings.md +13 -0
- package/dist/agentic/guides/modules/auth/backend-pages.md +21 -0
- package/dist/agentic/guides/modules/auth/cli-commands.md +20 -0
- package/dist/agentic/guides/modules/auth/contribution-resolutions.md +16 -0
- package/dist/agentic/guides/modules/auth/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/auth/di-service-tokens.md +12 -0
- package/dist/agentic/guides/modules/auth/domain-commands.md +16 -0
- package/dist/agentic/guides/modules/auth/encryption.md +12 -0
- package/dist/agentic/guides/modules/auth/entities.md +21 -0
- package/dist/agentic/guides/modules/auth/events.md +22 -0
- package/dist/agentic/guides/modules/auth/exact-override-targets.md +53 -0
- package/dist/agentic/guides/modules/auth/frontend-pages.md +13 -0
- package/dist/agentic/guides/modules/auth/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/auth/incoming-installed-contributions.md +17 -0
- package/dist/agentic/guides/modules/auth/index.md +32 -0
- package/dist/agentic/guides/modules/auth/notifications.md +16 -0
- package/dist/agentic/guides/modules/auth/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/auth/setup.md +11 -0
- package/dist/agentic/guides/modules/auth/umes-contributions.md +16 -0
- package/dist/agentic/guides/modules/auth/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/auth/umes-hosts.md +53 -0
- package/dist/agentic/guides/modules/business_rules/acl-features.md +15 -0
- package/dist/agentic/guides/modules/business_rules/backend-pages.md +18 -0
- package/dist/agentic/guides/modules/business_rules/cli-commands.md +11 -0
- package/dist/agentic/guides/modules/business_rules/contribution-resolutions.md +13 -0
- package/dist/agentic/guides/modules/business_rules/di-registrations-rich.md +13 -0
- package/dist/agentic/guides/modules/business_rules/di-service-tokens.md +13 -0
- package/dist/agentic/guides/modules/business_rules/entities.md +14 -0
- package/dist/agentic/guides/modules/business_rules/events.md +11 -0
- package/dist/agentic/guides/modules/business_rules/exact-override-targets.md +31 -0
- package/dist/agentic/guides/modules/business_rules/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/business_rules/index.md +27 -0
- package/dist/agentic/guides/modules/business_rules/notifications.md +11 -0
- package/dist/agentic/guides/modules/business_rules/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/business_rules/setup.md +11 -0
- package/dist/agentic/guides/modules/business_rules/umes-contributions.md +13 -0
- package/dist/agentic/guides/modules/business_rules/umes-diagnostics.md +9 -0
- package/dist/agentic/guides/modules/business_rules/umes-hosts.md +24 -0
- package/dist/agentic/guides/modules/catalog/acl-features.md +17 -0
- package/dist/agentic/guides/modules/catalog/active-extension-bindings.md +23 -0
- package/dist/agentic/guides/modules/catalog/ai-agents.md +12 -0
- package/dist/agentic/guides/modules/catalog/ai-tools-mcp-capabilities.md +39 -0
- package/dist/agentic/guides/modules/catalog/backend-pages.md +19 -0
- package/dist/agentic/guides/modules/catalog/cli-commands.md +14 -0
- package/dist/agentic/guides/modules/catalog/contribution-resolutions.md +58 -0
- package/dist/agentic/guides/modules/catalog/custom-entities.md +13 -0
- package/dist/agentic/guides/modules/catalog/di-registrations-rich.md +13 -0
- package/dist/agentic/guides/modules/catalog/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/catalog/domain-commands.md +34 -0
- package/dist/agentic/guides/modules/catalog/entities.md +22 -0
- package/dist/agentic/guides/modules/catalog/events.md +28 -0
- package/dist/agentic/guides/modules/catalog/exact-override-targets.md +73 -0
- package/dist/agentic/guides/modules/catalog/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/catalog/incoming-installed-contributions.md +19 -0
- package/dist/agentic/guides/modules/catalog/index.md +35 -0
- package/dist/agentic/guides/modules/catalog/notifications.md +11 -0
- package/dist/agentic/guides/modules/catalog/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/catalog/search-entities.md +18 -0
- package/dist/agentic/guides/modules/catalog/setup.md +11 -0
- package/dist/agentic/guides/modules/catalog/umes-contributions.md +58 -0
- package/dist/agentic/guides/modules/catalog/umes-diagnostics.md +17 -0
- package/dist/agentic/guides/modules/catalog/umes-hosts.md +79 -0
- package/dist/agentic/guides/modules/catalog/workers.md +11 -0
- package/dist/agentic/guides/modules/channel_gmail/acl-features.md +12 -0
- package/dist/agentic/guides/modules/channel_gmail/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/channel_gmail/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/channel_gmail/exact-override-targets.md +17 -0
- package/dist/agentic/guides/modules/channel_gmail/index.md +18 -0
- package/dist/agentic/guides/modules/channel_gmail/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/channel_gmail/setup.md +11 -0
- package/dist/agentic/guides/modules/channel_gmail/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/channel_imap/acl-features.md +12 -0
- package/dist/agentic/guides/modules/channel_imap/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/channel_imap/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/channel_imap/exact-override-targets.md +17 -0
- package/dist/agentic/guides/modules/channel_imap/index.md +18 -0
- package/dist/agentic/guides/modules/channel_imap/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/channel_imap/setup.md +11 -0
- package/dist/agentic/guides/modules/channel_imap/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/checkout/acl-features.md +16 -0
- package/dist/agentic/guides/modules/checkout/backend-pages.md +20 -0
- package/dist/agentic/guides/modules/checkout/contribution-resolutions.md +29 -0
- package/dist/agentic/guides/modules/checkout/domain-commands.md +18 -0
- package/dist/agentic/guides/modules/checkout/encryption.md +13 -0
- package/dist/agentic/guides/modules/checkout/entities.md +13 -0
- package/dist/agentic/guides/modules/checkout/events.md +26 -0
- package/dist/agentic/guides/modules/checkout/exact-override-targets.md +51 -0
- package/dist/agentic/guides/modules/checkout/frontend-pages.md +13 -0
- package/dist/agentic/guides/modules/checkout/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/checkout/index.md +28 -0
- package/dist/agentic/guides/modules/checkout/notifications.md +13 -0
- package/dist/agentic/guides/modules/checkout/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/checkout/setup.md +11 -0
- package/dist/agentic/guides/modules/checkout/umes-contributions.md +29 -0
- package/dist/agentic/guides/modules/checkout/umes-diagnostics.md +11 -0
- package/dist/agentic/guides/modules/checkout/umes-hosts.md +92 -0
- package/dist/agentic/guides/modules/checkout/workers.md +12 -0
- package/dist/agentic/guides/modules/communication_channels/acl-features.md +18 -0
- package/dist/agentic/guides/modules/communication_channels/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/communication_channels/backend-pages.md +13 -0
- package/dist/agentic/guides/modules/communication_channels/contribution-resolutions.md +42 -0
- package/dist/agentic/guides/modules/communication_channels/di-registrations-rich.md +18 -0
- package/dist/agentic/guides/modules/communication_channels/domain-commands.md +19 -0
- package/dist/agentic/guides/modules/communication_channels/encryption.md +11 -0
- package/dist/agentic/guides/modules/communication_channels/entities.md +18 -0
- package/dist/agentic/guides/modules/communication_channels/events.md +26 -0
- package/dist/agentic/guides/modules/communication_channels/exact-override-targets.md +54 -0
- package/dist/agentic/guides/modules/communication_channels/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/communication_channels/incoming-installed-contributions.md +14 -0
- package/dist/agentic/guides/modules/communication_channels/index.md +30 -0
- package/dist/agentic/guides/modules/communication_channels/notifications.md +12 -0
- package/dist/agentic/guides/modules/communication_channels/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/communication_channels/setup.md +11 -0
- package/dist/agentic/guides/modules/communication_channels/umes-contributions.md +42 -0
- package/dist/agentic/guides/modules/communication_channels/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/communication_channels/umes-hosts.md +53 -0
- package/dist/agentic/guides/modules/communication_channels/workers.md +18 -0
- package/dist/agentic/guides/modules/configs/acl-features.md +14 -0
- package/dist/agentic/guides/modules/configs/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/configs/backend-pages.md +13 -0
- package/dist/agentic/guides/modules/configs/cli-commands.md +13 -0
- package/dist/agentic/guides/modules/configs/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/configs/entities.md +12 -0
- package/dist/agentic/guides/modules/configs/exact-override-targets.md +22 -0
- package/dist/agentic/guides/modules/configs/incoming-installed-contributions.md +11 -0
- package/dist/agentic/guides/modules/configs/index.md +22 -0
- package/dist/agentic/guides/modules/configs/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/configs/setup.md +11 -0
- package/dist/agentic/guides/modules/configs/umes-hosts.md +13 -0
- package/dist/agentic/guides/modules/content/exact-override-targets.md +12 -0
- package/dist/agentic/guides/modules/content/frontend-pages.md +12 -0
- package/dist/agentic/guides/modules/content/index.md +14 -0
- package/dist/agentic/guides/modules/content/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/currencies/acl-features.md +16 -0
- package/dist/agentic/guides/modules/currencies/backend-pages.md +17 -0
- package/dist/agentic/guides/modules/currencies/cli-commands.md +13 -0
- package/dist/agentic/guides/modules/currencies/domain-commands.md +16 -0
- package/dist/agentic/guides/modules/currencies/entities.md +13 -0
- package/dist/agentic/guides/modules/currencies/events.md +16 -0
- package/dist/agentic/guides/modules/currencies/exact-override-targets.md +28 -0
- package/dist/agentic/guides/modules/currencies/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/currencies/index.md +23 -0
- package/dist/agentic/guides/modules/currencies/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/currencies/setup.md +11 -0
- package/dist/agentic/guides/modules/currencies/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/currencies/umes-hosts.md +37 -0
- package/dist/agentic/guides/modules/customer_accounts/acl-features.md +15 -0
- package/dist/agentic/guides/modules/customer_accounts/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/customer_accounts/backend-pages.md +17 -0
- package/dist/agentic/guides/modules/customer_accounts/contribution-resolutions.md +59 -0
- package/dist/agentic/guides/modules/customer_accounts/custom-entities.md +12 -0
- package/dist/agentic/guides/modules/customer_accounts/di-registrations-rich.md +16 -0
- package/dist/agentic/guides/modules/customer_accounts/di-service-tokens.md +16 -0
- package/dist/agentic/guides/modules/customer_accounts/encryption.md +13 -0
- package/dist/agentic/guides/modules/customer_accounts/entities.md +20 -0
- package/dist/agentic/guides/modules/customer_accounts/events.md +35 -0
- package/dist/agentic/guides/modules/customer_accounts/exact-override-targets.md +64 -0
- package/dist/agentic/guides/modules/customer_accounts/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/customer_accounts/index.md +31 -0
- package/dist/agentic/guides/modules/customer_accounts/notifications.md +16 -0
- package/dist/agentic/guides/modules/customer_accounts/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/customer_accounts/search-entities.md +12 -0
- package/dist/agentic/guides/modules/customer_accounts/setup.md +11 -0
- package/dist/agentic/guides/modules/customer_accounts/umes-contributions.md +59 -0
- package/dist/agentic/guides/modules/customer_accounts/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/customer_accounts/umes-hosts.md +69 -0
- package/dist/agentic/guides/modules/customer_accounts/workers.md +14 -0
- package/dist/agentic/guides/modules/customers/acl-features.md +31 -0
- package/dist/agentic/guides/modules/customers/active-extension-bindings.md +37 -0
- package/dist/agentic/guides/modules/customers/ai-agents.md +13 -0
- package/dist/agentic/guides/modules/customers/ai-tools-mcp-capabilities.md +30 -0
- package/dist/agentic/guides/modules/customers/backend-pages.md +28 -0
- package/dist/agentic/guides/modules/customers/cli-commands.md +14 -0
- package/dist/agentic/guides/modules/customers/contribution-resolutions.md +63 -0
- package/dist/agentic/guides/modules/customers/custom-entities.md +15 -0
- package/dist/agentic/guides/modules/customers/di-registrations-rich.md +13 -0
- package/dist/agentic/guides/modules/customers/domain-commands.md +64 -0
- package/dist/agentic/guides/modules/customers/encryption.md +18 -0
- package/dist/agentic/guides/modules/customers/entities.md +35 -0
- package/dist/agentic/guides/modules/customers/events.md +59 -0
- package/dist/agentic/guides/modules/customers/exact-override-targets.md +108 -0
- package/dist/agentic/guides/modules/customers/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/customers/incoming-installed-contributions.md +23 -0
- package/dist/agentic/guides/modules/customers/index.md +35 -0
- package/dist/agentic/guides/modules/customers/notifications.md +12 -0
- package/dist/agentic/guides/modules/customers/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/customers/search-entities.md +16 -0
- package/dist/agentic/guides/modules/customers/setup.md +11 -0
- package/dist/agentic/guides/modules/customers/umes-contributions.md +63 -0
- package/dist/agentic/guides/modules/customers/umes-diagnostics.md +33 -0
- package/dist/agentic/guides/modules/customers/umes-hosts.md +166 -0
- package/dist/agentic/guides/modules/customers/workers.md +12 -0
- package/dist/agentic/guides/modules/dashboards/acl-features.md +14 -0
- package/dist/agentic/guides/modules/dashboards/active-extension-bindings.md +24 -0
- package/dist/agentic/guides/modules/dashboards/cli-commands.md +14 -0
- package/dist/agentic/guides/modules/dashboards/contribution-resolutions.md +21 -0
- package/dist/agentic/guides/modules/dashboards/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/dashboards/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/dashboards/entities.md +13 -0
- package/dist/agentic/guides/modules/dashboards/exact-override-targets.md +33 -0
- package/dist/agentic/guides/modules/dashboards/incoming-installed-contributions.md +11 -0
- package/dist/agentic/guides/modules/dashboards/index.md +24 -0
- package/dist/agentic/guides/modules/dashboards/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/dashboards/setup.md +11 -0
- package/dist/agentic/guides/modules/dashboards/umes-contributions.md +21 -0
- package/dist/agentic/guides/modules/dashboards/umes-hosts.md +16 -0
- package/dist/agentic/guides/modules/data_sync/acl-features.md +13 -0
- package/dist/agentic/guides/modules/data_sync/active-extension-bindings.md +13 -0
- package/dist/agentic/guides/modules/data_sync/backend-pages.md +12 -0
- package/dist/agentic/guides/modules/data_sync/di-registrations-rich.md +18 -0
- package/dist/agentic/guides/modules/data_sync/di-service-tokens.md +14 -0
- package/dist/agentic/guides/modules/data_sync/entities.md +14 -0
- package/dist/agentic/guides/modules/data_sync/events.md +14 -0
- package/dist/agentic/guides/modules/data_sync/exact-override-targets.md +27 -0
- package/dist/agentic/guides/modules/data_sync/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/data_sync/index.md +25 -0
- package/dist/agentic/guides/modules/data_sync/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/data_sync/setup.md +11 -0
- package/dist/agentic/guides/modules/data_sync/umes-diagnostics.md +9 -0
- package/dist/agentic/guides/modules/data_sync/umes-hosts.md +30 -0
- package/dist/agentic/guides/modules/data_sync/workers.md +13 -0
- package/dist/agentic/guides/modules/design_system/acl-features.md +11 -0
- package/dist/agentic/guides/modules/design_system/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/design_system/exact-override-targets.md +13 -0
- package/dist/agentic/guides/modules/design_system/index.md +16 -0
- package/dist/agentic/guides/modules/design_system/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/design_system/setup.md +11 -0
- package/dist/agentic/guides/modules/dictionaries/acl-features.md +12 -0
- package/dist/agentic/guides/modules/dictionaries/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/dictionaries/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/dictionaries/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/dictionaries/domain-commands.md +15 -0
- package/dist/agentic/guides/modules/dictionaries/entities.md +12 -0
- package/dist/agentic/guides/modules/dictionaries/events.md +13 -0
- package/dist/agentic/guides/modules/dictionaries/exact-override-targets.md +16 -0
- package/dist/agentic/guides/modules/dictionaries/index.md +22 -0
- package/dist/agentic/guides/modules/dictionaries/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/dictionaries/setup.md +11 -0
- package/dist/agentic/guides/modules/dictionaries/umes-hosts.md +17 -0
- package/dist/agentic/guides/modules/directory/acl-features.md +14 -0
- package/dist/agentic/guides/modules/directory/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/directory/backend-pages.md +17 -0
- package/dist/agentic/guides/modules/directory/contribution-resolutions.md +11 -0
- package/dist/agentic/guides/modules/directory/domain-commands.md +16 -0
- package/dist/agentic/guides/modules/directory/entities.md +12 -0
- package/dist/agentic/guides/modules/directory/events.md +16 -0
- package/dist/agentic/guides/modules/directory/exact-override-targets.md +24 -0
- package/dist/agentic/guides/modules/directory/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/directory/incoming-installed-contributions.md +11 -0
- package/dist/agentic/guides/modules/directory/index.md +26 -0
- package/dist/agentic/guides/modules/directory/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/directory/setup.md +11 -0
- package/dist/agentic/guides/modules/directory/umes-contributions.md +11 -0
- package/dist/agentic/guides/modules/directory/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/directory/umes-hosts.md +37 -0
- package/dist/agentic/guides/modules/entities/acl-features.md +14 -0
- package/dist/agentic/guides/modules/entities/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/entities/backend-pages.md +19 -0
- package/dist/agentic/guides/modules/entities/cli-commands.md +17 -0
- package/dist/agentic/guides/modules/entities/entities.md +16 -0
- package/dist/agentic/guides/modules/entities/exact-override-targets.md +31 -0
- package/dist/agentic/guides/modules/entities/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/entities/index.md +22 -0
- package/dist/agentic/guides/modules/entities/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/entities/setup.md +11 -0
- package/dist/agentic/guides/modules/entities/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/entities/umes-hosts.md +36 -0
- package/dist/agentic/guides/modules/eudr/acl-features.md +20 -0
- package/dist/agentic/guides/modules/eudr/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/eudr/ai-agents.md +11 -0
- package/dist/agentic/guides/modules/eudr/ai-tools-mcp-capabilities.md +15 -0
- package/dist/agentic/guides/modules/eudr/backend-pages.md +26 -0
- package/dist/agentic/guides/modules/eudr/contribution-resolutions.md +37 -0
- package/dist/agentic/guides/modules/eudr/custom-entities.md +16 -0
- package/dist/agentic/guides/modules/eudr/domain-commands.md +28 -0
- package/dist/agentic/guides/modules/eudr/encryption.md +14 -0
- package/dist/agentic/guides/modules/eudr/entities.md +16 -0
- package/dist/agentic/guides/modules/eudr/events.md +33 -0
- package/dist/agentic/guides/modules/eudr/exact-override-targets.md +64 -0
- package/dist/agentic/guides/modules/eudr/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/eudr/index.md +30 -0
- package/dist/agentic/guides/modules/eudr/notifications.md +15 -0
- package/dist/agentic/guides/modules/eudr/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/eudr/search-entities.md +13 -0
- package/dist/agentic/guides/modules/eudr/setup.md +11 -0
- package/dist/agentic/guides/modules/eudr/umes-contributions.md +37 -0
- package/dist/agentic/guides/modules/eudr/umes-hosts.md +45 -0
- package/dist/agentic/guides/modules/events/exact-override-targets.md +11 -0
- package/dist/agentic/guides/modules/events/index.md +14 -0
- package/dist/agentic/guides/modules/events/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/events/workers.md +11 -0
- package/dist/agentic/guides/modules/feature_toggles/acl-features.md +13 -0
- package/dist/agentic/guides/modules/feature_toggles/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/feature_toggles/backend-pages.md +15 -0
- package/dist/agentic/guides/modules/feature_toggles/cli-commands.md +15 -0
- package/dist/agentic/guides/modules/feature_toggles/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/feature_toggles/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/feature_toggles/domain-commands.md +14 -0
- package/dist/agentic/guides/modules/feature_toggles/entities.md +12 -0
- package/dist/agentic/guides/modules/feature_toggles/exact-override-targets.md +25 -0
- package/dist/agentic/guides/modules/feature_toggles/index.md +23 -0
- package/dist/agentic/guides/modules/feature_toggles/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/feature_toggles/setup.md +11 -0
- package/dist/agentic/guides/modules/feature_toggles/umes-hosts.md +13 -0
- package/dist/agentic/guides/modules/gateway_stripe/acl-features.md +12 -0
- package/dist/agentic/guides/modules/gateway_stripe/cli-commands.md +12 -0
- package/dist/agentic/guides/modules/gateway_stripe/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/gateway_stripe/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/gateway_stripe/exact-override-targets.md +18 -0
- package/dist/agentic/guides/modules/gateway_stripe/index.md +20 -0
- package/dist/agentic/guides/modules/gateway_stripe/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/gateway_stripe/setup.md +11 -0
- package/dist/agentic/guides/modules/gateway_stripe/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/gateway_stripe/workers.md +11 -0
- package/dist/agentic/guides/modules/generators/index.md +11 -0
- package/dist/agentic/guides/modules/inbox_ops/acl-features.md +15 -0
- package/dist/agentic/guides/modules/inbox_ops/active-extension-bindings.md +13 -0
- package/dist/agentic/guides/modules/inbox_ops/ai-tools-mcp-capabilities.md +14 -0
- package/dist/agentic/guides/modules/inbox_ops/backend-pages.md +14 -0
- package/dist/agentic/guides/modules/inbox_ops/contribution-resolutions.md +20 -0
- package/dist/agentic/guides/modules/inbox_ops/custom-entities.md +11 -0
- package/dist/agentic/guides/modules/inbox_ops/di-registrations-rich.md +15 -0
- package/dist/agentic/guides/modules/inbox_ops/encryption.md +15 -0
- package/dist/agentic/guides/modules/inbox_ops/entities.md +15 -0
- package/dist/agentic/guides/modules/inbox_ops/events.md +23 -0
- package/dist/agentic/guides/modules/inbox_ops/exact-override-targets.md +41 -0
- package/dist/agentic/guides/modules/inbox_ops/index.md +28 -0
- package/dist/agentic/guides/modules/inbox_ops/notifications.md +11 -0
- package/dist/agentic/guides/modules/inbox_ops/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/inbox_ops/search-entities.md +11 -0
- package/dist/agentic/guides/modules/inbox_ops/setup.md +11 -0
- package/dist/agentic/guides/modules/inbox_ops/umes-contributions.md +20 -0
- package/dist/agentic/guides/modules/inbox_ops/umes-hosts.md +30 -0
- package/dist/agentic/guides/modules/integrations/acl-features.md +13 -0
- package/dist/agentic/guides/modules/integrations/backend-pages.md +13 -0
- package/dist/agentic/guides/modules/integrations/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/integrations/di-registrations-rich.md +18 -0
- package/dist/agentic/guides/modules/integrations/di-service-tokens.md +14 -0
- package/dist/agentic/guides/modules/integrations/encryption.md +11 -0
- package/dist/agentic/guides/modules/integrations/entities.md +14 -0
- package/dist/agentic/guides/modules/integrations/events.md +14 -0
- package/dist/agentic/guides/modules/integrations/exact-override-targets.md +31 -0
- package/dist/agentic/guides/modules/integrations/index.md +25 -0
- package/dist/agentic/guides/modules/integrations/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/integrations/setup.md +11 -0
- package/dist/agentic/guides/modules/integrations/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/integrations/umes-hosts.md +20 -0
- package/dist/agentic/guides/modules/integrations/workers.md +12 -0
- package/dist/agentic/guides/modules/messages/acl-features.md +17 -0
- package/dist/agentic/guides/modules/messages/active-extension-bindings.md +13 -0
- package/dist/agentic/guides/modules/messages/backend-pages.md +13 -0
- package/dist/agentic/guides/modules/messages/contribution-resolutions.md +23 -0
- package/dist/agentic/guides/modules/messages/domain-commands.md +30 -0
- package/dist/agentic/guides/modules/messages/encryption.md +11 -0
- package/dist/agentic/guides/modules/messages/entities.md +15 -0
- package/dist/agentic/guides/modules/messages/events.md +19 -0
- package/dist/agentic/guides/modules/messages/exact-override-targets.md +27 -0
- package/dist/agentic/guides/modules/messages/frontend-pages.md +11 -0
- package/dist/agentic/guides/modules/messages/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/messages/incoming-installed-contributions.md +17 -0
- package/dist/agentic/guides/modules/messages/index.md +31 -0
- package/dist/agentic/guides/modules/messages/notifications.md +11 -0
- package/dist/agentic/guides/modules/messages/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/messages/search-entities.md +11 -0
- package/dist/agentic/guides/modules/messages/setup.md +11 -0
- package/dist/agentic/guides/modules/messages/umes-contributions.md +23 -0
- package/dist/agentic/guides/modules/messages/umes-diagnostics.md +9 -0
- package/dist/agentic/guides/modules/messages/umes-hosts.md +38 -0
- package/dist/agentic/guides/modules/messages/workers.md +11 -0
- package/dist/agentic/guides/modules/notifications/acl-features.md +13 -0
- package/dist/agentic/guides/modules/notifications/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/notifications/cli-commands.md +11 -0
- package/dist/agentic/guides/modules/notifications/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/notifications/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/notifications/entities.md +11 -0
- package/dist/agentic/guides/modules/notifications/exact-override-targets.md +18 -0
- package/dist/agentic/guides/modules/notifications/index.md +22 -0
- package/dist/agentic/guides/modules/notifications/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/notifications/setup.md +11 -0
- package/dist/agentic/guides/modules/notifications/umes-hosts.md +11 -0
- package/dist/agentic/guides/modules/notifications/workers.md +11 -0
- package/dist/agentic/guides/modules/onboarding/acl-features.md +13 -0
- package/dist/agentic/guides/modules/onboarding/encryption.md +11 -0
- package/dist/agentic/guides/modules/onboarding/entities.md +11 -0
- package/dist/agentic/guides/modules/onboarding/exact-override-targets.md +16 -0
- package/dist/agentic/guides/modules/onboarding/frontend-pages.md +12 -0
- package/dist/agentic/guides/modules/onboarding/index.md +18 -0
- package/dist/agentic/guides/modules/onboarding/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/onboarding/umes-hosts.md +11 -0
- package/dist/agentic/guides/modules/payment_gateways/acl-features.md +14 -0
- package/dist/agentic/guides/modules/payment_gateways/active-extension-bindings.md +13 -0
- package/dist/agentic/guides/modules/payment_gateways/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/payment_gateways/contribution-resolutions.md +11 -0
- package/dist/agentic/guides/modules/payment_gateways/di-registrations-rich.md +14 -0
- package/dist/agentic/guides/modules/payment_gateways/di-service-tokens.md +12 -0
- package/dist/agentic/guides/modules/payment_gateways/encryption.md +11 -0
- package/dist/agentic/guides/modules/payment_gateways/entities.md +14 -0
- package/dist/agentic/guides/modules/payment_gateways/events.md +19 -0
- package/dist/agentic/guides/modules/payment_gateways/exact-override-targets.md +26 -0
- package/dist/agentic/guides/modules/payment_gateways/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/payment_gateways/incoming-installed-contributions.md +16 -0
- package/dist/agentic/guides/modules/payment_gateways/index.md +29 -0
- package/dist/agentic/guides/modules/payment_gateways/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/payment_gateways/setup.md +11 -0
- package/dist/agentic/guides/modules/payment_gateways/umes-contributions.md +11 -0
- package/dist/agentic/guides/modules/payment_gateways/umes-diagnostics.md +9 -0
- package/dist/agentic/guides/modules/payment_gateways/umes-hosts.md +34 -0
- package/dist/agentic/guides/modules/payment_gateways/workers.md +13 -0
- package/dist/agentic/guides/modules/perspectives/acl-features.md +12 -0
- package/dist/agentic/guides/modules/perspectives/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/perspectives/entities.md +12 -0
- package/dist/agentic/guides/modules/perspectives/exact-override-targets.md +13 -0
- package/dist/agentic/guides/modules/perspectives/index.md +18 -0
- package/dist/agentic/guides/modules/perspectives/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/perspectives/setup.md +11 -0
- package/dist/agentic/guides/modules/perspectives/umes-hosts.md +14 -0
- package/dist/agentic/guides/modules/planner/acl-features.md +12 -0
- package/dist/agentic/guides/modules/planner/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/planner/backend-pages.md +13 -0
- package/dist/agentic/guides/modules/planner/cli-commands.md +12 -0
- package/dist/agentic/guides/modules/planner/contribution-resolutions.md +11 -0
- package/dist/agentic/guides/modules/planner/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/planner/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/planner/domain-commands.md +18 -0
- package/dist/agentic/guides/modules/planner/entities.md +12 -0
- package/dist/agentic/guides/modules/planner/events.md +16 -0
- package/dist/agentic/guides/modules/planner/exact-override-targets.md +21 -0
- package/dist/agentic/guides/modules/planner/index.md +27 -0
- package/dist/agentic/guides/modules/planner/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/planner/search-entities.md +11 -0
- package/dist/agentic/guides/modules/planner/setup.md +11 -0
- package/dist/agentic/guides/modules/planner/umes-contributions.md +11 -0
- package/dist/agentic/guides/modules/planner/umes-hosts.md +21 -0
- package/dist/agentic/guides/modules/portal/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/portal/exact-override-targets.md +19 -0
- package/dist/agentic/guides/modules/portal/frontend-pages.md +18 -0
- package/dist/agentic/guides/modules/portal/incoming-installed-contributions.md +11 -0
- package/dist/agentic/guides/modules/portal/index.md +18 -0
- package/dist/agentic/guides/modules/portal/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/portal/setup.md +11 -0
- package/dist/agentic/guides/modules/portal/umes-hosts.md +22 -0
- package/dist/agentic/guides/modules/progress/acl-features.md +15 -0
- package/dist/agentic/guides/modules/progress/contribution-resolutions.md +16 -0
- package/dist/agentic/guides/modules/progress/entities.md +11 -0
- package/dist/agentic/guides/modules/progress/events.md +16 -0
- package/dist/agentic/guides/modules/progress/exact-override-targets.md +16 -0
- package/dist/agentic/guides/modules/progress/index.md +20 -0
- package/dist/agentic/guides/modules/progress/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/progress/setup.md +11 -0
- package/dist/agentic/guides/modules/progress/umes-contributions.md +16 -0
- package/dist/agentic/guides/modules/progress/umes-hosts.md +17 -0
- package/dist/agentic/guides/modules/query_index/acl-features.md +13 -0
- package/dist/agentic/guides/modules/query_index/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/query_index/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/query_index/cli-commands.md +14 -0
- package/dist/agentic/guides/modules/query_index/contribution-resolutions.md +16 -0
- package/dist/agentic/guides/modules/query_index/entities.md +16 -0
- package/dist/agentic/guides/modules/query_index/events.md +18 -0
- package/dist/agentic/guides/modules/query_index/exact-override-targets.md +25 -0
- package/dist/agentic/guides/modules/query_index/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/query_index/incoming-installed-contributions.md +14 -0
- package/dist/agentic/guides/modules/query_index/index.md +26 -0
- package/dist/agentic/guides/modules/query_index/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/query_index/setup.md +11 -0
- package/dist/agentic/guides/modules/query_index/umes-contributions.md +16 -0
- package/dist/agentic/guides/modules/query_index/umes-diagnostics.md +9 -0
- package/dist/agentic/guides/modules/query_index/umes-hosts.md +34 -0
- package/dist/agentic/guides/modules/record_locks/acl-features.md +14 -0
- package/dist/agentic/guides/modules/record_locks/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/record_locks/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/record_locks/contribution-resolutions.md +33 -0
- package/dist/agentic/guides/modules/record_locks/di-registrations-rich.md +13 -0
- package/dist/agentic/guides/modules/record_locks/di-service-tokens.md +13 -0
- package/dist/agentic/guides/modules/record_locks/domain-commands.md +12 -0
- package/dist/agentic/guides/modules/record_locks/entities.md +12 -0
- package/dist/agentic/guides/modules/record_locks/events.md +20 -0
- package/dist/agentic/guides/modules/record_locks/exact-override-targets.md +41 -0
- package/dist/agentic/guides/modules/record_locks/index.md +26 -0
- package/dist/agentic/guides/modules/record_locks/notifications.md +18 -0
- package/dist/agentic/guides/modules/record_locks/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/record_locks/setup.md +11 -0
- package/dist/agentic/guides/modules/record_locks/umes-contributions.md +33 -0
- package/dist/agentic/guides/modules/record_locks/umes-hosts.md +22 -0
- package/dist/agentic/guides/modules/resources/acl-features.md +12 -0
- package/dist/agentic/guides/modules/resources/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/resources/backend-pages.md +16 -0
- package/dist/agentic/guides/modules/resources/cli-commands.md +14 -0
- package/dist/agentic/guides/modules/resources/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/resources/domain-commands.md +27 -0
- package/dist/agentic/guides/modules/resources/entities.md +16 -0
- package/dist/agentic/guides/modules/resources/events.md +25 -0
- package/dist/agentic/guides/modules/resources/exact-override-targets.md +25 -0
- package/dist/agentic/guides/modules/resources/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/resources/index.md +27 -0
- package/dist/agentic/guides/modules/resources/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/resources/search-entities.md +12 -0
- package/dist/agentic/guides/modules/resources/setup.md +11 -0
- package/dist/agentic/guides/modules/resources/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/resources/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/resources/umes-hosts.md +54 -0
- package/dist/agentic/guides/modules/sales/acl-features.md +29 -0
- package/dist/agentic/guides/modules/sales/active-extension-bindings.md +17 -0
- package/dist/agentic/guides/modules/sales/backend-pages.md +23 -0
- package/dist/agentic/guides/modules/sales/cli-commands.md +17 -0
- package/dist/agentic/guides/modules/sales/contribution-resolutions.md +49 -0
- package/dist/agentic/guides/modules/sales/custom-entities.md +25 -0
- package/dist/agentic/guides/modules/sales/di-registrations-rich.md +40 -0
- package/dist/agentic/guides/modules/sales/di-service-tokens.md +15 -0
- package/dist/agentic/guides/modules/sales/domain-commands.md +80 -0
- package/dist/agentic/guides/modules/sales/encryption.md +15 -0
- package/dist/agentic/guides/modules/sales/entities.md +37 -0
- package/dist/agentic/guides/modules/sales/events.md +54 -0
- package/dist/agentic/guides/modules/sales/exact-override-targets.md +103 -0
- package/dist/agentic/guides/modules/sales/frontend-pages.md +11 -0
- package/dist/agentic/guides/modules/sales/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/sales/incoming-installed-contributions.md +15 -0
- package/dist/agentic/guides/modules/sales/index.md +34 -0
- package/dist/agentic/guides/modules/sales/notifications.md +14 -0
- package/dist/agentic/guides/modules/sales/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/sales/search-entities.md +32 -0
- package/dist/agentic/guides/modules/sales/setup.md +11 -0
- package/dist/agentic/guides/modules/sales/umes-contributions.md +49 -0
- package/dist/agentic/guides/modules/sales/umes-diagnostics.md +10 -0
- package/dist/agentic/guides/modules/sales/umes-hosts.md +147 -0
- package/dist/agentic/guides/modules/scheduler/acl-features.md +13 -0
- package/dist/agentic/guides/modules/scheduler/backend-pages.md +14 -0
- package/dist/agentic/guides/modules/scheduler/cli-commands.md +14 -0
- package/dist/agentic/guides/modules/scheduler/di-registrations-rich.md +13 -0
- package/dist/agentic/guides/modules/scheduler/di-service-tokens.md +13 -0
- package/dist/agentic/guides/modules/scheduler/domain-commands.md +14 -0
- package/dist/agentic/guides/modules/scheduler/entities.md +11 -0
- package/dist/agentic/guides/modules/scheduler/events.md +14 -0
- package/dist/agentic/guides/modules/scheduler/exact-override-targets.md +26 -0
- package/dist/agentic/guides/modules/scheduler/index.md +24 -0
- package/dist/agentic/guides/modules/scheduler/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/scheduler/setup.md +11 -0
- package/dist/agentic/guides/modules/scheduler/umes-hosts.md +15 -0
- package/dist/agentic/guides/modules/scheduler/workers.md +11 -0
- package/dist/agentic/guides/modules/search/acl-features.md +16 -0
- package/dist/agentic/guides/modules/search/ai-tools-mcp-capabilities.md +16 -0
- package/dist/agentic/guides/modules/search/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/search/cli-commands.md +18 -0
- package/dist/agentic/guides/modules/search/contribution-resolutions.md +20 -0
- package/dist/agentic/guides/modules/search/di-registrations-rich.md +15 -0
- package/dist/agentic/guides/modules/search/encryption.md +11 -0
- package/dist/agentic/guides/modules/search/events.md +11 -0
- package/dist/agentic/guides/modules/search/exact-override-targets.md +44 -0
- package/dist/agentic/guides/modules/search/index.md +25 -0
- package/dist/agentic/guides/modules/search/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/search/setup.md +11 -0
- package/dist/agentic/guides/modules/search/umes-contributions.md +20 -0
- package/dist/agentic/guides/modules/search/umes-hosts.md +11 -0
- package/dist/agentic/guides/modules/search/workers.md +12 -0
- package/dist/agentic/guides/modules/security/acl-features.md +17 -0
- package/dist/agentic/guides/modules/security/backend-pages.md +22 -0
- package/dist/agentic/guides/modules/security/contribution-resolutions.md +22 -0
- package/dist/agentic/guides/modules/security/di-registrations-rich.md +17 -0
- package/dist/agentic/guides/modules/security/di-service-tokens.md +16 -0
- package/dist/agentic/guides/modules/security/domain-commands.md +20 -0
- package/dist/agentic/guides/modules/security/entities.md +16 -0
- package/dist/agentic/guides/modules/security/events.md +30 -0
- package/dist/agentic/guides/modules/security/exact-override-targets.md +52 -0
- package/dist/agentic/guides/modules/security/generator-plugins.md +12 -0
- package/dist/agentic/guides/modules/security/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/security/index.md +29 -0
- package/dist/agentic/guides/modules/security/notifications.md +14 -0
- package/dist/agentic/guides/modules/security/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/security/page-middleware.md +13 -0
- package/dist/agentic/guides/modules/security/setup.md +11 -0
- package/dist/agentic/guides/modules/security/umes-contributions.md +22 -0
- package/dist/agentic/guides/modules/security/umes-diagnostics.md +11 -0
- package/dist/agentic/guides/modules/security/umes-hosts.md +65 -0
- package/dist/agentic/guides/modules/shipping_carriers/acl-features.md +12 -0
- package/dist/agentic/guides/modules/shipping_carriers/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/shipping_carriers/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/shipping_carriers/contribution-resolutions.md +15 -0
- package/dist/agentic/guides/modules/shipping_carriers/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/modules/shipping_carriers/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/shipping_carriers/entities.md +13 -0
- package/dist/agentic/guides/modules/shipping_carriers/events.md +17 -0
- package/dist/agentic/guides/modules/shipping_carriers/exact-override-targets.md +23 -0
- package/dist/agentic/guides/modules/shipping_carriers/index.md +25 -0
- package/dist/agentic/guides/modules/shipping_carriers/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/shipping_carriers/setup.md +11 -0
- package/dist/agentic/guides/modules/shipping_carriers/umes-contributions.md +15 -0
- package/dist/agentic/guides/modules/shipping_carriers/umes-hosts.md +21 -0
- package/dist/agentic/guides/modules/shipping_carriers/workers.md +12 -0
- package/dist/agentic/guides/modules/sso/acl-features.md +13 -0
- package/dist/agentic/guides/modules/sso/backend-pages.md +13 -0
- package/dist/agentic/guides/modules/sso/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/sso/di-registrations-rich.md +17 -0
- package/dist/agentic/guides/modules/sso/di-service-tokens.md +16 -0
- package/dist/agentic/guides/modules/sso/entities.md +16 -0
- package/dist/agentic/guides/modules/sso/events.md +22 -0
- package/dist/agentic/guides/modules/sso/exact-override-targets.md +27 -0
- package/dist/agentic/guides/modules/sso/index.md +23 -0
- package/dist/agentic/guides/modules/sso/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/sso/setup.md +11 -0
- package/dist/agentic/guides/modules/sso/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/sso/umes-hosts.md +28 -0
- package/dist/agentic/guides/modules/staff/acl-features.md +26 -0
- package/dist/agentic/guides/modules/staff/active-extension-bindings.md +14 -0
- package/dist/agentic/guides/modules/staff/backend-pages.md +32 -0
- package/dist/agentic/guides/modules/staff/cli-commands.md +14 -0
- package/dist/agentic/guides/modules/staff/contribution-resolutions.md +23 -0
- package/dist/agentic/guides/modules/staff/custom-entities.md +11 -0
- package/dist/agentic/guides/modules/staff/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/staff/domain-commands.md +47 -0
- package/dist/agentic/guides/modules/staff/encryption.md +11 -0
- package/dist/agentic/guides/modules/staff/entities.md +22 -0
- package/dist/agentic/guides/modules/staff/events.md +45 -0
- package/dist/agentic/guides/modules/staff/exact-override-targets.md +66 -0
- package/dist/agentic/guides/modules/staff/index.md +29 -0
- package/dist/agentic/guides/modules/staff/notifications.md +13 -0
- package/dist/agentic/guides/modules/staff/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/staff/search-entities.md +14 -0
- package/dist/agentic/guides/modules/staff/setup.md +11 -0
- package/dist/agentic/guides/modules/staff/umes-contributions.md +23 -0
- package/dist/agentic/guides/modules/staff/umes-hosts.md +65 -0
- package/dist/agentic/guides/modules/storage_s3/acl-features.md +11 -0
- package/dist/agentic/guides/modules/storage_s3/cli-commands.md +12 -0
- package/dist/agentic/guides/modules/storage_s3/contribution-resolutions.md +11 -0
- package/dist/agentic/guides/modules/storage_s3/di-registrations-rich.md +13 -0
- package/dist/agentic/guides/modules/storage_s3/di-service-tokens.md +11 -0
- package/dist/agentic/guides/modules/storage_s3/exact-override-targets.md +19 -0
- package/dist/agentic/guides/modules/storage_s3/index.md +21 -0
- package/dist/agentic/guides/modules/storage_s3/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/storage_s3/setup.md +11 -0
- package/dist/agentic/guides/modules/storage_s3/umes-contributions.md +11 -0
- package/dist/agentic/guides/modules/storage_s3/workers.md +11 -0
- package/dist/agentic/guides/modules/sync_akeneo/cli-commands.md +12 -0
- package/dist/agentic/guides/modules/sync_akeneo/contribution-resolutions.md +11 -0
- package/dist/agentic/guides/modules/sync_akeneo/di-registrations-rich.md +11 -0
- package/dist/agentic/guides/modules/sync_akeneo/exact-override-targets.md +16 -0
- package/dist/agentic/guides/modules/sync_akeneo/index.md +19 -0
- package/dist/agentic/guides/modules/sync_akeneo/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/sync_akeneo/setup.md +11 -0
- package/dist/agentic/guides/modules/sync_akeneo/umes-contributions.md +11 -0
- package/dist/agentic/guides/modules/sync_akeneo/workers.md +12 -0
- package/dist/agentic/guides/modules/sync_excel/acl-features.md +12 -0
- package/dist/agentic/guides/modules/sync_excel/contribution-resolutions.md +11 -0
- package/dist/agentic/guides/modules/sync_excel/entities.md +11 -0
- package/dist/agentic/guides/modules/sync_excel/exact-override-targets.md +14 -0
- package/dist/agentic/guides/modules/sync_excel/index.md +19 -0
- package/dist/agentic/guides/modules/sync_excel/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/sync_excel/setup.md +11 -0
- package/dist/agentic/guides/modules/sync_excel/umes-contributions.md +11 -0
- package/dist/agentic/guides/modules/sync_excel/umes-hosts.md +11 -0
- package/dist/agentic/guides/modules/system_status_overlays/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/system_status_overlays/exact-override-targets.md +12 -0
- package/dist/agentic/guides/modules/system_status_overlays/index.md +15 -0
- package/dist/agentic/guides/modules/system_status_overlays/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/system_status_overlays/umes-contributions.md +12 -0
- package/dist/agentic/guides/modules/translations/acl-features.md +13 -0
- package/dist/agentic/guides/modules/translations/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/translations/backend-pages.md +11 -0
- package/dist/agentic/guides/modules/translations/contribution-resolutions.md +13 -0
- package/dist/agentic/guides/modules/translations/domain-commands.md +12 -0
- package/dist/agentic/guides/modules/translations/entities.md +11 -0
- package/dist/agentic/guides/modules/translations/events.md +12 -0
- package/dist/agentic/guides/modules/translations/exact-override-targets.md +18 -0
- package/dist/agentic/guides/modules/translations/index.md +23 -0
- package/dist/agentic/guides/modules/translations/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/translations/setup.md +11 -0
- package/dist/agentic/guides/modules/translations/umes-contributions.md +13 -0
- package/dist/agentic/guides/modules/translations/umes-hosts.md +15 -0
- package/dist/agentic/guides/modules/webhooks/acl-features.md +14 -0
- package/dist/agentic/guides/modules/webhooks/backend-pages.md +13 -0
- package/dist/agentic/guides/modules/webhooks/contribution-resolutions.md +20 -0
- package/dist/agentic/guides/modules/webhooks/encryption.md +12 -0
- package/dist/agentic/guides/modules/webhooks/entities.md +15 -0
- package/dist/agentic/guides/modules/webhooks/events.md +22 -0
- package/dist/agentic/guides/modules/webhooks/exact-override-targets.md +26 -0
- package/dist/agentic/guides/modules/webhooks/generator-plugins.md +12 -0
- package/dist/agentic/guides/modules/webhooks/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/webhooks/index.md +27 -0
- package/dist/agentic/guides/modules/webhooks/notifications.md +11 -0
- package/dist/agentic/guides/modules/webhooks/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/webhooks/setup.md +11 -0
- package/dist/agentic/guides/modules/webhooks/umes-contributions.md +20 -0
- package/dist/agentic/guides/modules/webhooks/umes-diagnostics.md +11 -0
- package/dist/agentic/guides/modules/webhooks/umes-hosts.md +54 -0
- package/dist/agentic/guides/modules/webhooks/workers.md +12 -0
- package/dist/agentic/guides/modules/wms/acl-features.md +20 -0
- package/dist/agentic/guides/modules/wms/active-extension-bindings.md +12 -0
- package/dist/agentic/guides/modules/wms/backend-pages.md +22 -0
- package/dist/agentic/guides/modules/wms/cli-commands.md +11 -0
- package/dist/agentic/guides/modules/wms/contribution-resolutions.md +29 -0
- package/dist/agentic/guides/modules/wms/custom-entities.md +18 -0
- package/dist/agentic/guides/modules/wms/di-registrations-rich.md +18 -0
- package/dist/agentic/guides/modules/wms/domain-commands.md +34 -0
- package/dist/agentic/guides/modules/wms/entities.md +19 -0
- package/dist/agentic/guides/modules/wms/events.md +37 -0
- package/dist/agentic/guides/modules/wms/exact-override-targets.md +57 -0
- package/dist/agentic/guides/modules/wms/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/wms/index.md +30 -0
- package/dist/agentic/guides/modules/wms/notifications.md +12 -0
- package/dist/agentic/guides/modules/wms/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/wms/search-entities.md +14 -0
- package/dist/agentic/guides/modules/wms/setup.md +11 -0
- package/dist/agentic/guides/modules/wms/umes-contributions.md +29 -0
- package/dist/agentic/guides/modules/wms/umes-diagnostics.md +22 -0
- package/dist/agentic/guides/modules/wms/umes-hosts.md +181 -0
- package/dist/agentic/guides/modules/workflows/acl-features.md +28 -0
- package/dist/agentic/guides/modules/workflows/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/workflows/backend-pages.md +20 -0
- package/dist/agentic/guides/modules/workflows/cli-commands.md +18 -0
- package/dist/agentic/guides/modules/workflows/contribution-resolutions.md +16 -0
- package/dist/agentic/guides/modules/workflows/di-registrations-rich.md +17 -0
- package/dist/agentic/guides/modules/workflows/di-service-tokens.md +17 -0
- package/dist/agentic/guides/modules/workflows/entities.md +17 -0
- package/dist/agentic/guides/modules/workflows/events.md +36 -0
- package/dist/agentic/guides/modules/workflows/exact-override-targets.md +61 -0
- package/dist/agentic/guides/modules/workflows/frontend-pages.md +11 -0
- package/dist/agentic/guides/modules/workflows/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/workflows/index.md +30 -0
- package/dist/agentic/guides/modules/workflows/notifications.md +11 -0
- package/dist/agentic/guides/modules/workflows/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/workflows/setup.md +11 -0
- package/dist/agentic/guides/modules/workflows/umes-contributions.md +16 -0
- package/dist/agentic/guides/modules/workflows/umes-diagnostics.md +11 -0
- package/dist/agentic/guides/modules/workflows/umes-hosts.md +71 -0
- package/dist/agentic/guides/modules/workflows/workers.md +11 -0
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/reference-modules/example/acl-features.md +19 -0
- package/dist/agentic/guides/reference-modules/example/active-extension-bindings.md +26 -0
- package/dist/agentic/guides/reference-modules/example/ai-agents.md +11 -0
- package/dist/agentic/guides/reference-modules/example/ai-extensions.md +13 -0
- package/dist/agentic/guides/reference-modules/example/ai-tools-mcp-capabilities.md +12 -0
- package/dist/agentic/guides/reference-modules/example/backend-pages.md +24 -0
- package/dist/agentic/guides/reference-modules/example/cli-commands.md +12 -0
- package/dist/agentic/guides/reference-modules/example/contribution-resolutions.md +83 -0
- package/dist/agentic/guides/reference-modules/example/custom-entities.md +12 -0
- package/dist/agentic/guides/reference-modules/example/di-registrations-rich.md +12 -0
- package/dist/agentic/guides/reference-modules/example/di-service-tokens.md +11 -0
- package/dist/agentic/guides/reference-modules/example/domain-commands.md +13 -0
- package/dist/agentic/guides/reference-modules/example/encryption.md +11 -0
- package/dist/agentic/guides/reference-modules/example/entities.md +14 -0
- package/dist/agentic/guides/reference-modules/example/events.md +15 -0
- package/dist/agentic/guides/reference-modules/example/exact-override-targets.md +93 -0
- package/dist/agentic/guides/reference-modules/example/frontend-pages.md +12 -0
- package/dist/agentic/guides/reference-modules/example/generator-plugins.md +11 -0
- package/dist/agentic/guides/reference-modules/example/host-extension-points.md +10 -0
- package/dist/agentic/guides/reference-modules/example/index.md +40 -0
- package/dist/agentic/guides/reference-modules/example/notifications.md +11 -0
- package/dist/agentic/guides/reference-modules/example/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/reference-modules/example/page-middleware.md +12 -0
- package/dist/agentic/guides/reference-modules/example/search-entities.md +11 -0
- package/dist/agentic/guides/reference-modules/example/setup.md +11 -0
- package/dist/agentic/guides/reference-modules/example/umes-contributions.md +83 -0
- package/dist/agentic/guides/reference-modules/example/umes-diagnostics.md +16 -0
- package/dist/agentic/guides/reference-modules/example/umes-hosts.md +36 -0
- package/dist/agentic/guides/reference-modules/example/workers.md +12 -0
- package/dist/agentic/guides/upstream/manifest.json +1 -1
- package/dist/agentic/shared/ai/harness/cases.json +364 -364
- package/dist/agentic/shared/ai/harness/writable-spec-oracles.mjs +1 -1
- package/dist/agentic/shared/ai/skills/om-build-workflow/SKILL.md +2 -2
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/SKILL.md +1 -1
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/surface-selector.md +1 -1
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/business-one-shot-blueprints.md +1 -1
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +12 -3
- package/dist/lib/__integration__/TC-INT-008.spec.js +10 -2
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-setup.js +24 -7
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/generators/module-facts.js +277 -98
- package/dist/lib/generators/module-facts.js.map +2 -2
- package/package.json +6 -6
- package/src/lib/__integration__/TC-INT-008.spec.ts +12 -4
- package/src/lib/__tests__/agentic-setup.ownership.test.ts +19 -0
- package/src/lib/agentic-setup.ts +34 -10
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +118 -2
- package/src/lib/generators/__tests__/module-facts.source-links.test.ts +78 -2
- package/src/lib/generators/module-facts.ts +378 -96
- package/dist/agentic/guides/modules/ai_assistant.md +0 -256
- package/dist/agentic/guides/modules/api_docs.md +0 -95
- package/dist/agentic/guides/modules/api_keys.md +0 -126
- package/dist/agentic/guides/modules/attachments.md +0 -154
- package/dist/agentic/guides/modules/audit_logs.md +0 -163
- package/dist/agentic/guides/modules/auth.md +0 -307
- package/dist/agentic/guides/modules/business_rules.md +0 -179
- package/dist/agentic/guides/modules/catalog.md +0 -512
- package/dist/agentic/guides/modules/channel_gmail.md +0 -118
- package/dist/agentic/guides/modules/channel_imap.md +0 -118
- package/dist/agentic/guides/modules/checkout.md +0 -338
- package/dist/agentic/guides/modules/communication_channels.md +0 -347
- package/dist/agentic/guides/modules/configs.md +0 -138
- package/dist/agentic/guides/modules/content.md +0 -94
- package/dist/agentic/guides/modules/currencies.md +0 -185
- package/dist/agentic/guides/modules/customer_accounts.md +0 -418
- package/dist/agentic/guides/modules/customers.md +0 -780
- package/dist/agentic/guides/modules/dashboards.md +0 -188
- package/dist/agentic/guides/modules/data_sync.md +0 -182
- package/dist/agentic/guides/modules/design_system.md +0 -102
- package/dist/agentic/guides/modules/dictionaries.md +0 -141
- package/dist/agentic/guides/modules/directory.md +0 -182
- package/dist/agentic/guides/modules/entities.md +0 -178
- package/dist/agentic/guides/modules/eudr.md +0 -363
- package/dist/agentic/guides/modules/events.md +0 -96
- package/dist/agentic/guides/modules/feature_toggles.md +0 -152
- package/dist/agentic/guides/modules/gateway_stripe.md +0 -127
- package/dist/agentic/guides/modules/generators.md +0 -82
- package/dist/agentic/guides/modules/inbox_ops.md +0 -239
- package/dist/agentic/guides/modules/integrations.md +0 -182
- package/dist/agentic/guides/modules/messages.md +0 -254
- package/dist/agentic/guides/modules/notifications.md +0 -129
- package/dist/agentic/guides/modules/onboarding.md +0 -112
- package/dist/agentic/guides/modules/payment_gateways.md +0 -201
- package/dist/agentic/guides/modules/perspectives.md +0 -112
- package/dist/agentic/guides/modules/planner.md +0 -167
- package/dist/agentic/guides/modules/portal.md +0 -130
- package/dist/agentic/guides/modules/progress.md +0 -138
- package/dist/agentic/guides/modules/query_index.md +0 -185
- package/dist/agentic/guides/modules/record_locks.md +0 -238
- package/dist/agentic/guides/modules/resources.md +0 -229
- package/dist/agentic/guides/modules/sales.md +0 -714
- package/dist/agentic/guides/modules/scheduler.md +0 -165
- package/dist/agentic/guides/modules/search.md +0 -203
- package/dist/agentic/guides/modules/security.md +0 -326
- package/dist/agentic/guides/modules/shipping_carriers.md +0 -167
- package/dist/agentic/guides/modules/sso.md +0 -184
- package/dist/agentic/guides/modules/staff.md +0 -403
- package/dist/agentic/guides/modules/storage_s3.md +0 -129
- package/dist/agentic/guides/modules/sync_akeneo.md +0 -121
- package/dist/agentic/guides/modules/sync_excel.md +0 -110
- package/dist/agentic/guides/modules/system_status_overlays.md +0 -97
- package/dist/agentic/guides/modules/translations.md +0 -138
- package/dist/agentic/guides/modules/webhooks.md +0 -233
- package/dist/agentic/guides/modules/wms.md +0 -499
- package/dist/agentic/guides/modules/workflows.md +0 -332
- package/dist/agentic/guides/reference-modules/example.md +0 -489
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/generators/module-facts.ts"],
|
|
4
|
-
"sourcesContent": ["import { createHash } from 'node:crypto'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport ts from 'typescript-js'\nimport {\n COMPONENT_OVERRIDE_MODES,\n CRUD_FORM_EXTENSION_SURFACE_KEYS,\n CRUD_FORM_LIFECYCLE_PHASES,\n CRUD_FORM_OPERATIONS,\n DATA_TABLE_EXTENSION_SURFACE_KEYS,\n EXTENSION_HOST_ACTIVATIONS,\n EXTENSION_HOST_CAPABILITIES,\n EXTENSION_HOST_FAMILIES,\n MODULE_EXTENSION_ACTIVATION_KINDS,\n MODULE_EXTENSION_CONTRIBUTION_KINDS,\n MODULE_EXTENSION_HOST_RESOLUTIONS,\n MODULE_EXTENSION_RESOLUTIONS,\n MODULE_EXTENSION_TARGET_KINDS,\n MODULE_EXTENSION_TARGET_RESOLUTIONS,\n MODULE_EXTENSION_UNRESOLVED_REASONS,\n MODULE_SPECIALIZED_REGISTRIES,\n type ModuleExtensionContributionFact,\n type ModuleExtensionHostFact,\n type ModuleExtensionSurfaceFacts,\n type ModuleExtensionTargetRef,\n} from '@open-mercato/shared/modules/widgets/extension-points'\nimport { toSnake } from '../utils'\nimport { extractCommandIdsFromSource } from './module-registry'\nimport { MODULE_CODE_EXTENSIONS } from './scanner'\nimport type { ApiRouteInterceptorBridge } from './module-extension-facts'\nimport {\n assertNoUnresolvedExtensionTargets,\n correlateIncomingExtensions,\n correlateModuleExtensionFacts,\n extractActivationTargetOwners,\n extractKnownApiRouteIds,\n extractKnownCommandIds,\n extractModuleExtensionFacts,\n renderFrameworkExtensionPointsMarkdown,\n withModuleExtensionFactExtractionCache,\n} from './module-extension-facts'\nimport {\n ALL_OVERRIDE_DOMAINS,\n MODULE_OVERRIDE_MODES,\n MODULE_OVERRIDE_TARGET_DIAGNOSTIC_CODES,\n MODULE_OVERRIDE_TARGET_NOTES,\n collectModuleOverrideTargets,\n type ModuleOverrideTarget,\n type ModuleOverrideTargetDiagnostic,\n} from './module-override-targets'\nimport { buildFactSourceLookup, type FactSourceLookup } from './module-fact-sources'\nimport { appendLocalReferenceModuleSource } from './module-facts-discovery'\n\nexport interface ModuleEntityFact {\n id: string\n class: string\n table: string\n editable: boolean\n customFields: boolean\n}\n\nexport interface ApiRouteAuthRule {\n requireAuth?: boolean\n requireFeatures?: string[]\n requireRoles?: string[]\n}\n\nexport interface ModuleApiRouteFact {\n path: string\n methods: string[]\n auth: Record<string, ApiRouteAuthRule>\n sourcePath: string | null\n}\n\n/**\n * Statically declared page metadata that affects extensibility or access, using the\n * runtime `PageMetadata` contract keys and the same alias precedence as\n * `resolvePageRouteMetadata` (`pageGroup ?? group`, `pageGroupKey ?? groupKey`,\n * `pageOrder ?? order`). Executable guards, icons, titles and translation results are\n * never serialized.\n */\nexport interface ModulePageMetadata {\n requireAuth?: boolean\n requireCustomerAuth?: boolean\n requireFeatures?: string[]\n requireCustomerFeatures?: string[]\n navHidden?: boolean\n navGroup?: string\n navGroupKey?: string\n navOrder?: number\n pageContext?: 'main' | 'admin' | 'settings' | 'profile'\n}\n\nexport interface ModulePageFact {\n path: string\n sourcePath: string\n /** Companion metadata file (`page.meta.*` / `meta.*`) when runtime reads metadata from one. */\n metadataSourcePath?: string\n metadata?: ModulePageMetadata\n}\n\nexport interface ModuleCliCommandFact {\n command: string\n sourcePath: string\n}\n\nexport interface ModuleAiToolFact {\n name: string\n sourcePath: string\n}\n\nexport interface ModuleAiAgentFact {\n id: string\n sourcePath: string\n}\n\nexport interface ModuleEventFact {\n id: string\n label?: string\n category: string | null\n entity: string | null\n clientBroadcast?: boolean\n portalBroadcast?: boolean\n}\n\nexport interface ModuleHostTokens {\n entityIds: string[]\n tableIds: string[]\n}\n\nexport type ModuleFactSourceRef = {\n sourcePath: string\n exportName?: string\n line?: number\n}\n\nexport type ModuleFactRef = {\n factSection: string\n factKey: string\n}\n\n/**\n * Closed provenance/contract sets, published as `as const` ledgers whose types\n * derive from them. The `factCoverage` ledger enumerates these at runtime, so a\n * kind added here without a ledger row fails the coverage contract test rather\n * than silently joining the public surface unclassified.\n */\nexport const MODULE_FACT_SOURCE_KINDS = [\n 'module-metadata',\n 'entity',\n 'event',\n 'acl-feature',\n 'api-route',\n 'di-registration',\n 'search',\n 'vector',\n 'notification',\n 'cli-command',\n 'backend-page',\n 'frontend-page',\n 'ai-tool',\n 'ai-agent',\n 'ai-extension',\n 'command',\n 'subscriber',\n 'worker',\n 'page-middleware',\n 'setup',\n 'encryption',\n 'custom-entity',\n 'integration',\n 'generator-plugin',\n 'extension-host',\n 'extension-contribution',\n] as const\n\nexport type ModuleFactSourceKind = (typeof MODULE_FACT_SOURCE_KINDS)[number]\n\nexport const MODULE_OWNED_CONTRACT_KINDS = [\n 'module-metadata',\n 'command',\n 'worker',\n 'page-middleware',\n 'setup',\n 'encryption',\n 'di-registration',\n 'custom-entity',\n 'ai-extension',\n 'generator-plugin',\n] as const\n\nexport type ModuleOwnedContractKind = (typeof MODULE_OWNED_CONTRACT_KINDS)[number]\n\nexport type ModuleFactSafeScalar = string | number | boolean | null\n\nexport type ModuleOwnedContractFact = {\n kind: ModuleOwnedContractKind\n id: string\n source: ModuleFactSourceRef\n metadata?: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]>\n}\n\nexport type ModuleOwnedContracts = Partial<\n Record<ModuleOwnedContractKind, ModuleOwnedContractFact[]>\n>\n\n/**\n * Provenance pointer into a fact section that already serializes the declaration site.\n * `factKey` is omitted when it equals the owning entry's `id`, which is the common case.\n */\nexport type ModuleFactIndexRef = {\n factSection: string\n factKey?: string\n}\n\n/**\n * One provenance entry per proven `(kind, id)` in the module. Exactly one of `source`\n * (the declaration site, for facts that have no other home in the JSON) or `factRef`\n * (a deterministic pointer into a fact section that already carries the source inline)\n * is present, so a consumer resolves any fact's origin through this single index.\n */\nexport type ModuleFactSourceEntry = {\n kind: ModuleFactSourceKind\n id: string\n source?: ModuleFactSourceRef\n factRef?: ModuleFactIndexRef\n}\n\nexport const MODULE_FACT_DIAGNOSTIC_CODES = ['duplicate-source', 'unresolved-static-contract'] as const\n\nexport type ModuleFactDiagnosticCode = (typeof MODULE_FACT_DIAGNOSTIC_CODES)[number]\n\nexport type ModuleFactDiagnostic = {\n code: ModuleFactDiagnosticCode\n kind: ModuleFactSourceKind\n id: string\n source?: ModuleFactSourceRef\n}\n\nexport type ModuleDiRegistrationFact = {\n token: string\n registrationKind: 'function' | 'class' | 'value' | 'alias'\n providerSymbol?: string\n lifetime?: 'singleton' | 'scoped' | 'transient'\n injectionMode?: 'classic' | 'proxy'\n source: ModuleFactSourceRef\n}\n\n/**\n * How the extracted module reached the batch. `package` is the implicit default for\n * every installed `@open-mercato/*` module and never appears in emitted output, so the\n * package sidecar contract stays byte-identical. `local-reference` marks an app-local\n * module projected into the explicit reference bundle; it is an independent discriminator\n * from `sourcePackage`, which keeps its legacy \"null means core package\" meaning.\n */\nexport type ModuleFactProjectionSourceKind = 'package' | 'local-reference'\n\nexport interface ModuleFacts {\n module: string\n title: string | null\n description: string | null\n coreVersion: string | null\n sourcePackage: string | null\n sourceVersion: string | null\n sourceRoot: string\n /** Present only for `local-reference` projections; package modules omit it entirely. */\n sourceKind?: ModuleFactProjectionSourceKind\n entities: ModuleEntityFact[]\n events: ModuleEventFact[]\n aclFeatures: string[]\n apiRoutes: ModuleApiRouteFact[]\n diTokens: string[]\n searchEntities: string[]\n hostTokens: ModuleHostTokens\n notifications: string[]\n cli: string[]\n backendPages: ModulePageFact[]\n frontendPages: ModulePageFact[]\n cliCommands: ModuleCliCommandFact[]\n aiTools: ModuleAiToolFact[]\n aiAgents: ModuleAiAgentFact[]\n extensionSurfaces?: ModuleExtensionSurfaceFacts\n factSources?: ModuleFactSourceEntry[]\n ownedContracts?: ModuleOwnedContracts\n factDiagnostics?: ModuleFactDiagnostic[]\n overrideTargets?: ModuleOverrideTarget[]\n overrideTargetDiagnostics?: ModuleOverrideTargetDiagnostic[]\n warnings: string[]\n}\n\nexport interface ExtractModuleFactsOptions {\n moduleId: string\n /**\n * Parent modules directory joined with `moduleId` to locate the module source.\n * Legacy input; prefer the explicit per-module `moduleRoot` for modules that do\n * not live under a single shared root (auto-discovery). One of `moduleRoot` /\n * `coreSrcRoot` must be provided.\n */\n coreSrcRoot?: string\n /** Explicit module source directory. When set it overrides `coreSrcRoot + moduleId`. */\n moduleRoot?: string\n coreVersion?: string | null\n sourcePackage?: string | null\n sourceVersion?: string | null\n registryPath?: string | null\n registrySource?: string | null\n /**\n * App-root-relative POSIX root written into every emitted source path. Overrides the\n * default `node_modules/<package>/src/modules/<moduleId>` layout so an app-local module\n * emits `src/modules/<moduleId>` instead of a package path it does not live in.\n */\n portableSourceRoot?: string\n sourceKind?: ModuleFactProjectionSourceKind\n /** Generated-facts compatibility projection. Omitted means the corrected v2 contract. */\n factsContractVersion?: 1 | 2\n}\n\n/** A discovered module and the source directory its facts are extracted from. */\nexport interface ModuleFactSource {\n moduleId: string\n moduleRoot: string\n from?: string\n packageVersion?: string | null\n portableSourceRoot?: string\n sourceKind?: ModuleFactProjectionSourceKind\n}\n\nfunction readSourceFile(filePath: string): ts.SourceFile | null {\n if (!fs.existsSync(filePath)) return null\n const source = fs.readFileSync(filePath, 'utf8')\n const scriptKind = filePath.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS\n return ts.createSourceFile(filePath, source, ts.ScriptTarget.ES2020, true, scriptKind)\n}\n\nfunction resolveConventionFile(baseDir: string, basename: string): string | null {\n for (const extension of ['.ts', '.tsx']) {\n const candidate = path.join(baseDir, `${basename}${extension}`)\n if (fs.existsSync(candidate)) return candidate\n }\n return null\n}\n\nfunction readStringPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): string | undefined {\n for (const property of objectLiteral.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const name = ts.isIdentifier(property.name)\n ? property.name.text\n : ts.isStringLiteralLike(property.name)\n ? property.name.text\n : undefined\n if (name !== propertyName) continue\n if (ts.isStringLiteralLike(property.initializer)) return property.initializer.text\n return undefined\n }\n return undefined\n}\n\nfunction getClassDecoratorCall(node: ts.ClassDeclaration, decoratorName: string): ts.CallExpression | undefined {\n const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) ?? [] : []\n for (const decorator of decorators) {\n const expression = decorator.expression\n if (!ts.isCallExpression(expression)) continue\n if (ts.isIdentifier(expression.expression) && expression.expression.text === decoratorName) {\n return expression\n }\n }\n return undefined\n}\n\nfunction readDecoratorTableName(decoratorCall: ts.CallExpression): string | undefined {\n const firstArgument = decoratorCall.arguments[0]\n if (!firstArgument || !ts.isObjectLiteralExpression(firstArgument)) return undefined\n return readStringPropertyInitializer(firstArgument, 'tableName')\n}\n\nfunction getPropertyDecoratorName(member: ts.PropertyDeclaration): string | undefined {\n const decorators = ts.canHaveDecorators(member) ? ts.getDecorators(member) ?? [] : []\n for (const decorator of decorators) {\n const expression = decorator.expression\n if (!ts.isCallExpression(expression)) continue\n const firstArgument = expression.arguments[0]\n if (!firstArgument || !ts.isObjectLiteralExpression(firstArgument)) continue\n const columnName = readStringPropertyInitializer(firstArgument, 'name')\n if (columnName) return columnName\n }\n return undefined\n}\n\nfunction classHasUpdatedAtColumn(node: ts.ClassDeclaration): boolean {\n for (const member of node.members) {\n if (!ts.isPropertyDeclaration(member) || !member.name) continue\n const propertyName = ts.isIdentifier(member.name)\n ? member.name.text\n : ts.isStringLiteralLike(member.name)\n ? member.name.text\n : undefined\n if (propertyName === 'updatedAt') return true\n if (getPropertyDecoratorName(member) === 'updated_at') return true\n }\n return false\n}\n\nfunction readStaticAccessPath(candidate: ts.Expression): string[] | null {\n const access = unwrapExpression(candidate)\n if (ts.isIdentifier(access)) return [access.text]\n if (ts.isPropertyAccessExpression(access)) {\n const parent = readStaticAccessPath(access.expression)\n return parent ? [...parent, access.name.text] : null\n }\n if (ts.isElementAccessExpression(access) && access.argumentExpression) {\n const parent = readStaticAccessPath(access.expression)\n const key = unwrapExpression(access.argumentExpression)\n return parent && ts.isStringLiteralLike(key) ? [...parent, key.text] : null\n }\n return null\n}\n\n/**\n * Resolves an entity-id expression to its literal `module:entity` value.\n *\n * Modules reference entity ids three ways and all three are statically knowable:\n * a string literal, `E.<module>.<entity>` from the generated entity-id registry\n * (`entity-ids.ts` emits `E[module][entity] = '<module>:<entity>'`), and \u2014 when\n * `initializers` is supplied \u2014 a same-file `const ENTITY_ID = 'module:entity'`.\n * Anything else stays undefined: a guessed id is worse than a missing one.\n */\nfunction resolveEntityIdReference(\n expression: ts.Expression,\n initializers?: Map<string, ts.Expression>,\n visitedIdentifiers: Set<string> = new Set(),\n): string | undefined {\n const current = unwrapExpression(expression)\n if (ts.isStringLiteralLike(current)) return current.text\n const accessPath = readStaticAccessPath(current)\n if (accessPath?.length === 3 && accessPath[0] === 'E') {\n return `${accessPath[1]}:${accessPath[2]}`\n }\n if (initializers && ts.isIdentifier(current) && !visitedIdentifiers.has(current.text)) {\n visitedIdentifiers.add(current.text)\n const declaration = initializers.get(current.text)\n if (declaration) return resolveEntityIdReference(declaration, initializers, visitedIdentifiers)\n }\n return undefined\n}\n\nfunction collectCustomFieldEntityIds(ceFilePath: string | null): Set<string> {\n const result = new Set<string>()\n if (!ceFilePath) return result\n const sourceFile = readSourceFile(ceFilePath)\n if (!sourceFile) return result\n\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node)) {\n const initializer = getObjectPropertyInitializer(node, 'id')\n if (initializer) {\n const id = resolveEntityIdReference(initializer)\n if (id && id.includes(':')) result.add(id)\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction extractEntities(\n moduleId: string,\n entitiesFilePath: string | null,\n customFieldEntityIds: Set<string>,\n): ModuleEntityFact[] {\n const sourceFile = entitiesFilePath ? readSourceFile(entitiesFilePath) : null\n if (!sourceFile) return []\n\n const facts: ModuleEntityFact[] = []\n sourceFile.forEachChild((node) => {\n if (!ts.isClassDeclaration(node) || !node.name) return\n const isExported = node.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)\n if (!isExported) return\n const entityDecorator = getClassDecoratorCall(node, 'Entity')\n if (!entityDecorator) return\n\n const className = node.name.text\n const table = readDecoratorTableName(entityDecorator)\n if (!table) return\n\n const entityId = `${moduleId}:${toSnake(className)}`\n facts.push({\n id: entityId,\n class: className,\n table,\n editable: classHasUpdatedAtColumn(node),\n customFields: customFieldEntityIds.has(entityId),\n })\n })\n\n return facts\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression\n while (ts.isAsExpression(current) || ts.isParenthesizedExpression(current) || ts.isTypeAssertionExpression(current)) {\n current = current.expression\n }\n return current\n}\n\nfunction unwrapArrayLiteral(expression: ts.Expression): ts.ArrayLiteralExpression | null {\n const current = unwrapExpression(expression)\n return ts.isArrayLiteralExpression(current) ? current : null\n}\n\nfunction getPropertyName(property: ts.ObjectLiteralElementLike): string | undefined {\n if (!ts.isPropertyAssignment(property) && !ts.isShorthandPropertyAssignment(property)) return undefined\n const name = property.name\n if (!name) return undefined\n if (ts.isIdentifier(name)) return name.text\n if (ts.isStringLiteralLike(name)) return name.text\n // A computed key whose expression is a string literal or a same-file `const NAME = 'token'`\n // is still a statically known token. Without this, `{ [SERVICE_TOKEN]: asFunction(...) }` \u2014\n // the idiomatic, type-safe way to register a DI token from an exported const \u2014 yielded\n // undefined and the registration vanished from module facts with NO diagnostic, because the\n // unresolved-token path is only reached for a NAMED token whose Awilix kind is unrecognised.\n if (ts.isComputedPropertyName(name)) return resolveComputedPropertyKey(name.expression)\n return undefined\n}\n\n/** Resolves a computed key to its literal token when the value is statically knowable. */\nfunction resolveComputedPropertyKey(expression: ts.Expression): string | undefined {\n if (ts.isStringLiteralLike(expression)) return expression.text\n // `X as const` / `X satisfies Y` wrappers.\n if (ts.isAsExpression(expression) || ts.isSatisfiesExpression(expression)) {\n return resolveComputedPropertyKey(expression.expression)\n }\n if (ts.isParenthesizedExpression(expression)) return resolveComputedPropertyKey(expression.expression)\n if (!ts.isIdentifier(expression)) return undefined\n const sourceFile = expression.getSourceFile()\n if (!sourceFile) return undefined\n let resolved: string | undefined\n const visit = (node: ts.Node): void => {\n if (resolved) return\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.name.text === expression.text) {\n if (node.initializer) resolved = resolveComputedPropertyKey(node.initializer)\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return resolved\n}\n\nfunction getObjectPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): ts.Expression | undefined {\n for (const property of objectLiteral.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n if (getPropertyName(property) === propertyName) return property.initializer\n }\n return undefined\n}\n\nfunction findObjectLiteralDeclaration(\n sourceFile: ts.SourceFile,\n variableName: string,\n): ts.ObjectLiteralExpression | null {\n let result: ts.ObjectLiteralExpression | null = null\n const visit = (node: ts.Node): void => {\n if (result) return\n if (\n ts.isVariableDeclaration(node) &&\n ts.isIdentifier(node.name) &&\n node.name.text === variableName &&\n node.initializer\n ) {\n const unwrapped = unwrapExpression(node.initializer)\n if (ts.isObjectLiteralExpression(unwrapped)) {\n result = unwrapped\n return\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction buildVariableInitializerMap(sourceFile: ts.SourceFile): Map<string, ts.Expression> {\n const initializers = new Map<string, ts.Expression>()\n const visit = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n if (!initializers.has(node.name.text)) initializers.set(node.name.text, node.initializer)\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return initializers\n}\n\nfunction resolveToObjectLiteral(\n expression: ts.Expression,\n initializers: Map<string, ts.Expression>,\n): ts.ObjectLiteralExpression | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isObjectLiteralExpression(unwrapped)) return unwrapped\n if (ts.isIdentifier(unwrapped)) {\n const referenced = initializers.get(unwrapped.text)\n if (referenced) return resolveToObjectLiteral(referenced, initializers)\n }\n return null\n}\n\nfunction resolveToArrayLiteral(\n expression: ts.Expression,\n initializers: Map<string, ts.Expression>,\n): ts.ArrayLiteralExpression | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isArrayLiteralExpression(unwrapped)) return unwrapped\n if (ts.isIdentifier(unwrapped)) {\n const referenced = initializers.get(unwrapped.text)\n if (referenced) return resolveToArrayLiteral(referenced, initializers)\n }\n return null\n}\n\nfunction findDefaultExportExpression(sourceFile: ts.SourceFile): ts.Expression | null {\n for (const statement of sourceFile.statements) {\n if (ts.isExportAssignment(statement) && !statement.isExportEquals) return statement.expression\n }\n return null\n}\n\nfunction findArrayLiteralDeclaration(\n sourceFile: ts.SourceFile,\n variableName: string,\n): ts.ArrayLiteralExpression | null {\n let result: ts.ArrayLiteralExpression | null = null\n const visit = (node: ts.Node): void => {\n if (result) return\n if (\n ts.isVariableDeclaration(node) &&\n ts.isIdentifier(node.name) &&\n node.name.text === variableName &&\n node.initializer\n ) {\n const arrayLiteral = unwrapArrayLiteral(node.initializer)\n if (arrayLiteral) {\n result = arrayLiteral\n return\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction extractEvents(eventsFilePath: string | null): ModuleEventFact[] {\n const sourceFile = eventsFilePath ? readSourceFile(eventsFilePath) : null\n if (!sourceFile) return []\n\n const eventsArray = findArrayLiteralDeclaration(sourceFile, 'events')\n if (!eventsArray) return []\n\n const facts: ModuleEventFact[] = []\n for (const element of eventsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const id = readStringPropertyInitializer(element, 'id')\n if (!id) continue\n const label = readStringPropertyInitializer(element, 'label')\n const category = readStringPropertyInitializer(element, 'category')\n const entity = readStringPropertyInitializer(element, 'entity')\n const fact: ModuleEventFact = {\n id,\n category: category ?? null,\n entity: entity ?? null,\n }\n const clientBroadcast = readBooleanPropertyInitializer(element, 'clientBroadcast')\n const portalBroadcast = readBooleanPropertyInitializer(element, 'portalBroadcast')\n if (label !== undefined) fact.label = label\n if (clientBroadcast !== undefined) fact.clientBroadcast = clientBroadcast\n if (portalBroadcast !== undefined) fact.portalBroadcast = portalBroadcast\n facts.push(fact)\n }\n\n return facts\n}\n\nfunction extractAclFeatures(aclFilePath: string | null): string[] {\n const sourceFile = aclFilePath ? readSourceFile(aclFilePath) : null\n if (!sourceFile) return []\n\n const featuresArray = findArrayLiteralDeclaration(sourceFile, 'features')\n if (!featuresArray) return []\n\n const featureIds: string[] = []\n const seen = new Set<string>()\n for (const element of featuresArray.elements) {\n let featureId: string | undefined\n if (ts.isObjectLiteralExpression(element)) {\n featureId = readStringPropertyInitializer(element, 'id')\n } else if (ts.isStringLiteralLike(element)) {\n featureId = element.text\n }\n if (!featureId || seen.has(featureId)) continue\n seen.add(featureId)\n featureIds.push(featureId)\n }\n\n return featureIds\n}\n\nfunction readBooleanPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): boolean | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n if (initializer.kind === ts.SyntaxKind.TrueKeyword) return true\n if (initializer.kind === ts.SyntaxKind.FalseKeyword) return false\n return undefined\n}\n\nfunction readStringArrayPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): string[] | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n const arrayLiteral = unwrapArrayLiteral(initializer)\n if (!arrayLiteral) return undefined\n const values: string[] = []\n for (const element of arrayLiteral.elements) {\n if (ts.isStringLiteralLike(element)) values.push(element.text)\n }\n return values\n}\n\nfunction parseApiRouteAuthRule(metadataLiteral: ts.ObjectLiteralExpression): ApiRouteAuthRule {\n const rule: ApiRouteAuthRule = {}\n const requireAuth = readBooleanPropertyInitializer(metadataLiteral, 'requireAuth')\n if (requireAuth !== undefined) rule.requireAuth = requireAuth\n const requireFeatures = readStringArrayPropertyInitializer(metadataLiteral, 'requireFeatures')\n if (requireFeatures && requireFeatures.length > 0) rule.requireFeatures = requireFeatures\n const requireRoles = readStringArrayPropertyInitializer(metadataLiteral, 'requireRoles')\n if (requireRoles && requireRoles.length > 0) rule.requireRoles = requireRoles\n return rule\n}\n\nfunction parseApiRouteEntry(entryLiteral: ts.ObjectLiteralExpression): ModuleApiRouteFact | null {\n const routePath = readStringPropertyInitializer(entryLiteral, 'path')\n if (!routePath) return null\n\n const methods: string[] = []\n const seenMethods = new Set<string>()\n const handlersInitializer = getObjectPropertyInitializer(entryLiteral, 'handlers')\n if (handlersInitializer && ts.isObjectLiteralExpression(handlersInitializer)) {\n for (const property of handlersInitializer.properties) {\n const methodName = getPropertyName(property)\n if (methodName && !seenMethods.has(methodName)) {\n seenMethods.add(methodName)\n methods.push(methodName)\n }\n }\n } else {\n const singleMethod = readStringPropertyInitializer(entryLiteral, 'method')\n if (singleMethod && !seenMethods.has(singleMethod)) {\n seenMethods.add(singleMethod)\n methods.push(singleMethod)\n }\n }\n\n const auth: Record<string, ApiRouteAuthRule> = {}\n const metadataInitializer = getObjectPropertyInitializer(entryLiteral, 'metadata')\n if (metadataInitializer && ts.isObjectLiteralExpression(metadataInitializer)) {\n for (const property of metadataInitializer.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const methodName = getPropertyName(property)\n if (!methodName) continue\n const methodMetadata = unwrapExpression(property.initializer)\n if (!ts.isObjectLiteralExpression(methodMetadata)) continue\n auth[methodName] = parseApiRouteAuthRule(methodMetadata)\n if (!seenMethods.has(methodName)) {\n seenMethods.add(methodName)\n methods.push(methodName)\n }\n }\n }\n\n return { path: routePath, methods, auth, sourcePath: null }\n}\n\nfunction extractApiRoutes(\n moduleId: string,\n registrySource: string | null,\n registryDescription: string,\n routeSourcePaths: ReadonlyMap<string, string>,\n warnings: string[],\n): ModuleApiRouteFact[] {\n if (registrySource == null) {\n warnings.push(`[module-facts] module registry unavailable (${registryDescription}); API route auth omitted for ${moduleId}`)\n return []\n }\n\n const sourceFile = ts.createSourceFile(\n 'module-registry.generated.ts',\n registrySource,\n ts.ScriptTarget.ES2020,\n true,\n ts.ScriptKind.TS,\n )\n\n const routes: ModuleApiRouteFact[] = []\n const seenPaths = new Set<string>()\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node) && readStringPropertyInitializer(node, 'id') === moduleId) {\n const apisInitializer = getObjectPropertyInitializer(node, 'apis')\n const apisArray = apisInitializer ? unwrapArrayLiteral(apisInitializer) : null\n if (apisArray) {\n for (const element of apisArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const route = parseApiRouteEntry(element)\n if (route && !seenPaths.has(route.path)) {\n seenPaths.add(route.path)\n routes.push({ ...route, sourcePath: routeSourcePaths.get(route.path) ?? null })\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return routes\n}\n\nfunction resolveRegistrySource(options: ExtractModuleFactsOptions): { source: string | null; description: string } {\n if (typeof options.registrySource === 'string') {\n return { source: options.registrySource, description: 'registrySource' }\n }\n if (options.registryPath) {\n if (!fs.existsSync(options.registryPath)) {\n return { source: null, description: options.registryPath }\n }\n return { source: fs.readFileSync(options.registryPath, 'utf8'), description: options.registryPath }\n }\n return { source: null, description: 'registryPath not provided' }\n}\n\nfunction detectAwilixRegistrationKind(expression: ts.Expression): string | null {\n let current: ts.Expression = unwrapExpression(expression)\n while (ts.isCallExpression(current)) {\n const callee = current.expression\n if (ts.isIdentifier(callee)) return callee.text\n if (ts.isPropertyAccessExpression(callee)) {\n current = callee.expression\n continue\n }\n break\n }\n return null\n}\n\nfunction extractDiTokens(diFilePath: string | null): string[] {\n if (!diFilePath) return []\n const sourceFile = readSourceFile(diFilePath)\n if (!sourceFile) return []\n\n const tokens: string[] = []\n const seen = new Set<string>()\n const visit = (node: ts.Node): void => {\n if (\n ts.isCallExpression(node) &&\n ts.isPropertyAccessExpression(node.expression) &&\n node.expression.name.text === 'register'\n ) {\n const argument = node.arguments[0]\n if (argument && ts.isObjectLiteralExpression(argument)) {\n for (const property of argument.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const kind = detectAwilixRegistrationKind(property.initializer)\n if (kind !== 'asFunction' && kind !== 'asClass') continue\n const tokenName = getPropertyName(property)\n if (tokenName && !seen.has(tokenName)) {\n seen.add(tokenName)\n tokens.push(tokenName)\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return tokens\n}\n\nfunction extractSearchEntities(searchFilePath: string | null, warnings: string[]): string[] {\n if (!searchFilePath) return []\n const sourceFile = readSourceFile(searchFilePath)\n if (!sourceFile) return []\n\n const searchConfig = findObjectLiteralDeclaration(sourceFile, 'searchConfig')\n if (!searchConfig) {\n warnings.push(`[module-facts] search.ts present but no searchConfig object literal: ${searchFilePath}`)\n return []\n }\n const entitiesInitializer = getObjectPropertyInitializer(searchConfig, 'entities')\n const entitiesArray = entitiesInitializer ? unwrapArrayLiteral(entitiesInitializer) : null\n if (!entitiesArray) {\n warnings.push(`[module-facts] searchConfig.entities is not an array literal: ${searchFilePath}`)\n return []\n }\n\n // `entityId` is rarely a bare string literal: modules reference the entity through\n // `E.<module>.<entity>` or a same-file `const ENTITY_ID`. Reading only string literals\n // dropped every such entry with NO diagnostic, so a module shipping `search.ts` scored\n // zero search facts while looking healthy. Unresolvable entries now warn instead.\n const initializers = buildVariableInitializerMap(sourceFile)\n const entityIds: string[] = []\n const seen = new Set<string>()\n for (const element of entitiesArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const initializer = getObjectPropertyInitializer(element, 'entityId')\n const location = `${searchFilePath}:${nodeLine(sourceFile, element)}`\n if (!initializer) {\n warnings.push(`[module-facts] searchConfig entity declares no entityId: ${location}`)\n continue\n }\n const entityId = resolveEntityIdReference(initializer, initializers)\n if (!entityId) {\n warnings.push(`[module-facts] searchConfig entityId is not statically resolvable: ${location}`)\n continue\n }\n if (seen.has(entityId)) continue\n seen.add(entityId)\n entityIds.push(entityId)\n }\n return entityIds\n}\n\nfunction extractNotifications(notificationsFilePath: string | null, warnings: string[]): string[] {\n if (!notificationsFilePath) return []\n const sourceFile = readSourceFile(notificationsFilePath)\n if (!sourceFile) return []\n\n const notificationsArray =\n findArrayLiteralDeclaration(sourceFile, 'notificationTypes') ??\n findArrayLiteralDeclaration(sourceFile, 'notifications')\n if (!notificationsArray) {\n warnings.push(`[module-facts] notifications.ts present but no notificationTypes array literal: ${notificationsFilePath}`)\n return []\n }\n\n const notificationIds: string[] = []\n const seen = new Set<string>()\n for (const element of notificationsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const notificationId = readStringPropertyInitializer(element, 'type')\n if (notificationId && !seen.has(notificationId)) {\n seen.add(notificationId)\n notificationIds.push(notificationId)\n }\n }\n return notificationIds\n}\n\nfunction extractCli(cliFilePath: string | null, warnings: string[]): string[] {\n if (!cliFilePath) return []\n const sourceFile = readSourceFile(cliFilePath)\n if (!sourceFile) return []\n\n const defaultExport = findDefaultExportExpression(sourceFile)\n if (!defaultExport) {\n warnings.push(`[module-facts] cli.ts present but no default export: ${cliFilePath}`)\n return []\n }\n\n const initializers = buildVariableInitializerMap(sourceFile)\n const collectCommand = (objectLiteral: ts.ObjectLiteralExpression): string | undefined =>\n readStringPropertyInitializer(objectLiteral, 'command')\n\n const commands: string[] = []\n const seen = new Set<string>()\n const pushCommand = (command: string | undefined): void => {\n if (command && !seen.has(command)) {\n seen.add(command)\n commands.push(command)\n }\n }\n\n const arrayLiteral = resolveToArrayLiteral(defaultExport, initializers)\n if (arrayLiteral) {\n for (const element of arrayLiteral.elements) {\n const objectLiteral = resolveToObjectLiteral(element, initializers)\n if (objectLiteral) pushCommand(collectCommand(objectLiteral))\n }\n return commands\n }\n\n const singleObject = resolveToObjectLiteral(defaultExport, initializers)\n if (singleObject) {\n pushCommand(collectCommand(singleObject))\n return commands\n }\n\n warnings.push(`[module-facts] cli.ts default export is neither an array nor an object literal: ${cliFilePath}`)\n return commands\n}\n\nfunction listSourceFilesRecursive(directory: string): string[] {\n const files: string[] = []\n for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {\n if (entry.name === '__tests__' || entry.name === '__mocks__' || entry.name === 'node_modules') continue\n const fullPath = path.join(directory, entry.name)\n if (entry.isDirectory()) {\n files.push(...listSourceFilesRecursive(fullPath))\n } else if (\n /\\.tsx?$/.test(entry.name)\n && !entry.name.endsWith('.d.ts')\n && !/\\.(?:test|spec)\\.tsx?$/.test(entry.name)\n ) {\n files.push(fullPath)\n }\n }\n return files\n}\n\nfunction toPortableSourceRoot(moduleId: string, sourcePackage: string | null): string {\n return path.posix.join('node_modules', sourcePackage ?? '@open-mercato/core', 'src', 'modules', moduleId)\n}\n\n/**\n * An explicit portable root must stay app-root-relative and POSIX-shaped: every emitted\n * fact path and markdown link is resolved against the generated app root, so an absolute\n * path, a Windows separator, or a traversal segment would emit an unclickable or\n * machine-specific reference into a distributed artifact.\n */\nexport function assertPortableSourceRoot(moduleId: string, portableSourceRoot: string): string {\n const invalid = portableSourceRoot.length === 0\n || path.posix.isAbsolute(portableSourceRoot)\n || /^[A-Za-z]:/.test(portableSourceRoot)\n || portableSourceRoot.includes('\\\\')\n || portableSourceRoot.split('/').includes('..')\n if (invalid) {\n throw new Error(\n `[module-facts] portableSourceRoot for module \"${moduleId}\" must be a relative POSIX app path, received \"${portableSourceRoot}\"`,\n )\n }\n return portableSourceRoot\n}\n\nfunction toPortableSourcePath(moduleRoot: string, sourceRoot: string, filePath: string): string {\n const relativePath = path.relative(moduleRoot, filePath).split(path.sep).join('/')\n return path.posix.join(sourceRoot, relativePath)\n}\n\nfunction sourceHasDefaultExport(sourceFile: ts.SourceFile): boolean {\n return sourceFile.statements.some((statement) => {\n if (ts.isExportAssignment(statement) && !statement.isExportEquals) return true\n if (!ts.isFunctionDeclaration(statement) && !ts.isClassDeclaration(statement)) return false\n return statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword) ?? false\n })\n}\n\nfunction readRouteMetadataPath(sourceFile: ts.SourceFile): string | null {\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n return metadata ? readStringPropertyInitializer(metadata, 'path') ?? null : null\n}\n\nfunction extractApiRouteSourcePaths(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n): Map<string, string> {\n const apiRoot = path.join(moduleRoot, 'api')\n const sources = new Map<string, string>()\n if (!fs.existsSync(apiRoot)) return sources\n const methodDirectories = new Set(['get', 'post', 'put', 'patch', 'delete'])\n\n for (const filePath of listSourceFilesRecursive(apiRoot)) {\n const relativePath = path.relative(apiRoot, filePath).split(path.sep).join('/')\n const segments = relativePath.split('/')\n const fileName = segments.pop() as string\n const fileStem = fileName.replace(/\\.tsx?$/, '')\n let routeSegments: string[]\n if (fileStem === 'route') {\n routeSegments = segments\n } else if (segments[0] && methodDirectories.has(segments[0].toLowerCase())) {\n routeSegments = [...segments.slice(1), fileStem]\n } else {\n routeSegments = [...segments, fileStem]\n }\n const defaultPath = `/${[moduleId, ...routeSegments].filter(Boolean).join('/')}`\n const sourceFile = readSourceFile(filePath)\n const routePath = sourceFile ? readRouteMetadataPath(sourceFile) ?? defaultPath : defaultPath\n sources.set(routePath, toPortableSourcePath(moduleRoot, sourceRoot, filePath))\n }\n return sources\n}\n\nfunction extractModulePages(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n surface: 'backend' | 'frontend',\n): ModulePageFact[] {\n const pageRoot = path.join(moduleRoot, surface)\n if (!fs.existsSync(pageRoot)) return []\n const pages: ModulePageFact[] = []\n const seen = new Set<string>()\n\n for (const filePath of listSourceFilesRecursive(pageRoot)) {\n if (!filePath.endsWith('.tsx')) continue\n const relativePath = path.relative(pageRoot, filePath).split(path.sep).join('/')\n const segments = relativePath.split('/')\n const fileName = segments.pop() as string\n const fileStem = fileName.replace(/\\.tsx$/, '')\n const isModernPage = fileStem === 'page'\n if (!isModernPage && (fileStem === 'meta' || fileStem.endsWith('.meta') || /^[A-Z]/.test(fileStem))) continue\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile || !sourceHasDefaultExport(sourceFile)) continue\n const routeSegments = isModernPage ? segments : [...segments, fileStem]\n const routePath = surface === 'frontend'\n ? `/${routeSegments.filter(Boolean).join('/')}`\n : isModernPage\n ? `/backend/${routeSegments.join('/') || moduleId}`\n : `/backend/${routeSegments[0] === moduleId\n ? routeSegments.filter(Boolean).join('/')\n : [moduleId, ...routeSegments].filter(Boolean).join('/')}`\n if (seen.has(routePath)) continue\n seen.add(routePath)\n const metadataFilePath = resolvePageMetadataFile(path.dirname(filePath))\n const metadataSourceFile = metadataFilePath ? readSourceFile(metadataFilePath) : sourceFile\n const metadata = metadataSourceFile ? readPageMetadata(metadataSourceFile) : undefined\n pages.push({\n path: routePath,\n sourcePath: toPortableSourcePath(moduleRoot, sourceRoot, filePath),\n ...(metadataFilePath\n ? { metadataSourcePath: toPortableSourcePath(moduleRoot, sourceRoot, metadataFilePath) }\n : {}),\n ...(metadata ? { metadata } : {}),\n })\n }\n return pages.sort((left, right) => left.path.localeCompare(right.path))\n}\n\nfunction findAncestorVariableDeclaration(node: ts.Node): ts.VariableDeclaration | null {\n let current: ts.Node | undefined = node.parent\n while (current) {\n if (ts.isVariableDeclaration(current)) return current\n current = current.parent\n }\n return null\n}\n\nfunction findAncestorCallExpression(node: ts.Node): ts.CallExpression | null {\n let current: ts.Node | undefined = node.parent\n while (current) {\n if (ts.isCallExpression(current)) return current\n if (ts.isVariableDeclaration(current) || ts.isStatement(current)) return null\n current = current.parent\n }\n return null\n}\n\nfunction extractNamedAiFacts(\n filePaths: readonly string[],\n moduleRoot: string,\n sourceRoot: string,\n propertyName: 'name' | 'id',\n): Array<{ value: string; sourcePath: string }> {\n const facts: Array<{ value: string; sourcePath: string }> = []\n const seen = new Set<string>()\n for (const filePath of filePaths) {\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const initializers = buildVariableInitializerMap(sourceFile)\n const readDefinitionValue = (objectLiteral: ts.ObjectLiteralExpression): string | undefined => {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n const resolved = unwrapExpression(initializer)\n if (ts.isStringLiteralLike(resolved)) return resolved.text\n if (ts.isIdentifier(resolved)) {\n const declarationInitializer = initializers.get(resolved.text)\n if (declarationInitializer) {\n const declarationValue = unwrapExpression(declarationInitializer)\n if (ts.isStringLiteralLike(declarationValue)) return declarationValue.text\n }\n }\n return undefined\n }\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node)) {\n const value = readDefinitionValue(node)\n if (value && !seen.has(value)) {\n const declaration = findAncestorVariableDeclaration(node)\n const declarationName = declaration && ts.isIdentifier(declaration.name) ? declaration.name.text : ''\n const declarationType = declaration?.type?.getText(sourceFile) ?? ''\n const call = findAncestorCallExpression(node)\n const callee = call?.expression.getText(sourceFile) ?? ''\n const isDefinition = propertyName === 'name'\n ? /AiTool/.test(declarationType) || /tool$/i.test(declarationName) || /AiTool/.test(callee)\n : /AiAgentDefinition/.test(declarationType) || /agent$/i.test(declarationName) || /defineAiAgent/.test(callee)\n if (isDefinition) {\n seen.add(value)\n facts.push({\n value,\n sourcePath: toPortableSourcePath(moduleRoot, sourceRoot, filePath),\n })\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n }\n return facts.sort((left, right) => left.value.localeCompare(right.value))\n}\n\nfunction extractAiTools(moduleRoot: string, sourceRoot: string): ModuleAiToolFact[] {\n const files = new Set<string>()\n const rootFile = resolveConventionFile(moduleRoot, 'ai-tools')\n if (rootFile) files.add(rootFile)\n const toolsDirectory = path.join(moduleRoot, 'ai-tools')\n if (fs.existsSync(toolsDirectory)) {\n for (const filePath of listSourceFilesRecursive(toolsDirectory)) files.add(filePath)\n }\n return extractNamedAiFacts([...files], moduleRoot, sourceRoot, 'name')\n .map((fact) => ({ name: fact.value, sourcePath: fact.sourcePath }))\n}\n\nfunction extractAiAgents(moduleRoot: string, sourceRoot: string): ModuleAiAgentFact[] {\n const agentsFile = resolveConventionFile(moduleRoot, 'ai-agents')\n if (!agentsFile) return []\n return extractNamedAiFacts([agentsFile], moduleRoot, sourceRoot, 'id')\n .map((fact) => ({ id: fact.value, sourcePath: fact.sourcePath }))\n}\n\nfunction extractTableIds(moduleRoot: string): string[] {\n if (!fs.existsSync(moduleRoot)) return []\n\n const tableIds: string[] = []\n const seen = new Set<string>()\n const collectLiteralValues = (expression: ts.Expression): string[] => {\n const current = unwrapExpression(expression)\n if (ts.isStringLiteralLike(current)) return [current.text]\n if (ts.isConditionalExpression(current)) {\n return [\n ...collectLiteralValues(current.whenTrue),\n ...collectLiteralValues(current.whenFalse),\n ]\n }\n return []\n }\n\n for (const filePath of listSourceFilesRecursive(moduleRoot)) {\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node)) {\n const propertyName = getPropertyName(node)\n if (propertyName === 'tableId' || propertyName === 'extensionTableId') {\n for (const value of collectLiteralValues(node.initializer)) {\n if (value && !seen.has(value)) {\n seen.add(value)\n tableIds.push(value)\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n }\n tableIds.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))\n return tableIds\n}\n\nfunction extractHostEntityIds(entities: ModuleEntityFact[]): string[] {\n return entities.filter((entity) => entity.id.endsWith('_entity')).map((entity) => entity.id)\n}\n\nfunction extractModuleMeta(indexFilePath: string | null): { title: string | null; description: string | null } {\n if (!indexFilePath) return { title: null, description: null }\n const sourceFile = readSourceFile(indexFilePath)\n if (!sourceFile) return { title: null, description: null }\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) return { title: null, description: null }\n return {\n title: readStringPropertyInitializer(metadata, 'title') ?? null,\n description: readStringPropertyInitializer(metadata, 'description') ?? null,\n }\n}\n\nfunction nodeLine(sourceFile: ts.SourceFile, node: ts.Node): number {\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1\n}\n\nfunction readPropertyNameText(name: ts.PropertyName): string | undefined {\n if (ts.isIdentifier(name) || ts.isStringLiteralLike(name)) return name.text\n return undefined\n}\n\nfunction readMethodBearingPropertyNames(objectLiteral: ts.ObjectLiteralExpression): string[] {\n const names: string[] = []\n for (const property of objectLiteral.properties) {\n if (ts.isMethodDeclaration(property)) {\n const name = readPropertyNameText(property.name)\n if (name) names.push(name)\n continue\n }\n if (ts.isPropertyAssignment(property)) {\n const name = readPropertyNameText(property.name)\n if (!name) continue\n const initializer = unwrapExpression(property.initializer)\n if (ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer)) names.push(name)\n }\n }\n return names.sort((left, right) => left.localeCompare(right))\n}\n\nfunction readObjectKeyNames(objectLiteral: ts.ObjectLiteralExpression): string[] {\n const names: string[] = []\n for (const property of objectLiteral.properties) {\n const name = getPropertyName(property)\n if (name) names.push(name)\n }\n return names.sort((left, right) => left.localeCompare(right))\n}\n\nfunction mapDiRegistrationKind(base: string | null): ModuleDiRegistrationFact['registrationKind'] | null {\n switch (base) {\n case 'asFunction':\n return 'function'\n case 'asClass':\n return 'class'\n case 'asValue':\n return 'value'\n case 'aliasTo':\n return 'alias'\n default:\n return null\n }\n}\n\nfunction readDiChainMetadata(initializer: ts.Expression): {\n lifetime?: ModuleDiRegistrationFact['lifetime']\n injectionMode?: ModuleDiRegistrationFact['injectionMode']\n} {\n const result: {\n lifetime?: ModuleDiRegistrationFact['lifetime']\n injectionMode?: ModuleDiRegistrationFact['injectionMode']\n } = {}\n let current: ts.Expression = unwrapExpression(initializer)\n while (ts.isCallExpression(current) && ts.isPropertyAccessExpression(current.expression)) {\n const method = current.expression.name.text\n if ((method === 'singleton' || method === 'scoped' || method === 'transient') && !result.lifetime) {\n result.lifetime = method\n } else if (method === 'proxy' && !result.injectionMode) {\n result.injectionMode = 'proxy'\n } else if (method === 'classic' && !result.injectionMode) {\n result.injectionMode = 'classic'\n }\n current = unwrapExpression(current.expression.expression)\n }\n return result\n}\n\nfunction readDiProviderSymbol(\n initializer: ts.Expression,\n kind: ModuleDiRegistrationFact['registrationKind'],\n): string | undefined {\n let current: ts.Expression = unwrapExpression(initializer)\n while (ts.isCallExpression(current) && ts.isPropertyAccessExpression(current.expression)) {\n current = unwrapExpression(current.expression.expression)\n }\n if (!ts.isCallExpression(current)) return undefined\n const argument = current.arguments[0]\n if (!argument) return undefined\n if (kind === 'value') return undefined\n if (kind === 'alias' && ts.isStringLiteralLike(argument)) return argument.text\n if ((kind === 'function' || kind === 'class') && ts.isIdentifier(argument)) return argument.text\n return undefined\n}\n\nfunction extractDiRegistrationFacts(\n diFilePath: string | null,\n sourcePath: string,\n): { facts: ModuleDiRegistrationFact[]; unresolvedTokens: string[] } {\n if (!diFilePath) return { facts: [], unresolvedTokens: [] }\n const sourceFile = readSourceFile(diFilePath)\n if (!sourceFile) return { facts: [], unresolvedTokens: [] }\n\n const facts: ModuleDiRegistrationFact[] = []\n const unresolvedTokens: string[] = []\n const visit = (node: ts.Node): void => {\n if (\n ts.isCallExpression(node) &&\n ts.isPropertyAccessExpression(node.expression) &&\n node.expression.name.text === 'register'\n ) {\n const argument = node.arguments[0]\n if (argument && ts.isObjectLiteralExpression(argument)) {\n for (const property of argument.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const token = getPropertyName(property)\n if (!token) continue\n const kind = mapDiRegistrationKind(detectAwilixRegistrationKind(property.initializer))\n if (!kind) {\n if (!unresolvedTokens.includes(token)) unresolvedTokens.push(token)\n continue\n }\n const chain = readDiChainMetadata(property.initializer)\n const providerSymbol = readDiProviderSymbol(property.initializer, kind)\n facts.push({\n token,\n registrationKind: kind,\n ...(providerSymbol ? { providerSymbol } : {}),\n ...(chain.lifetime ? { lifetime: chain.lifetime } : {}),\n ...(chain.injectionMode ? { injectionMode: chain.injectionMode } : {}),\n source: { sourcePath, exportName: token, line: nodeLine(sourceFile, property) },\n })\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return { facts, unresolvedTokens }\n}\n\nfunction deriveLegacyDiTokens(facts: readonly ModuleDiRegistrationFact[]): string[] {\n const tokens: string[] = []\n const seen = new Set<string>()\n for (const fact of facts) {\n if (fact.registrationKind !== 'function' && fact.registrationKind !== 'class') continue\n if (seen.has(fact.token)) continue\n seen.add(fact.token)\n tokens.push(fact.token)\n }\n return tokens\n}\n\nfunction dedupeOwnedContractFacts(facts: readonly ModuleOwnedContractFact[]): ModuleOwnedContractFact[] {\n const byId = new Map<string, ModuleOwnedContractFact>()\n for (const fact of facts) {\n const existing = byId.get(fact.id)\n if (!existing) {\n byId.set(fact.id, fact)\n continue\n }\n if (fact.source.sourcePath.localeCompare(existing.source.sourcePath) < 0) byId.set(fact.id, fact)\n }\n return [...byId.values()].sort((left, right) => left.id.localeCompare(right.id))\n}\n\nconst PAGE_CONTEXT_VALUES = new Set(['main', 'admin', 'settings', 'profile'])\n\nfunction readAliasedStringProperty(\n metadata: ts.ObjectLiteralExpression,\n preferred: string,\n fallback: string,\n): string | undefined {\n return readStringPropertyInitializer(metadata, preferred) ?? readStringPropertyInitializer(metadata, fallback)\n}\n\nfunction readNumericProperty(metadata: ts.ObjectLiteralExpression, propertyName: string): number | undefined {\n const initializer = getObjectPropertyInitializer(metadata, propertyName)\n if (!initializer || !ts.isNumericLiteral(initializer)) return undefined\n return Number(initializer.text)\n}\n\nfunction readPageMetadata(sourceFile: ts.SourceFile): ModulePageMetadata | undefined {\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) return undefined\n const result: ModulePageMetadata = {}\n const requireAuth = readBooleanPropertyInitializer(metadata, 'requireAuth')\n if (requireAuth !== undefined) result.requireAuth = requireAuth\n const requireCustomerAuth = readBooleanPropertyInitializer(metadata, 'requireCustomerAuth')\n if (requireCustomerAuth !== undefined) result.requireCustomerAuth = requireCustomerAuth\n const requireFeatures = readStringArrayPropertyInitializer(metadata, 'requireFeatures')\n if (requireFeatures && requireFeatures.length > 0) result.requireFeatures = requireFeatures\n const requireCustomerFeatures = readStringArrayPropertyInitializer(metadata, 'requireCustomerFeatures')\n if (requireCustomerFeatures && requireCustomerFeatures.length > 0) {\n result.requireCustomerFeatures = requireCustomerFeatures\n }\n const navHidden = readBooleanPropertyInitializer(metadata, 'navHidden')\n if (navHidden !== undefined) result.navHidden = navHidden\n const navGroup = readAliasedStringProperty(metadata, 'pageGroup', 'group')\n if (navGroup) result.navGroup = navGroup\n const navGroupKey = readAliasedStringProperty(metadata, 'pageGroupKey', 'groupKey')\n if (navGroupKey) result.navGroupKey = navGroupKey\n const navOrder = readNumericProperty(metadata, 'pageOrder') ?? readNumericProperty(metadata, 'order')\n if (navOrder !== undefined) result.navOrder = navOrder\n const pageContext = readStringPropertyInitializer(metadata, 'pageContext')\n if (pageContext && PAGE_CONTEXT_VALUES.has(pageContext)) {\n result.pageContext = pageContext as ModulePageMetadata['pageContext']\n }\n return Object.keys(result).length > 0 ? result : undefined\n}\n\n/**\n * Mirrors the runtime companion-file convention: a page's metadata comes from\n * `page.meta.*` (or `meta.*`) in the page directory when one exists, and only\n * otherwise from the page component itself.\n */\nfunction resolvePageMetadataFile(pageDirectory: string): string | null {\n for (const baseName of ['page.meta', 'meta']) {\n for (const extension of MODULE_CODE_EXTENSIONS) {\n const candidate = path.join(pageDirectory, `${baseName}${extension}`)\n if (fs.existsSync(candidate)) return candidate\n }\n }\n return null\n}\n\nfunction extractModuleMetadataContract(\n indexFilePath: string | null,\n moduleId: string,\n sourcePath: string | null,\n): ModuleOwnedContractFact | null {\n if (!indexFilePath || !sourcePath) return null\n const sourceFile = readSourceFile(indexFilePath)\n if (!sourceFile) return null\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) return null\n const facts: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n const name = readStringPropertyInitializer(metadata, 'name')\n if (name) facts.name = name\n const version = readStringPropertyInitializer(metadata, 'version')\n if (version) facts.version = version\n const requires = readStringArrayPropertyInitializer(metadata, 'requires')\n if (requires && requires.length > 0) facts.requires = requires\n const ejectable = readBooleanPropertyInitializer(metadata, 'ejectable')\n if (ejectable !== undefined) facts.ejectable = ejectable\n return {\n kind: 'module-metadata',\n id: moduleId,\n source: { sourcePath, exportName: 'metadata', line: nodeLine(sourceFile, metadata) },\n ...(Object.keys(facts).length > 0 ? { metadata: facts } : {}),\n }\n}\n\nfunction extractCommandContractCandidates(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n): Array<{ id: string; sourcePath: string }> {\n const commandsRoot = path.join(moduleRoot, 'commands')\n if (!fs.existsSync(commandsRoot)) return []\n const candidates: Array<{ id: string; sourcePath: string }> = []\n for (const filePath of listSourceFilesRecursive(commandsRoot)) {\n if (path.basename(filePath).replace(/\\.tsx?$/, '') === 'interceptors') continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n for (const id of extractCommandIdsFromSource(filePath)) candidates.push({ id, sourcePath })\n }\n return candidates\n}\n\n/**\n * Runtime worker id: `metadata.id` when declared, otherwise the path-derived\n * `<moduleId>:workers:<...segments>:<fileStem>` that `discoverWorkers` builds.\n */\nfunction deriveWorkerId(moduleId: string, workersRoot: string, filePath: string): string {\n const relativePath = path.relative(workersRoot, filePath).split(path.sep).join('/')\n const segments = relativePath.split('/')\n const fileName = segments.pop() as string\n const fileStem = fileName.replace(/\\.tsx?$/, '')\n return [moduleId, 'workers', ...segments, fileStem].filter(Boolean).join(':')\n}\n\n/** Resolves a string property directly or through a local `const` in the same file. */\nfunction readResolvedStringProperty(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n initializers: Map<string, ts.Expression>,\n): string | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n const resolved = unwrapExpression(initializer)\n if (ts.isStringLiteralLike(resolved)) return resolved.text\n if (ts.isIdentifier(resolved)) {\n const declaration = initializers.get(resolved.text)\n if (declaration) {\n const declarationValue = unwrapExpression(declaration)\n if (ts.isStringLiteralLike(declarationValue)) return declarationValue.text\n }\n }\n return undefined\n}\n\nfunction readImportedStringIdentifier(\n sourceFile: ts.SourceFile,\n sourcePath: string,\n identifier: string,\n): string | undefined {\n for (const statement of sourceFile.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteralLike(statement.moduleSpecifier)) continue\n const importClause = statement.importClause\n const bindings = importClause?.namedBindings\n if (!bindings || !ts.isNamedImports(bindings)) continue\n const imported = bindings.elements.find((element) => element.name.text === identifier)\n if (!imported) continue\n const request = statement.moduleSpecifier.text\n if (!request.startsWith('.')) return undefined\n const basePath = path.resolve(path.dirname(sourcePath), request)\n const candidates = [\n `${basePath}.ts`,\n `${basePath}.tsx`,\n path.join(basePath, 'index.ts'),\n path.join(basePath, 'index.tsx'),\n ]\n const importedPath = candidates.find((candidate) => fs.existsSync(candidate))\n if (!importedPath) return undefined\n const importedSource = readSourceFile(importedPath)\n if (!importedSource) return undefined\n const exportName = imported.propertyName?.text ?? imported.name.text\n const declaration = importedSource.statements\n .filter(ts.isVariableStatement)\n .flatMap((variable) => [...variable.declarationList.declarations])\n .find((candidate) => ts.isIdentifier(candidate.name) && candidate.name.text === exportName)\n const initializer = declaration?.initializer ? unwrapExpression(declaration.initializer) : null\n return initializer && ts.isStringLiteralLike(initializer) ? initializer.text : undefined\n }\n return undefined\n}\n\nfunction extractWorkerContracts(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n): { facts: ModuleOwnedContractFact[]; unresolved: ModuleFactDiagnostic[] } {\n const workersRoot = path.join(moduleRoot, 'workers')\n if (!fs.existsSync(workersRoot)) return { facts: [], unresolved: [] }\n const facts: ModuleOwnedContractFact[] = []\n const unresolved: ModuleFactDiagnostic[] = []\n for (const filePath of listSourceFilesRecursive(workersRoot)) {\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const source = { sourcePath, exportName: 'metadata', line: nodeLine(sourceFile, metadata) }\n const initializers = buildVariableInitializerMap(sourceFile)\n const workerId = readResolvedStringProperty(metadata, 'id', initializers)\n ?? deriveWorkerId(moduleId, workersRoot, filePath)\n\n // Runtime skips any worker without a queue, so a worker missing the required\n // property is not a contract; a present-but-dynamic queue is reported instead.\n const hasQueueProperty = getObjectPropertyInitializer(metadata, 'queue') !== undefined\n const queueInitializer = getObjectPropertyInitializer(metadata, 'queue')\n const queue = readResolvedStringProperty(metadata, 'queue', initializers)\n ?? (queueInitializer && ts.isIdentifier(unwrapExpression(queueInitializer))\n ? readImportedStringIdentifier(sourceFile, filePath, (unwrapExpression(queueInitializer) as ts.Identifier).text)\n : undefined)\n if (!hasQueueProperty) {\n unresolved.push({ code: 'unresolved-static-contract', kind: 'worker', id: workerId, source })\n continue\n }\n\n const workerMetadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n if (queue) workerMetadata.queue = queue\n else unresolved.push({ code: 'unresolved-static-contract', kind: 'worker', id: workerId, source })\n const name = readResolvedStringProperty(metadata, 'name', initializers)\n if (name) workerMetadata.name = name\n const concurrencyInitializer = getObjectPropertyInitializer(metadata, 'concurrency')\n if (concurrencyInitializer && ts.isNumericLiteral(concurrencyInitializer)) {\n workerMetadata.concurrency = Number(concurrencyInitializer.text)\n }\n facts.push({\n kind: 'worker',\n id: workerId,\n source,\n ...(Object.keys(workerMetadata).length > 0 ? { metadata: workerMetadata } : {}),\n })\n }\n return { facts: dedupeOwnedContractFacts(facts), unresolved }\n}\n\nfunction extractPageMiddlewareContracts(\n moduleRoot: string,\n sourceRoot: string,\n): { facts: ModuleOwnedContractFact[]; unresolved: ModuleFactDiagnostic[] } {\n const facts: ModuleOwnedContractFact[] = []\n const unresolved: ModuleFactDiagnostic[] = []\n for (const surface of ['backend', 'frontend'] as const) {\n const filePath = resolveConventionFile(path.join(moduleRoot, surface), 'middleware')\n if (!filePath) continue\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const middlewareArray =\n findArrayLiteralDeclaration(sourceFile, 'middleware') ??\n (() => {\n const defaultExport = findDefaultExportExpression(sourceFile)\n return defaultExport ? unwrapArrayLiteral(defaultExport) : null\n })()\n if (!middlewareArray) continue\n let index = 0\n for (const element of middlewareArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const middlewareId = readStringPropertyInitializer(element, 'id')\n if (!middlewareId) {\n unresolved.push({\n code: 'unresolved-static-contract',\n kind: 'page-middleware',\n id: `${sourcePath}#${index}`,\n source: { sourcePath, line: nodeLine(sourceFile, element) },\n })\n index += 1\n continue\n }\n const metadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = { surface }\n const mode = readStringPropertyInitializer(element, 'mode')\n if (mode) metadata.mode = mode\n const priorityInitializer = getObjectPropertyInitializer(element, 'priority')\n if (priorityInitializer && ts.isNumericLiteral(priorityInitializer)) {\n metadata.priority = Number(priorityInitializer.text)\n }\n facts.push({\n kind: 'page-middleware',\n id: middlewareId,\n source: { sourcePath, exportName: 'middleware', line: nodeLine(sourceFile, element) },\n metadata,\n })\n index += 1\n }\n }\n return { facts: dedupeOwnedContractFacts(facts), unresolved }\n}\n\nfunction extractSetupContract(\n moduleId: string,\n setupFilePath: string | null,\n sourcePath: string | null,\n): ModuleOwnedContractFact | null {\n if (!setupFilePath || !sourcePath) return null\n const sourceFile = readSourceFile(setupFilePath)\n if (!sourceFile) return null\n const setupObject =\n findObjectLiteralDeclaration(sourceFile, 'setup') ??\n (() => {\n const defaultExport = findDefaultExportExpression(sourceFile)\n if (!defaultExport) return null\n const unwrapped = unwrapExpression(defaultExport)\n return ts.isObjectLiteralExpression(unwrapped) ? unwrapped : null\n })()\n if (!setupObject) return null\n const hooks = readMethodBearingPropertyNames(setupObject)\n const metadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n if (hooks.length > 0) metadata.hooks = hooks\n const roleFeatures = getObjectPropertyInitializer(setupObject, 'defaultRoleFeatures')\n if (roleFeatures && ts.isObjectLiteralExpression(roleFeatures)) {\n const roles = readObjectKeyNames(roleFeatures)\n if (roles.length > 0) metadata.roles = roles\n }\n const customerRoleFeatures = getObjectPropertyInitializer(setupObject, 'defaultCustomerRoleFeatures')\n if (customerRoleFeatures && ts.isObjectLiteralExpression(customerRoleFeatures)) {\n const customerRoles = readObjectKeyNames(customerRoleFeatures)\n if (customerRoles.length > 0) metadata.customerRoles = customerRoles\n }\n return {\n kind: 'setup',\n id: `${moduleId}:setup`,\n source: { sourcePath, exportName: 'setup', line: nodeLine(sourceFile, setupObject) },\n ...(Object.keys(metadata).length > 0 ? { metadata } : {}),\n }\n}\n\nfunction extractEncryptionContracts(\n encryptionFilePath: string | null,\n sourcePath: string | null,\n): ModuleOwnedContractFact[] {\n if (!encryptionFilePath || !sourcePath) return []\n const sourceFile = readSourceFile(encryptionFilePath)\n if (!sourceFile) return []\n const mapsArray =\n findArrayLiteralDeclaration(sourceFile, 'defaultEncryptionMaps') ??\n findArrayLiteralDeclaration(sourceFile, 'encryptionMaps')\n if (!mapsArray) return []\n const facts: ModuleOwnedContractFact[] = []\n for (const element of mapsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const entityId = readStringPropertyInitializer(element, 'entityId')\n if (!entityId) continue\n const fieldsInitializer = getObjectPropertyInitializer(element, 'fields')\n const fields: string[] = []\n if (fieldsInitializer) {\n const fieldsArray = unwrapArrayLiteral(fieldsInitializer)\n if (fieldsArray) {\n for (const fieldElement of fieldsArray.elements) {\n if (!ts.isObjectLiteralExpression(fieldElement)) continue\n const field = readStringPropertyInitializer(fieldElement, 'field')\n if (field) fields.push(field)\n }\n }\n }\n facts.push({\n kind: 'encryption',\n id: entityId,\n source: { sourcePath, exportName: 'defaultEncryptionMaps', line: nodeLine(sourceFile, element) },\n ...(fields.length > 0 ? { metadata: { fields: fields.sort((left, right) => left.localeCompare(right)) } } : {}),\n })\n }\n return dedupeOwnedContractFacts(facts)\n}\n\nfunction extractCustomEntityContracts(\n ceFilePath: string | null,\n sourcePath: string | null,\n): ModuleOwnedContractFact[] {\n if (!ceFilePath || !sourcePath) return []\n const entityIds = [...collectCustomFieldEntityIds(ceFilePath)].sort((left, right) => left.localeCompare(right))\n return entityIds.map((id) => ({\n kind: 'custom-entity' as const,\n id,\n source: { sourcePath, exportName: 'default' },\n }))\n}\n\n/**\n * Keyed AI override exports. Agent *extensions* (`aiAgentExtensions`) patch an agent\n * additively and belong to the `ai.extensions` array; these two replace or disable an\n * entry by key and map to exact `ai.agents.<id>` / `ai.tools.<id>` override targets.\n */\nconst AI_OVERRIDE_EXPORTS = [\n { exportName: 'aiAgentOverrides', target: 'agent' },\n { exportName: 'aiToolOverrides', target: 'tool' },\n] as const\n\nfunction extractAiExtensionContracts(\n moduleRoot: string,\n sourceRoot: string,\n): ModuleOwnedContractFact[] {\n const facts: ModuleOwnedContractFact[] = []\n const sources: Array<{ basename: string; relativeDir: string }> = [\n { basename: 'ai-agents', relativeDir: '.' },\n { basename: 'ai-tools', relativeDir: '.' },\n { basename: 'ai-agents.extensions', relativeDir: '.' },\n { basename: 'ai-tools.extensions', relativeDir: '.' },\n ]\n for (const entry of sources) {\n const filePath = resolveConventionFile(path.join(moduleRoot, entry.relativeDir), entry.basename)\n if (!filePath) continue\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const extensionsArray = findArrayLiteralDeclaration(sourceFile, 'aiAgentExtensions')\n if (extensionsArray) {\n for (const element of extensionsArray.elements) {\n const objectLiteral = ts.isObjectLiteralExpression(element)\n ? element\n : ts.isCallExpression(element) && element.arguments[0] && ts.isObjectLiteralExpression(element.arguments[0])\n ? element.arguments[0]\n : null\n if (!objectLiteral) continue\n const targetAgentId = readStringPropertyInitializer(objectLiteral, 'targetAgentId')\n if (!targetAgentId) continue\n facts.push({\n kind: 'ai-extension',\n id: `agent-extension:${targetAgentId}`,\n source: { sourcePath, exportName: 'aiAgentExtensions', line: nodeLine(sourceFile, objectLiteral) },\n metadata: { target: 'agent', mode: 'extension', targetAgentId },\n })\n }\n }\n // `aiAgentOverrides` / `aiToolOverrides` are keyed replace-or-disable maps; only\n // their keys are contract facts. Values (agent/tool definitions, `null` disables)\n // are never read or serialized.\n for (const { exportName, target } of AI_OVERRIDE_EXPORTS) {\n const overridesObject = findObjectLiteralDeclaration(sourceFile, exportName)\n if (!overridesObject) continue\n for (const property of overridesObject.properties) {\n const overrideId = getPropertyName(property)\n if (!overrideId) continue\n facts.push({\n kind: 'ai-extension',\n id: `${target}-override:${overrideId}`,\n source: { sourcePath, exportName, line: nodeLine(sourceFile, property) },\n metadata: { target, mode: 'override', overrideKey: overrideId },\n })\n }\n }\n }\n return dedupeOwnedContractFacts(facts)\n}\n\nfunction extractGeneratorPluginContracts(\n moduleRoot: string,\n sourceRoot: string,\n): { facts: ModuleOwnedContractFact[]; unresolved: ModuleFactDiagnostic[] } {\n const filePath = resolveConventionFile(moduleRoot, 'generators')\n if (!filePath) return { facts: [], unresolved: [] }\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) return { facts: [], unresolved: [] }\n const pluginsArray = findArrayLiteralDeclaration(sourceFile, 'generatorPlugins')\n if (!pluginsArray) return { facts: [], unresolved: [] }\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const initializers = buildVariableInitializerMap(sourceFile)\n const facts: ModuleOwnedContractFact[] = []\n const unresolved: ModuleFactDiagnostic[] = []\n let index = 0\n for (const element of pluginsArray.elements) {\n const objectLiteral = resolveToObjectLiteral(element, initializers)\n if (!objectLiteral) {\n index += 1\n continue\n }\n const pluginId = readStringPropertyInitializer(objectLiteral, 'id')\n if (!pluginId) {\n unresolved.push({\n code: 'unresolved-static-contract',\n kind: 'generator-plugin',\n id: `${sourcePath}#${index}`,\n source: { sourcePath, exportName: 'generatorPlugins', line: nodeLine(sourceFile, objectLiteral) },\n })\n index += 1\n continue\n }\n const metadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n const conventionFile = readStringPropertyInitializer(objectLiteral, 'conventionFile')\n if (conventionFile) metadata.conventionFile = conventionFile\n const outputFileName = readStringPropertyInitializer(objectLiteral, 'outputFileName')\n if (outputFileName) metadata.outputFileName = outputFileName\n facts.push({\n kind: 'generator-plugin',\n id: pluginId,\n source: { sourcePath, exportName: 'generatorPlugins', line: nodeLine(sourceFile, objectLiteral) },\n ...(Object.keys(metadata).length > 0 ? { metadata } : {}),\n })\n index += 1\n }\n return { facts: dedupeOwnedContractFacts(facts), unresolved }\n}\n\nfunction compareSourceRefs(left: ModuleFactSourceRef, right: ModuleFactSourceRef): number {\n return (\n left.sourcePath.localeCompare(right.sourcePath) ||\n (left.line ?? 0) - (right.line ?? 0) ||\n (left.exportName ?? '').localeCompare(right.exportName ?? '')\n )\n}\n\nfunction sameSourceRef(left: ModuleFactSourceRef, right: ModuleFactSourceRef): boolean {\n return (\n left.sourcePath === right.sourcePath &&\n (left.line ?? null) === (right.line ?? null) &&\n (left.exportName ?? null) === (right.exportName ?? null)\n )\n}\n\n// Every proven `(kind, id)` reaches `factSources`. Facts whose declaration site is already\n// serialized inline (pages, CLI commands, routes, AI tools/agents, reused contributions) and\n// the owned families (which carry `source` inside `ownedContracts`) are emitted as a typed\n// `factRef` pointer instead of a duplicated source ref, so the index stays uniform without\n// copying provenance payloads past the determinism byte guard. Duplicate detection runs over\n// ALL candidates regardless of which projection they take.\ntype ProvenanceCandidate = {\n kind: ModuleFactSourceKind\n id: string\n source?: ModuleFactSourceRef\n factRef?: ModuleFactRef\n}\n\nfunction provenanceCandidateOrderKey(candidate: ProvenanceCandidate): string {\n if (candidate.source) {\n return JSON.stringify([\n 0,\n candidate.source.sourcePath,\n candidate.source.line ?? 0,\n candidate.source.exportName ?? '',\n ])\n }\n return JSON.stringify([1, candidate.factRef?.factSection ?? '', candidate.factRef?.factKey ?? ''])\n}\n\nfunction buildProvenanceIndex(candidates: readonly ProvenanceCandidate[]): {\n factSources: ModuleFactSourceEntry[]\n diagnostics: ModuleFactDiagnostic[]\n} {\n const grouped = new Map<string, ProvenanceCandidate[]>()\n for (const candidate of candidates) {\n const key = JSON.stringify([candidate.kind, candidate.id])\n const group = grouped.get(key) ?? []\n group.push(candidate)\n grouped.set(key, group)\n }\n // Keep the provenance index compact: sourcePath is the provenance and (kind,id) the\n // stable identity, so exportName and line (recoverable from source) are dropped here.\n // Owned families retain the richer source ref inside `ownedContracts`.\n const factSources: ModuleFactSourceEntry[] = []\n const diagnostics: ModuleFactDiagnostic[] = []\n for (const group of grouped.values()) {\n const sorted = [...group].sort(\n (left, right) => provenanceCandidateOrderKey(left).localeCompare(provenanceCandidateOrderKey(right)),\n )\n const canonical = sorted[0]\n factSources.push(\n canonical.factRef\n ? {\n kind: canonical.kind,\n id: canonical.id,\n factRef: {\n factSection: canonical.factRef.factSection,\n ...(canonical.factRef.factKey === canonical.id\n ? {}\n : { factKey: canonical.factRef.factKey }),\n },\n }\n : {\n kind: canonical.kind,\n id: canonical.id,\n source: { sourcePath: (canonical.source as ModuleFactSourceRef).sourcePath },\n },\n )\n const canonicalKey = provenanceCandidateOrderKey(canonical)\n for (const rejected of sorted.slice(1)) {\n if (provenanceCandidateOrderKey(rejected) === canonicalKey) continue\n diagnostics.push({\n code: 'duplicate-source',\n kind: rejected.kind,\n id: rejected.id,\n ...(rejected.source ? { source: rejected.source } : {}),\n })\n }\n }\n factSources.sort(\n (left, right) => left.kind.localeCompare(right.kind) || left.id.localeCompare(right.id),\n )\n diagnostics.sort(\n (left, right) =>\n left.code.localeCompare(right.code) ||\n left.kind.localeCompare(right.kind) ||\n left.id.localeCompare(right.id) ||\n compareSourceRefs(left.source ?? { sourcePath: '' }, right.source ?? { sourcePath: '' }),\n )\n return { factSources, diagnostics }\n}\n\nfunction buildOwnedContracts(\n families: ReadonlyArray<[ModuleOwnedContractKind, ModuleOwnedContractFact[]]>,\n): ModuleOwnedContracts | undefined {\n const result: ModuleOwnedContracts = {}\n for (const [kind, facts] of families) {\n if (facts.length === 0) continue\n // Drop the (constant/redundant) exportName from the emitted source ref; the line\n // anchor plus sourcePath already pin the declaration and keep the JSON compact.\n result[kind] = facts.map((fact) => ({\n ...fact,\n source: {\n sourcePath: fact.source.sourcePath,\n ...(fact.source.line ? { line: fact.source.line } : {}),\n },\n }))\n }\n return Object.keys(result).length > 0 ? result : undefined\n}\n\nconst CONTRIBUTION_KIND_TO_SOURCE_KIND: Partial<Record<string, ModuleFactSourceKind>> = {\n subscriber: 'subscriber',\n}\n\nconst REGISTRY_TO_SOURCE_KIND: Partial<Record<string, ModuleFactSourceKind>> = {\n vector: 'vector',\n integration: 'integration',\n payment: 'integration',\n shipping: 'integration',\n currency: 'integration',\n}\n\nexport function extractModuleFacts(options: ExtractModuleFactsOptions): ModuleFacts {\n const { moduleId, coreVersion = null, sourcePackage = null, sourceVersion = null } = options\n const moduleRoot = options.moduleRoot\n ?? (options.coreSrcRoot ? path.join(options.coreSrcRoot, moduleId) : null)\n if (!moduleRoot) {\n throw new Error(`[internal] extractModuleFacts requires moduleRoot or coreSrcRoot for module \"${moduleId}\"`)\n }\n const sourceRoot = options.portableSourceRoot\n ? assertPortableSourceRoot(moduleId, options.portableSourceRoot)\n : toPortableSourceRoot(moduleId, sourcePackage)\n\n const entitiesFilePath =\n resolveConventionFile(path.join(moduleRoot, 'data'), 'entities') ??\n resolveConventionFile(path.join(moduleRoot, 'db'), 'entities') ??\n resolveConventionFile(path.join(moduleRoot, 'data'), 'schema')\n const ceFilePath = resolveConventionFile(moduleRoot, 'ce')\n const eventsFilePath = resolveConventionFile(moduleRoot, 'events')\n const aclFilePath = resolveConventionFile(moduleRoot, 'acl')\n const diFilePath = resolveConventionFile(moduleRoot, 'di')\n const searchFilePath = resolveConventionFile(moduleRoot, 'search')\n const notificationsFilePath = resolveConventionFile(moduleRoot, 'notifications')\n const cliFilePath = resolveConventionFile(moduleRoot, 'cli')\n const indexFilePath = resolveConventionFile(moduleRoot, 'index')\n const setupFilePath = resolveConventionFile(moduleRoot, 'setup')\n const encryptionFilePath = resolveConventionFile(moduleRoot, 'encryption')\n\n const portableOf = (filePath: string | null): string | null =>\n filePath ? toPortableSourcePath(moduleRoot, sourceRoot, filePath) : null\n\n const warnings: string[] = []\n const { title, description } = extractModuleMeta(indexFilePath)\n const customFieldEntityIds = collectCustomFieldEntityIds(ceFilePath)\n const entities = extractEntities(moduleId, entitiesFilePath, customFieldEntityIds)\n const events = extractEvents(eventsFilePath)\n const aclFeatures = extractAclFeatures(aclFilePath)\n\n const { source: registrySource, description: registryDescription } = resolveRegistrySource(options)\n const apiRouteSourcePaths = extractApiRouteSourcePaths(moduleId, moduleRoot, sourceRoot)\n const apiRoutes = extractApiRoutes(moduleId, registrySource, registryDescription, apiRouteSourcePaths, warnings)\n const diRegistrations = extractDiRegistrationFacts(diFilePath, portableOf(diFilePath) ?? '')\n const diTokens = deriveLegacyDiTokens(diRegistrations.facts)\n for (const legacyToken of extractDiTokens(diFilePath)) {\n if (!diTokens.includes(legacyToken)) diTokens.push(legacyToken)\n }\n const searchEntities = extractSearchEntities(searchFilePath, warnings)\n const notifications = extractNotifications(notificationsFilePath, warnings)\n const cli = extractCli(cliFilePath, warnings)\n const cliCommands = cliFilePath\n ? cli.map((command) => ({\n command,\n sourcePath: toPortableSourcePath(moduleRoot, sourceRoot, cliFilePath),\n }))\n : []\n const backendPages = extractModulePages(moduleId, moduleRoot, sourceRoot, 'backend')\n const frontendPages = extractModulePages(moduleId, moduleRoot, sourceRoot, 'frontend')\n const aiTools = extractAiTools(moduleRoot, sourceRoot)\n const aiAgents = extractAiAgents(moduleRoot, sourceRoot)\n const hostTokens: ModuleHostTokens = {\n entityIds: extractHostEntityIds(entities),\n tableIds: extractTableIds(moduleRoot),\n }\n const extensionSurfaces = extractModuleExtensionFacts({\n moduleId,\n moduleRoot,\n sourceRoot,\n entities,\n events,\n apiRoutes,\n searchEntities,\n notifications,\n aiTools,\n aiAgents,\n factsContractVersion: options.factsContractVersion ?? 2,\n })\n\n const indexSourcePath = portableOf(indexFilePath)\n const diSourcePath = portableOf(diFilePath)\n const moduleMetadataFact = extractModuleMetadataContract(indexFilePath, moduleId, indexSourcePath)\n const commandCandidates = extractCommandContractCandidates(moduleId, moduleRoot, sourceRoot)\n const commandFacts = dedupeOwnedContractFacts(\n commandCandidates.map((candidate) => ({\n kind: 'command' as const,\n id: candidate.id,\n source: { sourcePath: candidate.sourcePath },\n })),\n )\n const workers = extractWorkerContracts(moduleId, moduleRoot, sourceRoot)\n const pageMiddleware = extractPageMiddlewareContracts(moduleRoot, sourceRoot)\n const setupFact = extractSetupContract(moduleId, setupFilePath, portableOf(setupFilePath))\n const encryptionFacts = extractEncryptionContracts(encryptionFilePath, portableOf(encryptionFilePath))\n const customEntityFacts = extractCustomEntityContracts(ceFilePath, portableOf(ceFilePath))\n const aiExtensionFacts = extractAiExtensionContracts(moduleRoot, sourceRoot)\n const generatorPlugins = extractGeneratorPluginContracts(moduleRoot, sourceRoot)\n const diContractFacts = dedupeOwnedContractFacts(\n diRegistrations.facts.map((fact) => ({\n kind: 'di-registration' as const,\n id: fact.token,\n source: fact.source,\n metadata: {\n registrationKind: fact.registrationKind,\n ...(fact.providerSymbol ? { providerSymbol: fact.providerSymbol } : {}),\n ...(fact.lifetime ? { lifetime: fact.lifetime } : {}),\n ...(fact.injectionMode ? { injectionMode: fact.injectionMode } : {}),\n },\n })),\n )\n\n const ownedContracts = buildOwnedContracts([\n ['module-metadata', moduleMetadataFact ? [moduleMetadataFact] : []],\n ['command', commandFacts],\n ['worker', workers.facts],\n ['page-middleware', pageMiddleware.facts],\n ['setup', setupFact ? [setupFact] : []],\n ['encryption', encryptionFacts],\n ['di-registration', diContractFacts],\n ['custom-entity', customEntityFacts],\n ['ai-extension', aiExtensionFacts],\n ['generator-plugin', generatorPlugins.facts],\n ])\n\n const provenanceCandidates: ProvenanceCandidate[] = []\n const pushSource = (kind: ModuleFactSourceKind, id: string, source: ModuleFactSourceRef): void => {\n provenanceCandidates.push({ kind, id, source })\n }\n const pushRef = (\n kind: ModuleFactSourceKind,\n id: string,\n source: ModuleFactSourceRef,\n factSection: string,\n factKey: string,\n ): void => {\n provenanceCandidates.push({ kind, id, source, factRef: { factSection, factKey } })\n }\n const pushOwnedRefs = (kind: ModuleOwnedContractKind, facts: readonly ModuleOwnedContractFact[]): void => {\n for (const fact of facts) pushRef(kind, fact.id, fact.source, `ownedContracts.${kind}`, fact.id)\n }\n if (moduleMetadataFact) {\n pushRef(\n 'module-metadata',\n moduleId,\n moduleMetadataFact.source,\n 'ownedContracts.module-metadata',\n moduleMetadataFact.id,\n )\n }\n if (entitiesFilePath) {\n const entitiesSourcePath = portableOf(entitiesFilePath) as string\n for (const entity of entities) {\n pushSource('entity', entity.id, { sourcePath: entitiesSourcePath, exportName: entity.class })\n }\n }\n if (eventsFilePath) {\n const eventsSourcePath = portableOf(eventsFilePath) as string\n for (const event of events) pushSource('event', event.id, { sourcePath: eventsSourcePath, exportName: 'events' })\n }\n if (aclFilePath) {\n const aclSourcePath = portableOf(aclFilePath) as string\n for (const feature of aclFeatures) pushSource('acl-feature', feature, { sourcePath: aclSourcePath, exportName: 'features' })\n }\n for (const route of apiRoutes) {\n if (route.sourcePath) {\n pushRef('api-route', route.path, { sourcePath: route.sourcePath }, 'apiRoutes', route.path)\n }\n }\n if (searchFilePath) {\n const searchSourcePath = portableOf(searchFilePath) as string\n for (const entityId of searchEntities) pushSource('search', entityId, { sourcePath: searchSourcePath, exportName: 'searchConfig' })\n }\n if (notificationsFilePath) {\n const notificationsSourcePath = portableOf(notificationsFilePath) as string\n for (const id of notifications) pushSource('notification', id, { sourcePath: notificationsSourcePath })\n }\n for (const command of cliCommands) {\n pushRef('cli-command', command.command, { sourcePath: command.sourcePath }, 'cliCommands', command.command)\n }\n for (const page of backendPages) {\n pushRef('backend-page', page.path, { sourcePath: page.sourcePath }, 'backendPages', page.path)\n }\n for (const page of frontendPages) {\n pushRef('frontend-page', page.path, { sourcePath: page.sourcePath }, 'frontendPages', page.path)\n }\n for (const tool of aiTools) pushRef('ai-tool', tool.name, { sourcePath: tool.sourcePath }, 'aiTools', tool.name)\n for (const agent of aiAgents) pushRef('ai-agent', agent.id, { sourcePath: agent.sourcePath }, 'aiAgents', agent.id)\n for (const candidate of commandCandidates) {\n pushRef('command', candidate.id, { sourcePath: candidate.sourcePath }, 'ownedContracts.command', candidate.id)\n }\n pushOwnedRefs('worker', workers.facts)\n pushOwnedRefs('page-middleware', pageMiddleware.facts)\n if (setupFact) pushOwnedRefs('setup', [setupFact])\n pushOwnedRefs('encryption', encryptionFacts)\n for (const fact of diRegistrations.facts) {\n pushRef('di-registration', fact.token, fact.source, 'ownedContracts.di-registration', fact.token)\n }\n pushOwnedRefs('custom-entity', customEntityFacts)\n pushOwnedRefs('ai-extension', aiExtensionFacts)\n pushOwnedRefs('generator-plugin', generatorPlugins.facts)\n const contributionRef = (contributionId: string): { factSection: string; factKey: string } => ({\n factSection: 'extensionSurfaces.contributions',\n factKey: contributionId,\n })\n for (const contribution of extensionSurfaces.contributions) {\n const contributionSource: ModuleFactSourceRef = {\n sourcePath: contribution.source.path,\n ...(contribution.source.symbol ? { exportName: contribution.source.symbol } : {}),\n }\n const ref = contributionRef(contribution.id)\n if (contribution.kind === 'subscriber') {\n pushRef('subscriber', contribution.id, contributionSource, ref.factSection, ref.factKey)\n continue\n }\n if (contribution.kind === 'specialized-registry') {\n const details = contribution.details as { registry?: string; registryId?: string }\n const sourceKind = details.registry ? REGISTRY_TO_SOURCE_KIND[details.registry] : undefined\n if (sourceKind) {\n pushRef(\n sourceKind,\n details.registryId ?? contribution.id,\n contributionSource,\n ref.factSection,\n ref.factKey,\n )\n }\n continue\n }\n const mapped = CONTRIBUTION_KIND_TO_SOURCE_KIND[contribution.kind]\n if (mapped) pushRef(mapped, contribution.id, contributionSource, ref.factSection, ref.factKey)\n }\n // extension-host / extension-contribution provenance is emitted as typed `factRef` pointers\n // rather than duplicated source refs: those facts already carry their own `source` inside\n // `extensionSurfaces.{hosts,contributions}`, and copying every declared host spot (hundreds\n // per large module) would push the shared JSON past the determinism byte guard asserted in\n // `module-facts.bc-guard.test.ts`.\n // Hosts are indexed by their registry `key`: `id` repeats across families (an entity id is\n // also an api-entity id), while `key` is unique inside a module.\n for (const host of extensionSurfaces.hosts) {\n provenanceCandidates.push({\n kind: 'extension-host',\n id: host.key,\n ...(host.source.kind === 'fact-ref' ? {} : { source: { sourcePath: host.source.path } }),\n factRef: { factSection: 'extensionSurfaces.hosts', factKey: host.key },\n })\n }\n for (const contribution of extensionSurfaces.contributions) {\n pushRef(\n 'extension-contribution',\n contribution.id,\n { sourcePath: contribution.source.path },\n 'extensionSurfaces.contributions',\n contribution.id,\n )\n }\n\n const provenance = buildProvenanceIndex(provenanceCandidates)\n const factDiagnostics = [\n ...provenance.diagnostics,\n ...workers.unresolved,\n ...pageMiddleware.unresolved,\n ...generatorPlugins.unresolved,\n ...diRegistrations.unresolvedTokens.map((token): ModuleFactDiagnostic => ({\n code: 'unresolved-static-contract',\n kind: 'di-registration',\n id: token,\n ...(diSourcePath ? { source: { sourcePath: diSourcePath, exportName: token } } : {}),\n })),\n ].sort(\n (left, right) =>\n left.code.localeCompare(right.code) ||\n left.kind.localeCompare(right.kind) ||\n left.id.localeCompare(right.id),\n )\n\n const facts: ModuleFacts = {\n module: moduleId,\n title,\n description,\n coreVersion,\n sourcePackage,\n sourceVersion,\n sourceRoot,\n ...(options.sourceKind === 'local-reference' ? { sourceKind: options.sourceKind } : {}),\n entities,\n events,\n aclFeatures,\n apiRoutes,\n diTokens,\n searchEntities,\n hostTokens,\n notifications,\n cli,\n backendPages,\n frontendPages,\n cliCommands,\n aiTools,\n aiAgents,\n extensionSurfaces,\n ...(provenance.factSources.length > 0 ? { factSources: provenance.factSources } : {}),\n ...(ownedContracts ? { ownedContracts } : {}),\n ...(factDiagnostics.length > 0 ? { factDiagnostics } : {}),\n warnings,\n }\n\n // Exact unified override targets (spec 2026-08-02-module-facts-exact-override-targets).\n // Adapters consume the fully-populated owned facts + contributions above.\n const overrides = collectModuleOverrideTargets(facts, buildFactSourceLookup(facts))\n if (overrides.overrideTargets.length > 0) facts.overrideTargets = overrides.overrideTargets\n if (overrides.overrideTargetDiagnostics.length > 0) {\n facts.overrideTargetDiagnostics = overrides.overrideTargetDiagnostics\n }\n return facts\n}\n\nexport interface ModuleFactsJsonEvent {\n id: string\n category: string | null\n entity: string | null\n clientBroadcast?: boolean\n portalBroadcast?: boolean\n}\n\nexport interface ModuleFactsJsonEntry {\n title: string | null\n description: string | null\n coreVersion: string | null\n sourcePackage: string | null\n sourceVersion: string | null\n sourceRoot: string\n /** Present only for `local-reference` projections; package sidecar entries omit it. */\n sourceKind?: ModuleFactProjectionSourceKind\n entities: ModuleEntityFact[]\n events: ModuleFactsJsonEvent[]\n aclFeatures: string[]\n apiRoutes: ModuleApiRouteFact[]\n diTokens: string[]\n searchEntities: string[]\n hostTokens: ModuleHostTokens\n notifications: string[]\n cli: string[]\n backendPages: ModulePageFact[]\n frontendPages: ModulePageFact[]\n cliCommands: ModuleCliCommandFact[]\n aiTools: ModuleAiToolFact[]\n aiAgents: ModuleAiAgentFact[]\n extensionSurfaces?: ModuleExtensionSurfaceFacts\n factSources?: ModuleFactSourceEntry[]\n ownedContracts?: ModuleOwnedContracts\n factDiagnostics?: ModuleFactDiagnostic[]\n overrideTargets?: ModuleOverrideTarget[]\n overrideTargetDiagnostics?: ModuleOverrideTargetDiagnostic[]\n}\n\nconst EMPTY_SECTION_MARKER = '_none_'\n\nfunction renderVersionStamp(\n coreVersion: string | null,\n sourcePackage: string | null,\n sourceVersion: string | null,\n): string {\n if (sourcePackage) {\n return `<!-- generated from ${sourcePackage} ${sourceVersion || '<unknown>'}; core ${coreVersion || '<unknown>'} \u2014 R1 staleness stamp -->`\n }\n const version = coreVersion && coreVersion.length > 0 ? coreVersion : '<unknown>'\n return `<!-- generated from @open-mercato/core ${version} \u2014 R1 staleness stamp -->`\n}\n\nfunction renderEntitiesSection(entities: ModuleEntityFact[], lookup: FactSourceLookup): string {\n if (entities.length === 0) return `## Entities\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Entity ID | Class | Table | Editable | CustomFields | Source |'\n const divider = '|---|---|---|---|---|---|'\n const rows = entities.map(\n (entity) =>\n `| ${entity.id} | ${entity.class} | ${entity.table} | ${entity.editable ? 'yes' : 'no'} | ${entity.customFields ? 'yes' : 'no'} | ${renderLookedUpSource(lookup, 'entity', entity.id)} |`,\n )\n return ['## Entities', '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderEventsSection(events: ModuleEventFact[], lookup: FactSourceLookup): string {\n const heading = `## Events (${events.length})`\n if (events.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| ID | Category | Entity | Browser transport | Source |'\n const divider = '|---|---|---|---|---|'\n const rows = events.map((event) => {\n const transports = [event.clientBroadcast ? 'client' : null, event.portalBroadcast ? 'portal' : null]\n .filter((value): value is string => value !== null)\n return `| ${event.id} | ${event.category ?? '\u2014'} | ${event.entity ?? '\u2014'} | ${transports.join(', ') || '\u2014'} | ${renderLookedUpSource(lookup, 'event', event.id)} |`\n })\n return [heading, '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderInlineListSection(heading: string, values: string[]): string {\n if (values.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n return `${heading}\\n\\n${values.join(' \u00B7 ')}`\n}\n\nfunction renderSourceLinkedListSection(\n heading: string,\n values: readonly string[],\n lookup: FactSourceLookup,\n kind: ModuleFactSourceKind,\n idColumnLabel: string,\n): string {\n if (values.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = values.map((value) => `| ${value} | ${renderLookedUpSource(lookup, kind, value)} |`)\n return [heading, '', `| ${idColumnLabel} | Source |`, '|---|---|', ...rows].join('\\n')\n}\n\n/**\n * A generated fact only earns a markdown link when it names an exact module code\n * file. Directory-valued provenance (the module source root, framework hosts that\n * only know their owning package folder) renders as plain text: a link to a folder\n * resolves to nothing in an editor or on the repository browser, so emitting one\n * costs a consumer a dead click instead of taking them to the declaration site.\n */\nexport function isExactSourceFilePath(sourcePath: string): boolean {\n return MODULE_CODE_EXTENSIONS.some((extension) => sourcePath.endsWith(extension))\n}\n\nfunction renderSourceLink(sourcePath: string): string {\n if (!isExactSourceFilePath(sourcePath)) return sourcePath\n return `[${sourcePath}](../../../${sourcePath})`\n}\n\nfunction renderSourceRefLink(source: ModuleFactSourceRef): string {\n const anchor = source.line ? `#L${source.line}` : ''\n const label = source.line ? `${source.sourcePath}:${source.line}` : source.sourcePath\n if (!isExactSourceFilePath(source.sourcePath)) return label\n return `[${label}](../../../${source.sourcePath}${anchor})`\n}\n\n\nfunction renderLookedUpSource(lookup: FactSourceLookup, kind: ModuleFactSourceKind, id: string): string {\n const source = lookup(kind, id)\n return source ? renderSourceRefLink(source) : '\u2014'\n}\n\nfunction renderSafeScalar(value: ModuleFactSafeScalar | ModuleFactSafeScalar[] | undefined): string {\n if (value === undefined || value === null) return '\u2014'\n if (Array.isArray(value)) return value.length > 0 ? value.map((entry) => String(entry)).join(', ') : '\u2014'\n return String(value)\n}\n\nfunction renderOwnedContractMetadata(metadata: ModuleOwnedContractFact['metadata']): string {\n if (!metadata) return '\u2014'\n const keys = Object.keys(metadata).sort((left, right) => left.localeCompare(right))\n if (keys.length === 0) return '\u2014'\n return keys.map((key) => `${key}=${renderSafeScalar(metadata[key])}`).join('; ')\n}\n\nfunction renderOwnedContractSection(\n heading: string,\n facts: readonly ModuleOwnedContractFact[] | undefined,\n): string {\n if (!facts || facts.length === 0) return ''\n const rows = facts.map(\n (fact) => `| ${fact.id} | ${renderOwnedContractMetadata(fact.metadata)} | ${renderSourceRefLink(fact.source)} |`,\n )\n return [heading, '', '| ID | Metadata | Source |', '|---|---|---|', ...rows].join('\\n')\n}\n\nfunction renderDiRegistrationsSection(facts: readonly ModuleOwnedContractFact[] | undefined): string {\n if (!facts || facts.length === 0) return ''\n const rows = facts.map((fact) => {\n const metadata = fact.metadata ?? {}\n return `| ${fact.id} | ${renderSafeScalar(metadata.registrationKind)} | ${renderSafeScalar(metadata.lifetime)} | ${renderSafeScalar(metadata.injectionMode)} | ${renderSafeScalar(metadata.providerSymbol)} | ${renderSourceRefLink(fact.source)} |`\n })\n return [\n '## DI registrations (rich)',\n '',\n '| Token | Kind | Lifetime | Injection | Provider | Source |',\n '|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction describeAuthRule(rule: ApiRouteAuthRule | undefined): string {\n if (!rule) return 'public'\n if (rule.requireFeatures && rule.requireFeatures.length > 0) return rule.requireFeatures.join(', ')\n if (rule.requireRoles && rule.requireRoles.length > 0) return rule.requireRoles.join(', ')\n if (rule.requireAuth) return 'auth'\n return 'public'\n}\n\nfunction renderApiRouteAuthCell(route: ModuleApiRouteFact): string {\n if (route.methods.length === 0) return '\u2014'\n const groups: Array<{ label: string; methods: string[] }> = []\n for (const method of route.methods) {\n const label = describeAuthRule(route.auth[method])\n const existing = groups.find((group) => group.label === label)\n if (existing) existing.methods.push(method)\n else groups.push({ label, methods: [method] })\n }\n return groups.map((group) => `${group.methods.join('/')} \u2192 ${group.label}`).join(' \u00B7 ')\n}\n\nfunction renderApiRoutesSection(routes: ModuleApiRouteFact[]): string {\n if (routes.length === 0) return `## API routes\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Path | Methods | Auth (per-method requireFeatures) | Source |'\n const divider = '|---|---|---|---|'\n const rows = routes.map(\n (route) => `| ${route.path} | ${route.methods.join(' ')} | ${renderApiRouteAuthCell(route)} | ${route.sourcePath ? renderSourceLink(route.sourcePath) : '\u2014'} |`,\n )\n return ['## API routes', '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderLinkedFactsSection(\n heading: string,\n facts: ReadonlyArray<{ label: string; sourcePath: string }>,\n): string {\n if (facts.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = facts.map((fact) => `| ${fact.label} | ${renderSourceLink(fact.sourcePath)} |`)\n return [heading, '', '| ID / path | Source |', '|---|---|', ...rows].join('\\n')\n}\n\nfunction renderHostTokensSection(hostTokens: ModuleHostTokens): string {\n const entityIdsLine = hostTokens.entityIds.length > 0 ? hostTokens.entityIds.join(' \u00B7 ') : EMPTY_SECTION_MARKER\n const tableIdsLine = hostTokens.tableIds.length > 0 ? hostTokens.tableIds.join(' \u00B7 ') : EMPTY_SECTION_MARKER\n return ['## Host extension points', '', `- Entity IDs: ${entityIdsLine}`, `- Table IDs: ${tableIdsLine}`].join('\\n')\n}\n\nfunction renderExtensionHostContext(host: ModuleExtensionSurfaceFacts['hosts'][number]): string {\n return host.contextContract ?? host.runtimeContract ?? host.scopeContract ?? '\u2014'\n}\n\nfunction renderExtensionHostSource(host: ModuleExtensionHostFact): string {\n if (host.source.kind === 'fact-ref') return `${host.source.factSection}:${host.source.factKey}`\n return renderSourceRefLink({ sourcePath: host.source.path })\n}\n\nfunction renderExtensionHostsSection(extensionSurfaces: ModuleExtensionSurfaceFacts): string {\n const boundHosts = extensionSurfaces.hosts.filter((host) => host.bound)\n if (boundHosts.length === 0) return `## UMES hosts\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = boundHosts.map((host) =>\n `| ${host.id} | ${host.family} | ${host.capabilities.join(', ') || '\u2014'} | ${renderExtensionHostContext(host)} | ${host.stability.toUpperCase()} | ${renderExtensionHostSource(host)} |`,\n )\n return [\n '## UMES hosts',\n '',\n '| ID / pattern | Family | Supports | Context | Stability | Source |',\n '|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction compactContributionDetails(contribution: ModuleExtensionContributionFact): string {\n const details = contribution.details as unknown as Record<string, unknown>\n return Object.keys(details).sort((left, right) => left.localeCompare(right)).flatMap((key) => {\n const value = details[key]\n if (value === undefined) return []\n if (Array.isArray(value)) return [`${key}=${value.join(',') || 'none'}`]\n if (value && typeof value === 'object') {\n const nested = Object.keys(value as Record<string, unknown>).sort((left, right) => left.localeCompare(right)).map((nestedKey) => {\n const nestedValue = (value as Record<string, unknown>)[nestedKey]\n return `${nestedKey}:${Array.isArray(nestedValue) ? nestedValue.join(',') : String(nestedValue)}`\n })\n return [`${key}={${nested.join(';')}}`]\n }\n return [`${key}=${String(value)}`]\n }).join('; ')\n}\n\nfunction renderExtensionContributionsSection(extensionSurfaces: ModuleExtensionSurfaceFacts): string {\n if (extensionSurfaces.contributions.length === 0) return `## UMES contributions\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = extensionSurfaces.contributions.map((contribution) => {\n const targets = contribution.targets.map((entry) => entry.id).join(', ')\n const resolution = contribution.targets.map((entry) => entry.resolution).join(', ')\n const phases = [...(contribution.phases ?? []), ...(contribution.operations ?? [])].join(', ') || '\u2014'\n const source = renderSourceRefLink({ sourcePath: contribution.source.path })\n return `| ${contribution.id} | ${contribution.kind} | ${targets || '\u2014'} | ${phases} | ${compactContributionDetails(contribution)} | ${resolution || '\u2014'} | ${source} |`\n })\n return [\n '## UMES contributions',\n '',\n '| ID | Kind | Target | Phase / operations | Contract | Resolution | Source |',\n '|---|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderExtensionDiagnosticsSection(extensionSurfaces: ModuleExtensionSurfaceFacts): string {\n const unbound = extensionSurfaces.hosts.filter((host) => !host.bound)\n if (unbound.length === 0 && extensionSurfaces.unresolved.length === 0) return ''\n const diagnostics = [\n ...unbound.map((host) => `- unbound-helper: ${host.id}`),\n ...extensionSurfaces.unresolved.map((entry) => `- ${entry.reason}: ${entry.key} (${entry.source.path})`),\n ]\n return ['## UMES diagnostics', '', ...diagnostics].join('\\n')\n}\n\nfunction renderExtensionTargetRef(target: ModuleExtensionTargetRef): string {\n const method = target.method ? ` ${target.method}` : ''\n const owner = target.moduleId ? ` @${target.moduleId}` : ''\n return `${target.kind}:${target.id}${method}${owner}`\n}\n\nfunction renderActivationBindingsSection(extensionSurfaces: ModuleExtensionSurfaceFacts): string {\n const activations = extensionSurfaces.activations ?? []\n if (activations.length === 0) return `## Active extension bindings\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = activations.map((activation) => {\n const phases = activation.phases && activation.phases.length > 0 ? activation.phases.join(', ') : '\u2014'\n const source = activation.source ? renderSourceRefLink(activation.source) : '\u2014'\n const bridge = activation.bridge ? `${activation.bridge.factSection}:${activation.bridge.factKey}` : '\u2014'\n return `| ${activation.id} | ${activation.kind} | ${renderExtensionTargetRef(activation.host)} | ${activation.contributionKinds.join(', ') || '\u2014'} | ${phases} | ${bridge} | ${source} |`\n })\n return [\n '## Active extension bindings',\n '',\n '| Activation | Kind | Host | Contribution kinds | Phases | Bridge | Source |',\n '|---|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderIncomingContributionsSection(extensionSurfaces: ModuleExtensionSurfaceFacts): string {\n const incoming = extensionSurfaces.incoming ?? []\n if (incoming.length === 0) return `## Incoming installed contributions\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = incoming.map((entry) => {\n const activation = entry.activationId ?? '\u2014'\n const source = entry.source ? renderSourceRefLink(entry.source) : '\u2014'\n return `| ${entry.contributorModuleId} | ${entry.contributionKind} | ${renderExtensionTargetRef(entry.target)} | ${entry.resolution} | ${activation} | ${entry.contributionId} \u00B7 ${source} |`\n })\n return [\n '## Incoming installed contributions',\n '',\n '| Contributor | Kind | Target | Resolution | Activation | Contribution \u00B7 Source |',\n '|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderContributionResolutionsSection(\n extensionSurfaces: ModuleExtensionSurfaceFacts,\n lookup: FactSourceLookup,\n): string {\n const resolutions = extensionSurfaces.contributionResolutions ?? []\n if (resolutions.length === 0) return `## Contribution resolutions\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = resolutions.map((resolution) => {\n const activations = resolution.activationIds.length > 0 ? resolution.activationIds.join(', ') : '\u2014'\n const source = renderLookedUpSource(lookup, 'extension-contribution', resolution.contributionId)\n return `| ${resolution.contributionId} | ${renderExtensionTargetRef(resolution.target)} | ${resolution.resolution} | ${activations} | ${source} |`\n })\n return [\n '## Contribution resolutions',\n '',\n '| Contribution | Target | Resolution | Activations | Source |',\n '|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderOverrideTargetPath(target: ModuleOverrideTarget): string {\n let display = 'overrides'\n for (let index = 0; index < target.path.length; index += 1) {\n const segment = target.path[index]\n const isKeyedTerminal = target.key !== undefined && index === target.path.length - 1\n display += isKeyedTerminal ? `[${JSON.stringify(segment)}]` : `.${segment}`\n }\n return display\n}\n\nfunction renderOverrideTargetsSection(targets: readonly ModuleOverrideTarget[] | undefined): string {\n if (!targets || targets.length === 0) return `## Exact override targets\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Domain | Path / key | Supported modes | Referenced fact | Source |'\n const divider = '|---|---|---|---|---|'\n const rows = targets.map((target) => {\n const path = `\\`${renderOverrideTargetPath(target)}\\``\n const modes = target.modes.join(', ') || '\u2014'\n const fact = `${target.factRef.factSection}:${target.factRef.factKey}`\n return `| ${target.domain} | ${path} | ${modes} | ${fact} | ${renderSourceRefLink(target.source)} |`\n })\n return ['## Exact override targets', '', header, divider, ...rows].join('\\n')\n}\n\nexport interface ReferenceProjectionFingerprints {\n sourceFingerprint: string\n taxonomyFingerprint: string\n}\n\n/**\n * Header for a `local-reference` projection. It never claims a package version \u2014 the\n * module is app-local \u2014 and it states in the document itself that the activations and\n * exact override targets below describe behavior only after the module is opted in,\n * because the artifact is generated while the module is disabled.\n */\nfunction renderReferenceProjectionHeader(\n facts: ModuleFacts,\n fingerprints: ReferenceProjectionFingerprints,\n): string[] {\n return [\n `# ${facts.module} \u2014 module facts (generated reference projection, do not edit)`,\n `<!-- generated from local reference ${facts.sourceRoot}; source-fingerprint ${fingerprints.sourceFingerprint}; taxonomy-fingerprint ${fingerprints.taxonomyFingerprint} \u2014 R1 staleness stamp -->`,\n `> Reference projection: \\`${facts.module}\\` is not selected by the current runtime. Its activations and exact override targets describe behavior only after opt-in in \\`src/modules.ts\\`.`,\n `Source root: ${renderSourceLink(facts.sourceRoot)}`,\n ]\n}\n\nexport function renderModuleFactsMarkdown(\n facts: ModuleFacts,\n referenceProjection?: ReferenceProjectionFingerprints,\n): string {\n const extensionSurfaces = facts.extensionSurfaces ?? { hosts: [], contributions: [], unresolved: [] }\n const lookup = buildFactSourceLookup(facts)\n const header = facts.sourceKind === 'local-reference' && referenceProjection\n ? renderReferenceProjectionHeader(facts, referenceProjection)\n : [\n `# ${facts.module} \u2014 module facts (generated, do not edit)`,\n renderVersionStamp(facts.coreVersion, facts.sourcePackage, facts.sourceVersion),\n `Source root: ${renderSourceLink(facts.sourceRoot)}`,\n ]\n const sections = [\n ...header,\n '',\n renderEntitiesSection(facts.entities, lookup),\n '',\n renderEventsSection(facts.events, lookup),\n '',\n renderSourceLinkedListSection(\n `## ACL features (${facts.aclFeatures.length})`,\n facts.aclFeatures,\n lookup,\n 'acl-feature',\n 'Feature',\n ),\n '',\n renderApiRoutesSection(facts.apiRoutes),\n '',\n renderLinkedFactsSection('## Backend pages', facts.backendPages.map((page) => ({ label: page.path, sourcePath: page.sourcePath }))),\n '',\n renderLinkedFactsSection('## Frontend pages', facts.frontendPages.map((page) => ({ label: page.path, sourcePath: page.sourcePath }))),\n '',\n renderSourceLinkedListSection('## DI service tokens', facts.diTokens, lookup, 'di-registration', 'Token'),\n '',\n renderSourceLinkedListSection('## Search entities', facts.searchEntities, lookup, 'search', 'Entity ID'),\n '',\n renderHostTokensSection(facts.hostTokens),\n '',\n renderExtensionHostsSection(extensionSurfaces),\n '',\n renderExtensionContributionsSection(extensionSurfaces),\n '',\n renderActivationBindingsSection(extensionSurfaces),\n '',\n renderIncomingContributionsSection(extensionSurfaces),\n '',\n renderContributionResolutionsSection(extensionSurfaces, lookup),\n '',\n renderExtensionDiagnosticsSection(extensionSurfaces),\n '',\n renderSourceLinkedListSection('## Notifications', facts.notifications, lookup, 'notification', 'Notification ID'),\n '',\n renderLinkedFactsSection('## CLI commands', facts.cliCommands.map((command) => ({ label: command.command, sourcePath: command.sourcePath }))),\n '',\n renderLinkedFactsSection('## AI tools / MCP capabilities', facts.aiTools.map((tool) => ({ label: tool.name, sourcePath: tool.sourcePath }))),\n '',\n renderLinkedFactsSection('## AI agents', facts.aiAgents.map((agent) => ({ label: agent.id, sourcePath: agent.sourcePath }))),\n '',\n renderOverrideTargetsSection(facts.overrideTargets),\n '',\n ]\n const owned = facts.ownedContracts ?? {}\n const ownedSections = [\n renderOwnedContractSection('## Owned contract \u2014 module metadata', owned['module-metadata']),\n renderOwnedContractSection('## Domain commands', owned.command),\n renderOwnedContractSection('## Workers', owned.worker),\n renderOwnedContractSection('## Page middleware', owned['page-middleware']),\n renderOwnedContractSection('## Setup', owned.setup),\n renderOwnedContractSection('## Encryption', owned.encryption),\n renderDiRegistrationsSection(owned['di-registration']),\n renderOwnedContractSection('## Custom entities', owned['custom-entity']),\n renderOwnedContractSection('## AI extensions', owned['ai-extension']),\n renderOwnedContractSection('## Generator plugins', owned['generator-plugin']),\n ].filter((section) => section.length > 0)\n for (const section of ownedSections) {\n sections.push(section, '')\n }\n return sections.join('\\n')\n}\n\nexport function toModuleFactsJsonEntry(facts: ModuleFacts): ModuleFactsJsonEntry {\n return {\n title: facts.title,\n description: facts.description,\n coreVersion: facts.coreVersion,\n sourcePackage: facts.sourcePackage,\n sourceVersion: facts.sourceVersion,\n sourceRoot: facts.sourceRoot,\n ...(facts.sourceKind === 'local-reference' ? { sourceKind: facts.sourceKind } : {}),\n entities: facts.entities,\n events: facts.events.map((event) => ({\n id: event.id,\n category: event.category,\n entity: event.entity,\n ...(event.clientBroadcast !== undefined ? { clientBroadcast: event.clientBroadcast } : {}),\n ...(event.portalBroadcast !== undefined ? { portalBroadcast: event.portalBroadcast } : {}),\n })),\n aclFeatures: facts.aclFeatures,\n apiRoutes: facts.apiRoutes,\n diTokens: facts.diTokens,\n searchEntities: facts.searchEntities,\n hostTokens: facts.hostTokens,\n notifications: facts.notifications,\n cli: facts.cli,\n backendPages: facts.backendPages,\n frontendPages: facts.frontendPages,\n cliCommands: facts.cliCommands,\n aiTools: facts.aiTools,\n aiAgents: facts.aiAgents,\n ...(facts.extensionSurfaces ? { extensionSurfaces: facts.extensionSurfaces } : {}),\n ...(facts.factSources && facts.factSources.length > 0 ? { factSources: facts.factSources } : {}),\n ...(facts.ownedContracts && Object.keys(facts.ownedContracts).length > 0\n ? { ownedContracts: facts.ownedContracts }\n : {}),\n ...(facts.factDiagnostics && facts.factDiagnostics.length > 0\n ? { factDiagnostics: facts.factDiagnostics }\n : {}),\n ...(facts.overrideTargets && facts.overrideTargets.length > 0\n ? { overrideTargets: facts.overrideTargets }\n : {}),\n ...(facts.overrideTargetDiagnostics && facts.overrideTargetDiagnostics.length > 0\n ? { overrideTargetDiagnostics: facts.overrideTargetDiagnostics }\n : {}),\n }\n}\n\nexport function buildModuleFactsJsonObject(\n factsByModule: Record<string, ModuleFacts>,\n): Record<string, ModuleFactsJsonEntry> {\n const result: Record<string, ModuleFactsJsonEntry> = {}\n for (const moduleId of Object.keys(factsByModule).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))) {\n result[moduleId] = toModuleFactsJsonEntry(factsByModule[moduleId])\n }\n return result\n}\n\nexport function renderModuleFactsJson(factsByModule: Record<string, ModuleFacts>): string {\n return `${JSON.stringify(buildModuleFactsJsonObject(factsByModule), null, 2)}\\n`\n}\n\n/**\n * The normal package sidecar (`module-facts.json`) and the enabled-filtered package\n * markdown subset carry package-provided modules only. An app-local module reaching\n * either output would publish `bound` activations and exact override targets for code\n * the runtime does not select, so it fails the build instead of shipping.\n */\nexport function assertPackageModuleFactsOnly(factsByModule: Record<string, ModuleFacts>): void {\n const offenders = Object.values(factsByModule)\n .filter((facts) => facts.sourceKind === 'local-reference' || !facts.sourceRoot.startsWith('node_modules/'))\n .map((facts) => `${facts.module} (${facts.sourceRoot})`)\n .sort((left, right) => left.localeCompare(right))\n if (offenders.length > 0) {\n throw new Error(\n `[module-facts] normal package output must not contain app-local modules: ${offenders.join(', ')}`,\n )\n }\n}\n\nfunction sha256Hex(value: string | Buffer): string {\n return createHash('sha256').update(value).digest('hex')\n}\n\n/**\n * Canonical form used by both reference fingerprints: object keys are recursively sorted\n * and set-valued arrays are sorted by their own canonical text. Structured `path` arrays\n * are ordered tuples whose segment order is part of the public target identity, so they\n * retain their declared order.\n */\nfunction canonicalizeFingerprintValue(value: unknown, propertyName?: string): unknown {\n if (Array.isArray(value)) {\n const items = value\n .map((item) => {\n const canonical = canonicalizeFingerprintValue(item)\n return { canonical, text: JSON.stringify(canonical) ?? '' }\n })\n if (propertyName === 'path') return items.map((item) => item.canonical)\n return items\n .sort((left, right) => (left.text < right.text ? -1 : left.text > right.text ? 1 : 0))\n .map((item) => item.canonical)\n }\n if (value !== null && typeof value === 'object') {\n const record = value as Record<string, unknown>\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(record).sort((left, right) => (left < right ? -1 : left > right ? 1 : 0))) {\n if (record[key] === undefined) continue\n result[key] = canonicalizeFingerprintValue(record[key], key)\n }\n return result\n }\n return value\n}\n\nfunction canonicalFingerprintJson(value: unknown): string {\n return JSON.stringify(canonicalizeFingerprintValue(value))\n}\n\nconst REFERENCE_FINGERPRINT_SKIPPED_DIRECTORIES = new Set(['__tests__', '__integration__', 'node_modules'])\n\n/**\n * SHA-256 over the canonical JSON of `{ path, sha256 }` records sorted by path, where\n * `path` is the portable app-relative path so the value is identical across the\n * authoring, template, and emitted roots. Test-only directories are excluded because the\n * scaffold does not emit them, so including them would make the emitted app's recomputed\n * fingerprint disagree with the one built from the template.\n */\nexport function computeModuleSourceFingerprint(moduleRoot: string, portableSourceRoot: string): string {\n assertPortableSourceRoot(path.basename(portableSourceRoot), portableSourceRoot)\n const records: { path: string; sha256: string }[] = []\n const walk = (directory: string): void => {\n const entries = fs.readdirSync(directory, { withFileTypes: true })\n for (const entry of entries) {\n const fullPath = path.join(directory, entry.name)\n if (entry.isDirectory()) {\n if (REFERENCE_FINGERPRINT_SKIPPED_DIRECTORIES.has(entry.name)) continue\n walk(fullPath)\n continue\n }\n if (!entry.isFile()) continue\n records.push({\n path: toPortableSourcePath(moduleRoot, portableSourceRoot, fullPath),\n sha256: sha256Hex(fs.readFileSync(fullPath)),\n })\n }\n }\n walk(moduleRoot)\n records.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0))\n return sha256Hex(canonicalFingerprintJson(records))\n}\n\n/**\n * Provenance and release metadata are not taxonomy: a version bump must not invalidate\n * the classification fingerprint. Every remaining section of the emitted entry is a\n * classified set and contributes.\n */\nconst TAXONOMY_EXCLUDED_SECTIONS = new Set([\n 'title',\n 'description',\n 'coreVersion',\n 'sourcePackage',\n 'sourceVersion',\n 'sourceRoot',\n 'sourceKind',\n])\n\nfunction collectTaxonomyRecords(\n setName: string,\n value: unknown,\n records: { setName: string; value: unknown }[],\n): void {\n if (value === undefined) return\n if (Array.isArray(value)) {\n for (const item of value) records.push({ setName, value: canonicalizeFingerprintValue(item) })\n return\n }\n if (value !== null && typeof value === 'object') {\n for (const [key, child] of Object.entries(value as Record<string, unknown>)) {\n collectTaxonomyRecords(`${setName}.${key}`, child, records)\n }\n return\n }\n records.push({ setName, value })\n}\n\n/**\n * SHA-256 over the canonical JSON of `{ setName, value }` records sorted by set name and\n * canonicalized value. Each record carries a complete literal or structured entry \u2014 key,\n * suffix, capabilities, `bound`, phases, operations included \u2014 so no delimiter-joined\n * tuple can collapse two distinct classifications into one fingerprint input.\n */\nexport function computeModuleTaxonomyFingerprint(entry: ModuleFactsJsonEntry): string {\n const records: { setName: string; value: unknown }[] = []\n for (const [setName, value] of Object.entries(entry as unknown as Record<string, unknown>)) {\n if (TAXONOMY_EXCLUDED_SECTIONS.has(setName)) continue\n collectTaxonomyRecords(setName, value, records)\n }\n const decorated = records\n .map((record) => ({ record, text: JSON.stringify(record.value) ?? '' }))\n .sort((left, right) =>\n left.record.setName < right.record.setName\n ? -1\n : left.record.setName > right.record.setName\n ? 1\n : left.text < right.text\n ? -1\n : left.text > right.text\n ? 1\n : 0,\n )\n return sha256Hex(JSON.stringify(decorated.map((item) => item.record)))\n}\n\nexport interface ReferenceModuleFactsEntry {\n moduleId: string\n projectionKind: 'activated-reference'\n sourceKind: 'local-reference'\n runtimeSelected: false\n sourceFingerprint: string\n taxonomyFingerprint: string\n /**\n * The enum-derived classification of every taxonomy `facts` is expressed in, built\n * by the same generation run. It travels with the projection so a reader of the\n * emitted sheet can tell a value the example really emits from one that is only\n * reserved, pending, or reachable through a negative fixture.\n */\n factCoverage: ModuleFactCoverageFamily[]\n facts: ModuleFactsJsonEntry\n}\n\nexport type ReferenceModuleFactsJson = Record<string, ReferenceModuleFactsEntry>\n\nexport function renderReferenceModuleFactsJson(bundle: ReferenceModuleFactsJson): string {\n const ordered: ReferenceModuleFactsJson = {}\n for (const moduleId of Object.keys(bundle).sort((left, right) => (left < right ? -1 : left > right ? 1 : 0))) {\n ordered[moduleId] = bundle[moduleId]\n }\n return `${JSON.stringify(ordered, null, 2)}\\n`\n}\n\nexport interface ExtractLocalReferenceModuleFactsOptions {\n /** Package-provided sources, exactly as the normal batch receives them. */\n packageSources: readonly ModuleFactSource[]\n /** The app-local module projected into the reference bundle. */\n reference: ModuleFactSource\n registryPath?: string | null\n registrySource?: string | null\n coreVersion?: string | null\n}\n\nexport interface LocalReferenceModuleFactsResult {\n entry: ReferenceModuleFactsEntry\n markdown: string\n warnings: string[]\n /**\n * First-party targets the activated projection could not correlate. They also remain in\n * the emitted `facts.extensionSurfaces.unresolved`, so the artifact states its own gaps\n * rather than presenting a partial surface as complete.\n */\n unresolvedTargets: string[]\n}\n\n/**\n * Produces the reference projection of an app-local module from an explicitly activated,\n * disposable selection context: the local source is appended to the package sources and\n * the whole set runs through the same `extractAllModuleFacts` selection and correlation\n * batch, so incoming contributions and optional targets resolve exactly as they would\n * after opt-in. Merging an independently extracted object into a finished batch is\n * forbidden \u2014 it would silently drop both resolutions. The batch is disposable: the\n * caller keeps only this module's projection and never writes the rest, which is why the\n * normal package outputs stay byte-identical.\n */\nexport function extractLocalReferenceModuleFacts(\n options: ExtractLocalReferenceModuleFactsOptions,\n): LocalReferenceModuleFactsResult {\n const { reference } = options\n if (reference.sourceKind !== 'local-reference') {\n throw new Error(\n `[module-facts] reference source \"${reference.moduleId}\" must declare sourceKind \"local-reference\"`,\n )\n }\n const portableSourceRoot = reference.portableSourceRoot\n if (!portableSourceRoot) {\n throw new Error(`[module-facts] reference source \"${reference.moduleId}\" must declare portableSourceRoot`)\n }\n assertPortableSourceRoot(reference.moduleId, portableSourceRoot)\n\n const sources = appendLocalReferenceModuleSource(options.packageSources, reference)\n const activated = extractAllModuleFacts({\n sources,\n registryPath: options.registryPath ?? null,\n registrySource: options.registrySource ?? null,\n coreVersion: options.coreVersion ?? null,\n // The disposable projection collects rather than throws: an app-local module can name\n // a target whose classification is still missing from the shared extension reader, and\n // aborting there would delete the whole reference bundle instead of publishing the\n // exact gap. Normal package output keeps the strict default.\n unresolvedFirstPartyTargets: 'collect',\n })\n const facts = activated.factsByModule[reference.moduleId]\n if (!facts) {\n throw new Error(`[module-facts] reference module \"${reference.moduleId}\" produced no facts`)\n }\n if (facts.sourceRoot !== portableSourceRoot) {\n throw new Error(\n `[module-facts] reference module \"${reference.moduleId}\" emitted non-portable source root \"${facts.sourceRoot}\"`,\n )\n }\n\n const jsonEntry = toModuleFactsJsonEntry(facts)\n const fingerprints: ReferenceProjectionFingerprints = {\n sourceFingerprint: computeModuleSourceFingerprint(reference.moduleRoot, portableSourceRoot),\n taxonomyFingerprint: computeModuleTaxonomyFingerprint(jsonEntry),\n }\n return {\n entry: {\n moduleId: reference.moduleId,\n projectionKind: 'activated-reference',\n sourceKind: 'local-reference',\n runtimeSelected: false,\n ...fingerprints,\n factCoverage: activated.factCoverage ?? buildModuleFactCoverageLedger(),\n facts: jsonEntry,\n },\n markdown: renderModuleFactsMarkdown(facts, fingerprints),\n warnings: activated.warnings,\n unresolvedTargets: activated.unresolvedFirstPartyTargets ?? [],\n }\n}\n\nexport interface ExtractAllModuleFactsOptions {\n /**\n * Discovered module sources (auto-discovery path). When provided, each entry's\n * explicit `moduleRoot` is used and `coreSrcRoot`/`moduleIds` are ignored.\n */\n sources?: readonly ModuleFactSource[]\n /** Legacy shared-root path. Used only when `sources` is not provided. */\n coreSrcRoot?: string\n registryPath?: string | null\n registrySource?: string | null\n coreVersion?: string | null\n /** @deprecated Legacy explicit module-id list; only consulted when `sources` is absent. */\n moduleIds?: readonly string[]\n /**\n * `throw` (the default, and the only value any normal package output uses) aborts the\n * batch when a first-party extension target does not correlate. `collect` keeps the\n * unresolved entries in `extensionSurfaces.unresolved` and reports them on the result\n * so a disposable projection can publish the gap instead of silently dropping it.\n */\n unresolvedFirstPartyTargets?: 'throw' | 'collect'\n /** Generated-facts compatibility projection. Omitted means the corrected v2 contract. */\n factsContractVersion?: 1 | 2\n}\n\nexport interface ExtractAllModuleFactsResult {\n factsByModule: Record<string, ModuleFacts>\n markdownByModule: Record<string, string>\n warnings: string[]\n frameworkMarkdown: string\n /** Always empty under the default `throw` policy, which aborts before returning. */\n unresolvedFirstPartyTargets?: string[]\n /**\n * The enum-derived coverage ledger for the taxonomies these facts are expressed\n * in, built during generation so an enum value with no classification aborts the\n * run instead of shipping an unclassified public value.\n */\n factCoverage?: ModuleFactCoverageFamily[]\n}\n\n/**\n * `<moduleId>:<contributionId>:<targetId>` for every first-party contribution target that\n * did not correlate \u2014 the same identity {@link assertNoUnresolvedExtensionTargets} throws\n * with, so a collected batch reports exactly what a strict batch would have refused.\n */\nexport function collectUnresolvedFirstPartyTargets(\n surfacesByModule: Readonly<Record<string, ModuleExtensionSurfaceFacts>>,\n): string[] {\n return Object.entries(surfacesByModule)\n .flatMap(([moduleId, surface]) =>\n surface.unresolved\n .filter((entry) => entry.reason === 'unresolved-first-party-target')\n .map((entry) => `${moduleId}:${entry.key}`),\n )\n .sort((left, right) => left.localeCompare(right))\n}\n\nexport function extractAllModuleFacts(options: ExtractAllModuleFactsOptions): ExtractAllModuleFactsResult {\n return withModuleExtensionFactExtractionCache(() => extractAllModuleFactsWithCache(options))\n}\n\nfunction extractAllModuleFactsWithCache(options: ExtractAllModuleFactsOptions): ExtractAllModuleFactsResult {\n const factCoverage = buildModuleFactCoverageLedger()\n const sources: ModuleFactSource[] = options.sources\n ? [...options.sources]\n : (options.coreSrcRoot\n ? (options.moduleIds ?? []).map((moduleId) => ({\n moduleId,\n moduleRoot: path.join(options.coreSrcRoot as string, moduleId),\n }))\n : [])\n\n const factsByModule: Record<string, ModuleFacts> = {}\n const markdownByModule: Record<string, string> = {}\n const warnings: string[] = []\n for (const source of sources) {\n const facts = extractModuleFacts({\n moduleId: source.moduleId,\n moduleRoot: source.moduleRoot,\n coreVersion: options.coreVersion ?? null,\n sourcePackage: source.from ?? null,\n sourceVersion: source.packageVersion ?? null,\n registryPath: options.registryPath ?? null,\n registrySource: options.registrySource ?? null,\n ...(source.portableSourceRoot ? { portableSourceRoot: source.portableSourceRoot } : {}),\n ...(source.sourceKind ? { sourceKind: source.sourceKind } : {}),\n factsContractVersion: options.factsContractVersion ?? 2,\n })\n factsByModule[source.moduleId] = facts\n warnings.push(...facts.warnings)\n }\n const surfacesByModule = Object.fromEntries(\n Object.entries(factsByModule).map(([moduleId, facts]) => [\n moduleId,\n facts.extensionSurfaces ?? { hosts: [], contributions: [], unresolved: [] },\n ]),\n )\n const correlated = correlateModuleExtensionFacts({\n surfacesByModule,\n entityIds: new Set(Object.values(factsByModule).flatMap((facts) => facts.entities.map((entity) => entity.id))),\n eventIds: new Set(Object.values(factsByModule).flatMap((facts) => facts.events.map((event) => event.id))),\n apiRoutes: new Set([\n ...Object.values(factsByModule).flatMap((facts) => facts.apiRoutes.map((route) => route.path)),\n ...sources.flatMap((source) => extractKnownApiRouteIds(source.moduleId, source.moduleRoot)),\n ]),\n commandIds: new Set(sources.flatMap((source) => extractKnownCommandIds(source.moduleId, source.moduleRoot))),\n factsContractVersion: options.factsContractVersion ?? 2,\n })\n const unresolvedFirstPartyTargets = collectUnresolvedFirstPartyTargets(correlated)\n if ((options.unresolvedFirstPartyTargets ?? 'throw') === 'throw') assertNoUnresolvedExtensionTargets(correlated)\n const apiRouteOwners = new Map<string, {\n moduleId: string\n source: ModuleFactSourceRef\n bridges: ApiRouteInterceptorBridge[]\n }>()\n const commandOwners = new Map<string, { moduleId: string; source: ModuleFactSourceRef }>()\n for (const source of [...sources].sort((left, right) => left.moduleId.localeCompare(right.moduleId))) {\n const facts = factsByModule[source.moduleId]\n const sourceRoot = facts ? facts.sourceRoot : source.moduleId\n const owners = extractActivationTargetOwners({\n moduleId: source.moduleId,\n moduleRoot: source.moduleRoot,\n sourceRoot,\n })\n for (const route of owners.apiRoutes) {\n if (!apiRouteOwners.has(route.id)) {\n apiRouteOwners.set(route.id, { moduleId: source.moduleId, source: route.source, bridges: route.bridges })\n }\n }\n for (const command of owners.commands) {\n if (!commandOwners.has(command.id)) commandOwners.set(command.id, { moduleId: source.moduleId, source: command.source })\n }\n }\n const withIncoming = correlateIncomingExtensions({\n surfacesByModule: correlated,\n apiRouteOwners,\n commandOwners,\n })\n for (const moduleId of Object.keys(factsByModule).sort((left, right) => left.localeCompare(right))) {\n factsByModule[moduleId].extensionSurfaces = withIncoming[moduleId]\n markdownByModule[moduleId] = renderModuleFactsMarkdown(factsByModule[moduleId])\n warnings.push(...correlated[moduleId].unresolved.map((entry) =>\n `[module-facts] ${moduleId} ${entry.reason}: ${entry.key} (${entry.source.path})`,\n ))\n }\n return {\n factsByModule,\n markdownByModule,\n warnings,\n frameworkMarkdown: renderFrameworkExtensionPointsMarkdown(),\n unresolvedFirstPartyTargets,\n factCoverage,\n }\n}\n\n/**\n * Enum-derived `factCoverage` ledger \u2014 spec\n * `.ai/specs/2026-07-31-standalone-canonical-example-module.md`,\n * \u00A7 PR #4883 Module-Fact and Extension-Topology Contract.\n *\n * Every finite public set is enumerated from the `as const` ledger that also derives\n * its type, so an added enum value has no ledger row and fails\n * {@link buildModuleFactCoverageLedger} instead of joining the public surface\n * unclassified. The purpose of the ledger is to make a *silent zero* impossible: a\n * family cannot claim canonical coverage while the real extractor publishes no\n * contribution for it.\n */\nexport type ModuleFactCoverageStatus =\n /** The canonical example really emits it; a real extraction proves a non-zero count. */\n | 'emitted-example'\n /** A framework/app-level setting that never becomes a module contribution. */\n | 'framework-only'\n /** Described by the framework catalog only; the example contributes nothing for it. */\n | 'catalog-only'\n /** In the closed public set, but no generator code path emits it today. */\n | 'currently-unbound'\n /**\n * Required to be `emitted-example` by the spec but NOT emitted yet. The status\n * itself states the gap, so a machine reader keying on `status` alone is never\n * told the example emits something it does not.\n */\n | 'pending-emission'\n /** Only a deliberately broken fixture produces it; canonical output emits none. */\n | 'negative-fixture'\n\nexport type ModuleFactCoverageRow = {\n value: string\n status: ModuleFactCoverageStatus\n note: string\n /**\n * Names the slice that owns closing a `pending-emission` gap. A pending row is\n * asserted to have a *zero* real count, so it can never be mistaken for proven\n * coverage and cannot go stale once the gap closes.\n */\n pendingEmission?: string\n /**\n * Set when the value is extractable only from the generated module registry rather\n * than from module source, so a source-only extraction legitimately reports zero.\n *\n * This is the only way a row skips the non-zero proof, so the flag is proven rather\n * than trusted: `module-facts.example-fact-coverage.test.ts` asserts every row\n * carrying it counts zero from a source-only extraction of the example AND non-zero\n * once the same extraction is handed a module registry.\n */\n requiresGeneratedRegistry?: true\n}\n\nexport type ModuleFactCoverageFamily = {\n family: string\n enumSource: string\n rows: ModuleFactCoverageRow[]\n}\n\nconst FACT_SOURCE_KIND_COVERAGE: Record<ModuleFactSourceKind, ModuleFactCoverageRow> = {\n 'module-metadata': { value: 'module-metadata', status: 'emitted-example', note: 'example/index.ts ModuleInfo export' },\n entity: { value: 'entity', status: 'emitted-example', note: 'example/data/entities.ts ORM entities' },\n event: { value: 'event', status: 'emitted-example', note: 'example/events.ts typed event definitions' },\n 'acl-feature': { value: 'acl-feature', status: 'emitted-example', note: 'example/acl.ts RBAC features' },\n 'api-route': {\n value: 'api-route',\n status: 'emitted-example',\n note: 'example/api/**/route.ts; route facts are read from the generated module registry, not from module source',\n requiresGeneratedRegistry: true,\n },\n 'di-registration': { value: 'di-registration', status: 'emitted-example', note: 'example/di.ts Awilix container.register' },\n search: { value: 'search', status: 'emitted-example', note: 'example/search.ts indexed entity declaration' },\n vector: {\n value: 'vector',\n status: 'emitted-example',\n note: 'example/vector.ts deterministic Todo vector declaration',\n },\n notification: { value: 'notification', status: 'emitted-example', note: 'example/notifications.ts notification types' },\n 'cli-command': { value: 'cli-command', status: 'emitted-example', note: 'example/cli.ts module commands' },\n 'backend-page': { value: 'backend-page', status: 'emitted-example', note: 'example/backend/**/page.tsx admin pages' },\n 'frontend-page': { value: 'frontend-page', status: 'emitted-example', note: 'example/frontend/**/page.tsx portal pages' },\n 'ai-tool': { value: 'ai-tool', status: 'emitted-example', note: 'example/ai-tools.ts defineAiTool declarations' },\n 'ai-agent': { value: 'ai-agent', status: 'emitted-example', note: 'example/ai-agents.ts defineAiAgent declarations' },\n 'ai-extension': { value: 'ai-extension', status: 'emitted-example', note: 'example AI agent/tool override and extension records' },\n command: { value: 'command', status: 'emitted-example', note: 'example/commands/todos.ts command handlers' },\n subscriber: { value: 'subscriber', status: 'emitted-example', note: 'example/subscribers/*.ts event subscribers' },\n worker: { value: 'worker', status: 'emitted-example', note: 'example/workers/*.ts queue workers' },\n 'page-middleware': { value: 'page-middleware', status: 'emitted-example', note: 'example/backend/middleware.ts page guard' },\n setup: { value: 'setup', status: 'emitted-example', note: 'example/setup.ts tenant setup hooks' },\n encryption: { value: 'encryption', status: 'emitted-example', note: 'example/encryption.ts field encryption map' },\n 'custom-entity': { value: 'custom-entity', status: 'emitted-example', note: 'example/ce.ts custom entity and field DSL' },\n integration: { value: 'integration', status: 'emitted-example', note: 'example/lib/mock-*-adapter.ts integration registrations' },\n 'generator-plugin': {\n value: 'generator-plugin',\n status: 'emitted-example',\n note: 'example/generators.ts deterministic reference-index generator plugin',\n },\n 'extension-host': { value: 'extension-host', status: 'emitted-example', note: 'example/extension-points.ts declared hosts' },\n 'extension-contribution': {\n value: 'extension-contribution',\n status: 'emitted-example',\n note: 'example widget, DataTable, CrudForm, interceptor and enricher contributions',\n },\n}\n\nconst OWNED_CONTRACT_KIND_COVERAGE: Record<ModuleOwnedContractKind, ModuleFactCoverageRow> = {\n 'module-metadata': { value: 'module-metadata', status: 'emitted-example', note: 'ModuleInfo owned contract' },\n command: { value: 'command', status: 'emitted-example', note: 'example/commands/todos.ts' },\n worker: { value: 'worker', status: 'emitted-example', note: 'example/workers/*.ts' },\n 'page-middleware': { value: 'page-middleware', status: 'emitted-example', note: 'example/backend/middleware.ts' },\n setup: { value: 'setup', status: 'emitted-example', note: 'example/setup.ts' },\n encryption: { value: 'encryption', status: 'emitted-example', note: 'example/encryption.ts' },\n 'di-registration': {\n value: 'di-registration',\n status: 'emitted-example',\n note: 'example/di.ts scoped Todo summary cache service consumed by a route',\n },\n 'custom-entity': { value: 'custom-entity', status: 'emitted-example', note: 'example/ce.ts' },\n 'ai-extension': { value: 'ai-extension', status: 'emitted-example', note: 'example AI override/extension record' },\n 'generator-plugin': {\n value: 'generator-plugin',\n status: 'emitted-example',\n note: 'example/generators.ts deterministic reference-index generator plugin',\n },\n}\n\nconst OVERRIDE_DOMAIN_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n ai: { value: 'ai', status: 'emitted-example', note: 'ai.agents, ai.tools and ai.extensions targets' },\n routes: { value: 'routes', status: 'emitted-example', note: 'routes.api and routes.pages targets' },\n events: { value: 'events', status: 'emitted-example', note: 'events.subscribers targets' },\n workers: { value: 'workers', status: 'emitted-example', note: 'workers targets' },\n widgets: { value: 'widgets', status: 'emitted-example', note: 'widgets.injection, .components and .dashboard targets' },\n notifications: { value: 'notifications', status: 'emitted-example', note: 'notifications.types and notifications.handlers targets' },\n interceptors: { value: 'interceptors', status: 'emitted-example', note: 'API interceptor targets' },\n commandInterceptors: { value: 'commandInterceptors', status: 'emitted-example', note: 'command interceptor targets' },\n enrichers: { value: 'enrichers', status: 'emitted-example', note: 'response enricher targets' },\n guards: { value: 'guards', status: 'emitted-example', note: 'page-middleware guard targets' },\n cli: { value: 'cli', status: 'emitted-example', note: 'CLI command targets' },\n setup: { value: 'setup', status: 'emitted-example', note: 'setup hook and default-role targets' },\n acl: { value: 'acl', status: 'emitted-example', note: 'acl.features targets' },\n di: { value: 'di', status: 'emitted-example', note: 'DI token targets' },\n encryption: { value: 'encryption', status: 'emitted-example', note: 'encryption.maps targets' },\n nav: {\n value: 'nav',\n status: 'framework-only',\n note: 'nav.groupOrder is an app-level framework setting; no module target is ever emitted for it',\n },\n}\n\nconst OVERRIDE_MODE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'disable-replace': {\n value: 'disable-replace',\n status: 'emitted-example',\n note: 'default mode for most example override hosts',\n },\n replace: { value: 'replace', status: 'emitted-example', note: 'the setup host replaces wholesale' },\n additive: { value: 'additive', status: 'emitted-example', note: 'the ai.extensions host merges additively' },\n}\n\nconst OVERRIDE_NOTE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'safe-metadata-only': {\n value: 'safe-metadata-only',\n status: 'emitted-example',\n note: 'emitted on the metadata-only override target',\n },\n 'page-middleware-not-mutation-guard': {\n value: 'page-middleware-not-mutation-guard',\n status: 'emitted-example',\n note: 'emitted on the guards target so a page guard is not read as a mutation guard',\n },\n}\n\n/**\n * Every `negative-fixture` row here names a code that a real fixture in\n * `module-override-targets.diagnostic-wiring.test.ts` drives out of\n * `collectModuleOverrideTargets`; the coverage test asserts that fixture set matches\n * these rows exactly, so a row can never claim a fixture that does not exist.\n */\nconst OVERRIDE_DIAGNOSTIC_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'missing-owned-fact': {\n value: 'missing-owned-fact',\n status: 'currently-unbound',\n note: 'reserved by the spec\\'s closed diagnostic set; no adapter emits it today, so not even a broken fixture can produce it',\n },\n 'missing-source': {\n value: 'missing-source',\n status: 'negative-fixture',\n note: 'a fact whose provenance cannot be proven yields this and no target; activated canonical output emits none',\n },\n 'unsupported-dynamic-key': {\n value: 'unsupported-dynamic-key',\n status: 'negative-fixture',\n note: 'a key the runtime cannot address yields this and no target; activated canonical output emits none',\n },\n 'unknown-framework-domain': {\n value: 'unknown-framework-domain',\n status: 'negative-fixture',\n note: 'the framework catalog does not describe the dotted host at all',\n },\n 'unknown-framework-mode': {\n value: 'unknown-framework-mode',\n status: 'negative-fixture',\n note: 'the framework catalog describes the host but names an operation that is not a public mode',\n },\n}\n\nconst CONTRIBUTION_KIND_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n widget: { value: 'widget', status: 'emitted-example', note: 'example widget injection and dashboard registrations' },\n 'data-table': { value: 'data-table', status: 'emitted-example', note: 'example DataTable extension entries' },\n 'crud-form': { value: 'crud-form', status: 'emitted-example', note: 'example CrudForm field and lifecycle entries' },\n 'component-override': { value: 'component-override', status: 'emitted-example', note: 'example replace, wrapper and props component entries' },\n 'response-enricher': { value: 'response-enricher', status: 'emitted-example', note: 'example customer priority response enricher' },\n 'api-interceptor': { value: 'api-interceptor', status: 'emitted-example', note: 'example CRUD API interceptor entries' },\n 'command-interceptor': { value: 'command-interceptor', status: 'emitted-example', note: 'example command interceptor entries' },\n 'mutation-guard': { value: 'mutation-guard', status: 'emitted-example', note: 'example Todo mutation guard' },\n 'entity-extension': { value: 'entity-extension', status: 'emitted-example', note: 'example customer entity extension' },\n subscriber: { value: 'subscriber', status: 'emitted-example', note: 'example synchronous and asynchronous subscribers' },\n 'browser-reaction': { value: 'browser-reaction', status: 'emitted-example', note: 'example client, portal and notification reactions' },\n 'specialized-registry': { value: 'specialized-registry', status: 'emitted-example', note: 'example notification, search, AI and mock adapter registries' },\n 'module-override': { value: 'module-override', status: 'catalog-only', note: 'app-owned configuration is not an outgoing module contribution' },\n}\n\nconst ACTIVATION_KIND_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'crud-response-enricher': { value: 'crud-response-enricher', status: 'currently-unbound', note: 'example contributes a response enricher but owns no CRUD response call site for its customer target' },\n 'query-enricher': { value: 'query-enricher', status: 'currently-unbound', note: 'example contributes a query enricher but owns no query-engine call site for its customer target' },\n 'mutation-guard': { value: 'mutation-guard', status: 'emitted-example', note: 'Todo mutation-guard route bridge' },\n 'api-interceptor-bridge': { value: 'api-interceptor-bridge', status: 'emitted-example', note: 'CRUD route interceptor pipeline' },\n 'command-interceptor-bridge': { value: 'command-interceptor-bridge', status: 'emitted-example', note: 'exact Todo command bus target' },\n 'widget-injection-consumer': { value: 'widget-injection-consumer', status: 'emitted-example', note: 'bound injection host consumer' },\n 'component-extension-consumer': { value: 'component-extension-consumer', status: 'emitted-example', note: 'bound component handle consumer' },\n 'dashboard-host-consumer': { value: 'dashboard-host-consumer', status: 'emitted-example', note: 'framework dashboard registry consumer' },\n}\n\nconst HOST_FAMILY_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n generic: { value: 'generic', status: 'emitted-example', note: 'example headless injection host' },\n menu: { value: 'menu', status: 'framework-only', note: 'framework menu hosts consumed by example widgets' },\n 'data-table': { value: 'data-table', status: 'emitted-example', note: 'example Todo DataTable host' },\n 'crud-form': { value: 'crud-form', status: 'emitted-example', note: 'example Todo CrudForm host' },\n detail: { value: 'detail', status: 'framework-only', note: 'framework detail hosts consumed by example widgets' },\n 'portal-page': { value: 'portal-page', status: 'framework-only', note: 'framework portal host consumed by example widgets' },\n 'component-handle': { value: 'component-handle', status: 'emitted-example', note: 'example replaceable component host' },\n entity: { value: 'entity', status: 'emitted-example', note: 'example entity fact-reference hosts' },\n 'api-route': { value: 'api-route', status: 'framework-only', note: 'API route hosts are owned by the target module and consumed by example interceptors' },\n command: { value: 'command', status: 'framework-only', note: 'command hosts are owned by the target module and consumed by example interceptors' },\n event: { value: 'event', status: 'emitted-example', note: 'example event fact-reference hosts' },\n 'query-lifecycle': { value: 'query-lifecycle', status: 'emitted-example', note: 'example Todo query lifecycle hosts' },\n dashboard: { value: 'dashboard', status: 'framework-only', note: 'framework dashboard host consumed by example widgets' },\n notification: { value: 'notification', status: 'framework-only', note: 'framework notification host consumed by the example registry' },\n integration: { value: 'integration', status: 'framework-only', note: 'framework integration detail host consumed by example widgets' },\n 'specialized-registry': { value: 'specialized-registry', status: 'framework-only', note: 'framework-owned specialist registries accept example entries' },\n 'module-override': { value: 'module-override', status: 'framework-only', note: 'framework override catalog owns these hosts' },\n}\n\nconst HOST_CAPABILITY_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'render-widget': { value: 'render-widget', status: 'emitted-example', note: 'example render widget host and contributions' },\n 'headless-widget': { value: 'headless-widget', status: 'currently-unbound', note: 'injection-table facts do not yet distinguish headless widget payloads' },\n 'menu-item': { value: 'menu-item', status: 'currently-unbound', note: 'injection-table facts do not yet distinguish menu item payloads' },\n 'column-widget': { value: 'column-widget', status: 'emitted-example', note: 'example DataTable column host' },\n 'row-action': { value: 'row-action', status: 'emitted-example', note: 'example DataTable row-action host' },\n 'bulk-action': { value: 'bulk-action', status: 'emitted-example', note: 'example DataTable bulk-action host' },\n 'filter-widget': { value: 'filter-widget', status: 'emitted-example', note: 'example DataTable filter host' },\n 'toolbar-widget': { value: 'toolbar-widget', status: 'emitted-example', note: 'example DataTable toolbar host' },\n 'field-widget': { value: 'field-widget', status: 'emitted-example', note: 'example CrudForm field host' },\n 'lifecycle-handler': { value: 'lifecycle-handler', status: 'emitted-example', note: 'example CrudForm lifecycle host' },\n 'component-replacement': { value: 'component-replacement', status: 'emitted-example', note: 'example replaceable DataTable, CrudForm and component hosts' },\n 'response-enricher': { value: 'response-enricher', status: 'emitted-example', note: 'example entity enricher host' },\n 'query-enricher': { value: 'query-enricher', status: 'emitted-example', note: 'example query-enricher host' },\n 'api-interceptor': { value: 'api-interceptor', status: 'emitted-example', note: 'example API interceptor contribution and route bridge' },\n 'command-interceptor': { value: 'command-interceptor', status: 'emitted-example', note: 'example command interceptor and exact command owner' },\n 'mutation-guard': { value: 'mutation-guard', status: 'emitted-example', note: 'example entity mutation guard host' },\n 'entity-extension': { value: 'entity-extension', status: 'emitted-example', note: 'example entity extension host' },\n 'async-subscriber': { value: 'async-subscriber', status: 'emitted-example', note: 'example event subscriber host' },\n 'sync-subscriber': { value: 'sync-subscriber', status: 'emitted-example', note: 'example synchronous event subscriber host' },\n 'browser-client': { value: 'browser-client', status: 'emitted-example', note: 'example client-broadcast event host' },\n 'browser-portal': { value: 'browser-portal', status: 'emitted-example', note: 'example portal-broadcast event host' },\n 'registry-contribution': { value: 'registry-contribution', status: 'emitted-example', note: 'example specialized registry contributions' },\n 'module-override': { value: 'module-override', status: 'framework-only', note: 'framework override hosts; app configuration is not a contribution' },\n}\n\nconst HOST_ACTIVATION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n always: { value: 'always', status: 'emitted-example', note: 'always-active example declarations' },\n 'host-opt-in': { value: 'host-opt-in', status: 'emitted-example', note: 'example entity extension and response-enricher hosts' },\n 'caller-opt-in': { value: 'caller-opt-in', status: 'emitted-example', note: 'example query lifecycle and query enricher' },\n 'feature-gated': { value: 'feature-gated', status: 'currently-unbound', note: 'feature requirements are emitted but are not a distinct activation value' },\n}\n\nconst TARGET_KIND_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n module: { value: 'module', status: 'emitted-example', note: 'example module-scoped registry target' },\n entity: { value: 'entity', status: 'emitted-example', note: 'example entity extension, enricher and guard targets' },\n 'api-route': { value: 'api-route', status: 'emitted-example', note: 'example API interceptor targets' },\n command: { value: 'command', status: 'emitted-example', note: 'example exact and wildcard command targets' },\n 'widget-spot': { value: 'widget-spot', status: 'emitted-example', note: 'example injection targets' },\n component: { value: 'component', status: 'emitted-example', note: 'example component override targets' },\n event: { value: 'event', status: 'emitted-example', note: 'example subscriber targets' },\n notification: { value: 'notification', status: 'emitted-example', note: 'example notification registry target' },\n wildcard: { value: 'wildcard', status: 'emitted-example', note: 'example wildcard subscriber and interceptor targets' },\n}\n\nconst HOST_RESOLUTION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n exact: { value: 'exact', status: 'emitted-example', note: 'example exact declared hosts' },\n pattern: { value: 'pattern', status: 'emitted-example', note: 'example patterned host surfaces' },\n framework: { value: 'framework', status: 'framework-only', note: 'framework catalog host identity' },\n 'fact-ref': { value: 'fact-ref', status: 'emitted-example', note: 'example entity, event and query fact-reference hosts' },\n}\n\nconst TARGET_RESOLUTION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n exact: { value: 'exact', status: 'emitted-example', note: 'example exact target correlation' },\n pattern: { value: 'pattern', status: 'emitted-example', note: 'example wildcard and patterned target correlation' },\n framework: { value: 'framework', status: 'emitted-example', note: 'example contribution to a framework host' },\n 'fact-ref': { value: 'fact-ref', status: 'emitted-example', note: 'example contribution to a generated fact owner' },\n 'optional-external': { value: 'optional-external', status: 'emitted-example', note: 'example optional module target remains fail-soft' },\n unresolved: { value: 'unresolved', status: 'negative-fixture', note: 'only malformed targets remain unresolved' },\n}\n\nconst TOPOLOGY_RESOLUTION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n bound: { value: 'bound', status: 'emitted-example', note: 'example contribution reaches a verified runtime activation' },\n 'capability-only': { value: 'capability-only', status: 'emitted-example', note: 'declaration-backed capability without a separate caller activation' },\n 'optional-target-missing': { value: 'optional-target-missing', status: 'emitted-example', note: 'optional external target absent from the selected module set' },\n wildcard: { value: 'wildcard', status: 'emitted-example', note: 'wildcard contribution resolves against selected targets' },\n unresolved: { value: 'unresolved', status: 'negative-fixture', note: 'only malformed first-party targets remain unresolved' },\n}\n\nconst SPECIALIZED_REGISTRY_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n notification: { value: 'notification', status: 'emitted-example', note: 'example notification type registry' },\n integration: { value: 'integration', status: 'emitted-example', note: 'example credential-free integration bundle identity' },\n search: { value: 'search', status: 'emitted-example', note: 'example Todo search registry' },\n vector: { value: 'vector', status: 'emitted-example', note: 'example deterministic Todo vector registry' },\n ai: { value: 'ai', status: 'emitted-example', note: 'example AI tool and agent registries' },\n payment: { value: 'payment', status: 'emitted-example', note: 'example mock payment descriptors' },\n shipping: { value: 'shipping', status: 'emitted-example', note: 'example mock shipping registry identity' },\n currency: { value: 'currency', status: 'emitted-example', note: 'example deterministic currency provider identity' },\n workflow: { value: 'workflow', status: 'emitted-example', note: 'example event-triggered Todo workflow identity' },\n}\n\nconst COMPONENT_MODE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n replace: { value: 'replace', status: 'emitted-example', note: 'example replacement component' },\n wrapper: { value: 'wrapper', status: 'emitted-example', note: 'example decorating wrapper component' },\n props: { value: 'props', status: 'emitted-example', note: 'example props-transform component' },\n}\n\nconst FACT_DIAGNOSTIC_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'duplicate-source': { value: 'duplicate-source', status: 'negative-fixture', note: 'duplicate provenance fixture; canonical output emits none' },\n 'unresolved-static-contract': { value: 'unresolved-static-contract', status: 'negative-fixture', note: 'dynamic contract fixture; canonical output emits none' },\n}\n\nconst UNRESOLVED_REASON_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'unclassified-binding': { value: 'unclassified-binding', status: 'negative-fixture', note: 'malformed extension declaration fixture' },\n 'unbound-declaration': { value: 'unbound-declaration', status: 'negative-fixture', note: 'declared host without a real caller fixture' },\n 'dynamic-without-pattern': { value: 'dynamic-without-pattern', status: 'negative-fixture', note: 'dynamic host without a declared pattern fixture' },\n 'unresolved-first-party-target': { value: 'unresolved-first-party-target', status: 'negative-fixture', note: 'broken first-party target fixture' },\n}\n\nconst DATA_TABLE_SURFACE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n header: { value: 'header', status: 'emitted-example', note: 'bound Todo table header' },\n footer: { value: 'footer', status: 'emitted-example', note: 'bound Todo table footer' },\n toolbar: { value: 'toolbar', status: 'emitted-example', note: 'bound Todo table toolbar' },\n searchTrailing: { value: 'searchTrailing', status: 'emitted-example', note: 'bound Todo table search trailing surface' },\n columns: { value: 'columns', status: 'emitted-example', note: 'bound Todo table columns' },\n rowActions: { value: 'rowActions', status: 'emitted-example', note: 'bound Todo table row actions' },\n bulkActions: { value: 'bulkActions', status: 'emitted-example', note: 'bound Todo table bulk actions' },\n filters: { value: 'filters', status: 'emitted-example', note: 'bound Todo table filters' },\n replacement: { value: 'replacement', status: 'emitted-example', note: 'bound Todo table replacement' },\n emptyState: { value: 'emptyState', status: 'currently-unbound', note: 'catalog-declared DataTable surface has no runtime host' },\n}\n\nconst CRUD_FORM_SURFACE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n base: { value: 'base', status: 'emitted-example', note: 'bound Todo form base' },\n header: { value: 'header', status: 'emitted-example', note: 'bound Todo form header' },\n fields: { value: 'fields', status: 'emitted-example', note: 'bound Todo form fields' },\n replacement: { value: 'replacement', status: 'emitted-example', note: 'bound Todo form replacement' },\n beforeFields: { value: 'beforeFields', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n afterFields: { value: 'afterFields', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n footer: { value: 'footer', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n sidebar: { value: 'sidebar', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n group: { value: 'group', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n fieldBefore: { value: 'fieldBefore', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n fieldAfter: { value: 'fieldAfter', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n}\n\nconst CRUD_FORM_LIFECYCLE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n transformValidation: { value: 'transformValidation', status: 'emitted-example', note: 'example Todo form lifecycle transformValidation' },\n transformDisplayData: { value: 'transformDisplayData', status: 'emitted-example', note: 'example Todo form lifecycle transformDisplayData' },\n onBeforeNavigate: { value: 'onBeforeNavigate', status: 'emitted-example', note: 'example Todo form lifecycle onBeforeNavigate' },\n onAppEvent: { value: 'onAppEvent', status: 'emitted-example', note: 'example Todo form lifecycle onAppEvent' },\n onVisibilityChange: { value: 'onVisibilityChange', status: 'emitted-example', note: 'example Todo form lifecycle onVisibilityChange' },\n onBeforeDelete: { value: 'onBeforeDelete', status: 'emitted-example', note: 'example Todo form lifecycle onBeforeDelete' },\n onDelete: { value: 'onDelete', status: 'emitted-example', note: 'example Todo form lifecycle onDelete' },\n onAfterDelete: { value: 'onAfterDelete', status: 'emitted-example', note: 'example Todo form lifecycle onAfterDelete' },\n onDeleteError: { value: 'onDeleteError', status: 'emitted-example', note: 'example Todo form lifecycle onDeleteError' },\n onFieldChange: { value: 'onFieldChange', status: 'emitted-example', note: 'example Todo form lifecycle onFieldChange' },\n transformFormData: { value: 'transformFormData', status: 'emitted-example', note: 'example Todo form lifecycle transformFormData' },\n onBeforeSave: { value: 'onBeforeSave', status: 'emitted-example', note: 'example Todo form lifecycle onBeforeSave' },\n onSave: { value: 'onSave', status: 'emitted-example', note: 'example Todo form lifecycle onSave' },\n onAfterSave: { value: 'onAfterSave', status: 'emitted-example', note: 'example Todo form lifecycle onAfterSave' },\n}\n\nconst CRUD_FORM_OPERATION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n create: { value: 'create', status: 'emitted-example', note: 'example Todo create lifecycle' },\n update: { value: 'update', status: 'currently-unbound', note: 'example lifecycle contribution is currently registered for create only' },\n delete: { value: 'delete', status: 'currently-unbound', note: 'example lifecycle contribution is currently registered for create only' },\n}\n\n/**\n * One family of the ledger. Both directions are enforced: an enumerated value with\n * no row, and a row classifying a value the enum no longer carries, each throw \u2014 so\n * neither an unclassified new value nor a stale row for a removed one can ship.\n */\nexport function buildCoverageFamily(\n family: string,\n enumSource: string,\n values: readonly string[],\n coverage: Readonly<Record<string, ModuleFactCoverageRow>>,\n): ModuleFactCoverageFamily {\n const rows: ModuleFactCoverageRow[] = []\n const missing: string[] = []\n for (const value of values) {\n const row = coverage[value]\n if (!row) {\n missing.push(value)\n continue\n }\n rows.push(row)\n }\n if (missing.length > 0) {\n throw new Error(\n `[module-facts] factCoverage family \"${family}\" has no row for: ${missing.join(', ')}. ` +\n 'Add an explicit classification instead of leaving the value unclassified.',\n )\n }\n const extra = Object.keys(coverage).filter((value) => !values.includes(value))\n if (extra.length > 0) {\n throw new Error(\n `[module-facts] factCoverage family \"${family}\" classifies values absent from the enum: ${extra.join(', ')}.`,\n )\n }\n return { family, enumSource, rows }\n}\n\n/**\n * Builds the whole ledger, throwing when an enumerated value lacks a row or a row\n * classifies a value the enum no longer carries. {@link extractAllModuleFacts} calls\n * it on every run, so either violation fails fact generation \u2014 not only the unit\n * test \u2014 and the built ledger is returned on the generation result so the published\n * mirrors have a single generated authority to be checked against.\n */\nexport function buildModuleFactCoverageLedger(): ModuleFactCoverageFamily[] {\n return [\n buildCoverageFamily(\n 'ModuleFactSourceKind',\n 'packages/cli/src/lib/generators/module-facts.ts#MODULE_FACT_SOURCE_KINDS',\n MODULE_FACT_SOURCE_KINDS,\n FACT_SOURCE_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOwnedContractKind',\n 'packages/cli/src/lib/generators/module-facts.ts#MODULE_OWNED_CONTRACT_KINDS',\n MODULE_OWNED_CONTRACT_KINDS,\n OWNED_CONTRACT_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideDomain',\n 'packages/cli/src/lib/generators/module-override-targets.ts#ALL_OVERRIDE_DOMAINS',\n ALL_OVERRIDE_DOMAINS,\n OVERRIDE_DOMAIN_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideMode',\n 'packages/cli/src/lib/generators/module-override-targets.ts#MODULE_OVERRIDE_MODES',\n MODULE_OVERRIDE_MODES,\n OVERRIDE_MODE_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideTargetNote',\n 'packages/cli/src/lib/generators/module-override-targets.ts#MODULE_OVERRIDE_TARGET_NOTES',\n MODULE_OVERRIDE_TARGET_NOTES,\n OVERRIDE_NOTE_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideTargetDiagnosticCode',\n 'packages/cli/src/lib/generators/module-override-targets.ts#MODULE_OVERRIDE_TARGET_DIAGNOSTIC_CODES',\n MODULE_OVERRIDE_TARGET_DIAGNOSTIC_CODES,\n OVERRIDE_DIAGNOSTIC_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionContributionKind',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_CONTRIBUTION_KINDS',\n MODULE_EXTENSION_CONTRIBUTION_KINDS,\n CONTRIBUTION_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionActivationKind',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_ACTIVATION_KINDS',\n MODULE_EXTENSION_ACTIVATION_KINDS,\n ACTIVATION_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ExtensionHostFamily',\n 'packages/shared/src/modules/widgets/extension-points.ts#EXTENSION_HOST_FAMILIES',\n EXTENSION_HOST_FAMILIES,\n HOST_FAMILY_COVERAGE,\n ),\n buildCoverageFamily(\n 'ExtensionHostCapability',\n 'packages/shared/src/modules/widgets/extension-points.ts#EXTENSION_HOST_CAPABILITIES',\n EXTENSION_HOST_CAPABILITIES,\n HOST_CAPABILITY_COVERAGE,\n ),\n buildCoverageFamily(\n 'ExtensionHostActivation',\n 'packages/shared/src/modules/widgets/extension-points.ts#EXTENSION_HOST_ACTIVATIONS',\n EXTENSION_HOST_ACTIVATIONS,\n HOST_ACTIVATION_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionTargetKind',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_TARGET_KINDS',\n MODULE_EXTENSION_TARGET_KINDS,\n TARGET_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionHostResolution',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_HOST_RESOLUTIONS',\n MODULE_EXTENSION_HOST_RESOLUTIONS,\n HOST_RESOLUTION_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionTargetResolution',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_TARGET_RESOLUTIONS',\n MODULE_EXTENSION_TARGET_RESOLUTIONS,\n TARGET_RESOLUTION_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionResolution',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_RESOLUTIONS',\n MODULE_EXTENSION_RESOLUTIONS,\n TOPOLOGY_RESOLUTION_COVERAGE,\n ),\n buildCoverageFamily(\n 'SpecializedRegistry',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_SPECIALIZED_REGISTRIES',\n MODULE_SPECIALIZED_REGISTRIES,\n SPECIALIZED_REGISTRY_COVERAGE,\n ),\n buildCoverageFamily(\n 'ComponentOverrideMode',\n 'packages/shared/src/modules/widgets/extension-points.ts#COMPONENT_OVERRIDE_MODES',\n COMPONENT_OVERRIDE_MODES,\n COMPONENT_MODE_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleFactDiagnosticCode',\n 'packages/cli/src/lib/generators/module-facts.ts#MODULE_FACT_DIAGNOSTIC_CODES',\n MODULE_FACT_DIAGNOSTIC_CODES,\n FACT_DIAGNOSTIC_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionUnresolvedReason',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_UNRESOLVED_REASONS',\n MODULE_EXTENSION_UNRESOLVED_REASONS,\n UNRESOLVED_REASON_COVERAGE,\n ),\n buildCoverageFamily(\n 'DataTableExtensionSurface',\n 'packages/shared/src/modules/widgets/extension-points.ts#DATA_TABLE_EXTENSION_SURFACE_KEYS',\n DATA_TABLE_EXTENSION_SURFACE_KEYS,\n DATA_TABLE_SURFACE_COVERAGE,\n ),\n buildCoverageFamily(\n 'CrudFormExtensionSurface',\n 'packages/shared/src/modules/widgets/extension-points.ts#CRUD_FORM_EXTENSION_SURFACE_KEYS',\n CRUD_FORM_EXTENSION_SURFACE_KEYS,\n CRUD_FORM_SURFACE_COVERAGE,\n ),\n buildCoverageFamily(\n 'CrudFormLifecyclePhase',\n 'packages/shared/src/modules/widgets/extension-points.ts#CRUD_FORM_LIFECYCLE_PHASES',\n CRUD_FORM_LIFECYCLE_PHASES,\n CRUD_FORM_LIFECYCLE_COVERAGE,\n ),\n buildCoverageFamily(\n 'CrudFormOperation',\n 'packages/shared/src/modules/widgets/extension-points.ts#CRUD_FORM_OPERATIONS',\n CRUD_FORM_OPERATIONS,\n CRUD_FORM_OPERATION_COVERAGE,\n ),\n ]\n}\n\n/**\n * Real per-value counts for every ledger family, read from an extracted module's\n * facts. This is the anti-silent-zero oracle: a ledger claim is checked against what\n * the extractor actually published, never against a hand-maintained inventory row.\n */\nexport function countModuleFactCoverage(facts: ModuleFacts): Record<string, Record<string, number>> {\n const increment = (counts: Record<string, number>, value: string): void => {\n counts[value] = (counts[value] ?? 0) + 1\n }\n const factSourceKind: Record<string, number> = {}\n for (const entry of facts.factSources ?? []) {\n increment(factSourceKind, entry.kind)\n }\n const ownedContractKind: Record<string, number> = {}\n for (const [kind, list] of Object.entries(facts.ownedContracts ?? {})) {\n ownedContractKind[kind] = (list ?? []).length\n }\n const overrideDomain: Record<string, number> = {}\n const overrideMode: Record<string, number> = {}\n const overrideNote: Record<string, number> = {}\n for (const target of facts.overrideTargets ?? []) {\n overrideDomain[target.domain] = (overrideDomain[target.domain] ?? 0) + 1\n for (const mode of target.modes) overrideMode[mode] = (overrideMode[mode] ?? 0) + 1\n for (const note of target.notes ?? []) overrideNote[note] = (overrideNote[note] ?? 0) + 1\n }\n const overrideDiagnosticCode: Record<string, number> = {}\n for (const diagnostic of facts.overrideTargetDiagnostics ?? []) {\n increment(overrideDiagnosticCode, diagnostic.code)\n }\n const contributionKind: Record<string, number> = {}\n const activationKind: Record<string, number> = {}\n const hostFamily: Record<string, number> = {}\n const hostCapability: Record<string, number> = {}\n const hostActivation: Record<string, number> = {}\n const targetKind: Record<string, number> = {}\n const hostResolution: Record<string, number> = {}\n const targetResolution: Record<string, number> = {}\n const topologyResolution: Record<string, number> = {}\n const specializedRegistry: Record<string, number> = {}\n const componentMode: Record<string, number> = {}\n const factDiagnosticCode: Record<string, number> = {}\n const unresolvedReason: Record<string, number> = {}\n const dataTableSurface: Record<string, number> = {}\n const crudFormSurface: Record<string, number> = {}\n const crudFormLifecycle: Record<string, number> = {}\n const crudFormOperation: Record<string, number> = {}\n const surfaces = facts.extensionSurfaces\n for (const host of surfaces?.hosts ?? []) {\n increment(hostFamily, host.family)\n increment(hostResolution, host.resolution)\n increment(hostActivation, host.activation ?? 'always')\n for (const capability of host.capabilities) increment(hostCapability, capability)\n for (const phase of host.phases ?? []) increment(crudFormLifecycle, phase)\n for (const operation of host.operations ?? []) increment(crudFormOperation, operation)\n const [owner, surface] = host.key.split('.')\n if (owner === 'todosTable' && surface) increment(dataTableSurface, surface)\n if (owner === 'todoForm' && surface) increment(crudFormSurface, surface)\n }\n for (const contribution of surfaces?.contributions ?? []) {\n increment(contributionKind, contribution.kind)\n increment(hostActivation, contribution.activation ?? 'always')\n for (const target of contribution.targets) increment(targetResolution, target.resolution)\n for (const operation of contribution.operations ?? []) increment(crudFormOperation, operation)\n if (contribution.kind === 'specialized-registry') increment(specializedRegistry, contribution.details.registry)\n if (contribution.kind === 'component-override') increment(componentMode, contribution.details.mode)\n if (contribution.kind === 'widget') {\n if (contribution.details.payload === 'headless') increment(hostCapability, 'headless-widget')\n if (contribution.details.payload === 'menu') increment(hostCapability, 'menu-item')\n if (contribution.details.payload === 'dashboard' || contribution.details.payload === 'notification' || contribution.details.payload === 'integration') {\n increment(hostCapability, 'registry-contribution')\n }\n }\n if (contribution.kind === 'api-interceptor') increment(hostCapability, 'api-interceptor')\n if (contribution.kind === 'command-interceptor') increment(hostCapability, 'command-interceptor')\n }\n for (const activation of surfaces?.activations ?? []) increment(activationKind, activation.kind)\n for (const resolution of surfaces?.contributionResolutions ?? []) {\n increment(targetKind, resolution.target.kind)\n increment(topologyResolution, resolution.resolution)\n for (const id of resolution.activationIds) {\n const kind = MODULE_EXTENSION_ACTIVATION_KINDS.find((candidate) => id.endsWith(`:${candidate}`))\n if (kind) increment(activationKind, kind)\n }\n }\n for (const diagnostic of facts.factDiagnostics ?? []) increment(factDiagnosticCode, diagnostic.code)\n for (const unresolved of surfaces?.unresolved ?? []) increment(unresolvedReason, unresolved.reason)\n return {\n ModuleFactSourceKind: factSourceKind,\n ModuleOwnedContractKind: ownedContractKind,\n ModuleOverrideDomain: overrideDomain,\n ModuleOverrideMode: overrideMode,\n ModuleOverrideTargetNote: overrideNote,\n ModuleOverrideTargetDiagnosticCode: overrideDiagnosticCode,\n ModuleExtensionContributionKind: contributionKind,\n ModuleExtensionActivationKind: activationKind,\n ExtensionHostFamily: hostFamily,\n ExtensionHostCapability: hostCapability,\n ExtensionHostActivation: hostActivation,\n ModuleExtensionTargetKind: targetKind,\n ModuleExtensionHostResolution: hostResolution,\n ModuleExtensionTargetResolution: targetResolution,\n ModuleExtensionResolution: topologyResolution,\n SpecializedRegistry: specializedRegistry,\n ComponentOverrideMode: componentMode,\n ModuleFactDiagnosticCode: factDiagnosticCode,\n ModuleExtensionUnresolvedReason: unresolvedReason,\n DataTableExtensionSurface: dataTableSurface,\n CrudFormExtensionSurface: crudFormSurface,\n CrudFormLifecyclePhase: crudFormLifecycle,\n CrudFormOperation: crudFormOperation,\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,eAAe;AACxB,SAAS,mCAAmC;AAC5C,SAAS,8BAA8B;AAEvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,6BAAoD;AAC7D,SAAS,wCAAwC;AAgG1C,MAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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Q,YAAY,KAAK;AACpC;AASO,SAAS,gCAA4D;AAC1E,SAAO;AAAA,IACL;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IAC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yBAAyB;AAAA,IACzB,2BAA2B;AAAA,IAC3B,+BAA+B;AAAA,IAC/B,iCAAiC;AAAA,IACjC,2BAA2B;AAAA,IAC3B,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,IACvB,0BAA0B;AAAA,IAC1B,iCAAiC;AAAA,IACjC,2BAA2B;AAAA,IAC3B,0BAA0B;AAAA,IAC1B,wBAAwB;AAAA,IACxB,mBAAmB;AAAA,EACrB;AACF;",
|
|
4
|
+
"sourcesContent": ["import { createHash } from 'node:crypto'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport ts from 'typescript-js'\nimport {\n COMPONENT_OVERRIDE_MODES,\n CRUD_FORM_EXTENSION_SURFACE_KEYS,\n CRUD_FORM_LIFECYCLE_PHASES,\n CRUD_FORM_OPERATIONS,\n DATA_TABLE_EXTENSION_SURFACE_KEYS,\n EXTENSION_HOST_ACTIVATIONS,\n EXTENSION_HOST_CAPABILITIES,\n EXTENSION_HOST_FAMILIES,\n MODULE_EXTENSION_ACTIVATION_KINDS,\n MODULE_EXTENSION_CONTRIBUTION_KINDS,\n MODULE_EXTENSION_HOST_RESOLUTIONS,\n MODULE_EXTENSION_RESOLUTIONS,\n MODULE_EXTENSION_TARGET_KINDS,\n MODULE_EXTENSION_TARGET_RESOLUTIONS,\n MODULE_EXTENSION_UNRESOLVED_REASONS,\n MODULE_SPECIALIZED_REGISTRIES,\n type ModuleExtensionContributionFact,\n type ModuleExtensionHostFact,\n type ModuleExtensionSurfaceFacts,\n type ModuleExtensionTargetRef,\n} from '@open-mercato/shared/modules/widgets/extension-points'\nimport { toSnake } from '../utils'\nimport { extractCommandIdsFromSource } from './module-registry'\nimport { MODULE_CODE_EXTENSIONS } from './scanner'\nimport type { ApiRouteInterceptorBridge } from './module-extension-facts'\nimport {\n assertNoUnresolvedExtensionTargets,\n correlateIncomingExtensions,\n correlateModuleExtensionFacts,\n extractActivationTargetOwners,\n extractKnownApiRouteIds,\n extractKnownCommandIds,\n extractModuleExtensionFacts,\n renderFrameworkExtensionPointsMarkdown,\n withModuleExtensionFactExtractionCache,\n} from './module-extension-facts'\nimport {\n ALL_OVERRIDE_DOMAINS,\n MODULE_OVERRIDE_MODES,\n MODULE_OVERRIDE_TARGET_DIAGNOSTIC_CODES,\n MODULE_OVERRIDE_TARGET_NOTES,\n collectModuleOverrideTargets,\n type ModuleOverrideTarget,\n type ModuleOverrideTargetDiagnostic,\n} from './module-override-targets'\nimport { buildFactSourceLookup, type FactSourceLookup } from './module-fact-sources'\nimport { appendLocalReferenceModuleSource } from './module-facts-discovery'\n\nexport interface ModuleEntityFact {\n id: string\n class: string\n table: string\n editable: boolean\n customFields: boolean\n}\n\nexport interface ApiRouteAuthRule {\n requireAuth?: boolean\n requireFeatures?: string[]\n requireRoles?: string[]\n}\n\nexport interface ModuleApiRouteFact {\n path: string\n methods: string[]\n auth: Record<string, ApiRouteAuthRule>\n sourcePath: string | null\n}\n\n/**\n * Statically declared page metadata that affects extensibility or access, using the\n * runtime `PageMetadata` contract keys and the same alias precedence as\n * `resolvePageRouteMetadata` (`pageGroup ?? group`, `pageGroupKey ?? groupKey`,\n * `pageOrder ?? order`). Executable guards, icons, titles and translation results are\n * never serialized.\n */\nexport interface ModulePageMetadata {\n requireAuth?: boolean\n requireCustomerAuth?: boolean\n requireFeatures?: string[]\n requireCustomerFeatures?: string[]\n navHidden?: boolean\n navGroup?: string\n navGroupKey?: string\n navOrder?: number\n pageContext?: 'main' | 'admin' | 'settings' | 'profile'\n}\n\nexport interface ModulePageFact {\n path: string\n sourcePath: string\n /** Companion metadata file (`page.meta.*` / `meta.*`) when runtime reads metadata from one. */\n metadataSourcePath?: string\n metadata?: ModulePageMetadata\n}\n\nexport interface ModuleCliCommandFact {\n command: string\n sourcePath: string\n}\n\nexport interface ModuleAiToolFact {\n name: string\n sourcePath: string\n}\n\nexport interface ModuleAiAgentFact {\n id: string\n sourcePath: string\n}\n\nexport interface ModuleEventFact {\n id: string\n label?: string\n category: string | null\n entity: string | null\n clientBroadcast?: boolean\n portalBroadcast?: boolean\n}\n\nexport interface ModuleHostTokens {\n entityIds: string[]\n tableIds: string[]\n}\n\nexport type ModuleFactSourceRef = {\n sourcePath: string\n exportName?: string\n line?: number\n}\n\nexport type ModuleFactRef = {\n factSection: string\n factKey: string\n}\n\n/**\n * Closed provenance/contract sets, published as `as const` ledgers whose types\n * derive from them. The `factCoverage` ledger enumerates these at runtime, so a\n * kind added here without a ledger row fails the coverage contract test rather\n * than silently joining the public surface unclassified.\n */\nexport const MODULE_FACT_SOURCE_KINDS = [\n 'module-metadata',\n 'entity',\n 'event',\n 'acl-feature',\n 'api-route',\n 'di-registration',\n 'search',\n 'vector',\n 'notification',\n 'cli-command',\n 'backend-page',\n 'frontend-page',\n 'ai-tool',\n 'ai-agent',\n 'ai-extension',\n 'command',\n 'subscriber',\n 'worker',\n 'page-middleware',\n 'setup',\n 'encryption',\n 'custom-entity',\n 'integration',\n 'generator-plugin',\n 'extension-host',\n 'extension-contribution',\n] as const\n\nexport type ModuleFactSourceKind = (typeof MODULE_FACT_SOURCE_KINDS)[number]\n\nexport const MODULE_OWNED_CONTRACT_KINDS = [\n 'module-metadata',\n 'command',\n 'worker',\n 'page-middleware',\n 'setup',\n 'encryption',\n 'di-registration',\n 'custom-entity',\n 'ai-extension',\n 'generator-plugin',\n] as const\n\nexport type ModuleOwnedContractKind = (typeof MODULE_OWNED_CONTRACT_KINDS)[number]\n\nexport type ModuleFactSafeScalar = string | number | boolean | null\n\nexport type ModuleOwnedContractFact = {\n kind: ModuleOwnedContractKind\n id: string\n source: ModuleFactSourceRef\n metadata?: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]>\n}\n\nexport type ModuleOwnedContracts = Partial<\n Record<ModuleOwnedContractKind, ModuleOwnedContractFact[]>\n>\n\n/**\n * Provenance pointer into a fact section that already serializes the declaration site.\n * `factKey` is omitted when it equals the owning entry's `id`, which is the common case.\n */\nexport type ModuleFactIndexRef = {\n factSection: string\n factKey?: string\n}\n\n/**\n * One provenance entry per proven `(kind, id)` in the module. Exactly one of `source`\n * (the declaration site, for facts that have no other home in the JSON) or `factRef`\n * (a deterministic pointer into a fact section that already carries the source inline)\n * is present, so a consumer resolves any fact's origin through this single index.\n */\nexport type ModuleFactSourceEntry = {\n kind: ModuleFactSourceKind\n id: string\n source?: ModuleFactSourceRef\n factRef?: ModuleFactIndexRef\n}\n\nexport const MODULE_FACT_DIAGNOSTIC_CODES = ['duplicate-source', 'unresolved-static-contract'] as const\n\nexport type ModuleFactDiagnosticCode = (typeof MODULE_FACT_DIAGNOSTIC_CODES)[number]\n\nexport type ModuleFactDiagnostic = {\n code: ModuleFactDiagnosticCode\n kind: ModuleFactSourceKind\n id: string\n source?: ModuleFactSourceRef\n}\n\nexport type ModuleDiRegistrationFact = {\n token: string\n registrationKind: 'function' | 'class' | 'value' | 'alias'\n providerSymbol?: string\n lifetime?: 'singleton' | 'scoped' | 'transient'\n injectionMode?: 'classic' | 'proxy'\n source: ModuleFactSourceRef\n}\n\n/**\n * How the extracted module reached the batch. `package` is the implicit default for\n * every installed `@open-mercato/*` module and never appears in emitted output, so the\n * package sidecar contract stays byte-identical. `local-reference` marks an app-local\n * module projected into the explicit reference bundle; it is an independent discriminator\n * from `sourcePackage`, which keeps its legacy \"null means core package\" meaning.\n */\nexport type ModuleFactProjectionSourceKind = 'package' | 'local-reference'\n\nexport interface ModuleFacts {\n module: string\n title: string | null\n description: string | null\n coreVersion: string | null\n sourcePackage: string | null\n sourceVersion: string | null\n sourceRoot: string\n /** Present only for `local-reference` projections; package modules omit it entirely. */\n sourceKind?: ModuleFactProjectionSourceKind\n entities: ModuleEntityFact[]\n events: ModuleEventFact[]\n aclFeatures: string[]\n apiRoutes: ModuleApiRouteFact[]\n diTokens: string[]\n searchEntities: string[]\n hostTokens: ModuleHostTokens\n notifications: string[]\n cli: string[]\n backendPages: ModulePageFact[]\n frontendPages: ModulePageFact[]\n cliCommands: ModuleCliCommandFact[]\n aiTools: ModuleAiToolFact[]\n aiAgents: ModuleAiAgentFact[]\n extensionSurfaces?: ModuleExtensionSurfaceFacts\n factSources?: ModuleFactSourceEntry[]\n ownedContracts?: ModuleOwnedContracts\n factDiagnostics?: ModuleFactDiagnostic[]\n overrideTargets?: ModuleOverrideTarget[]\n overrideTargetDiagnostics?: ModuleOverrideTargetDiagnostic[]\n warnings: string[]\n}\n\nexport interface ExtractModuleFactsOptions {\n moduleId: string\n /**\n * Parent modules directory joined with `moduleId` to locate the module source.\n * Legacy input; prefer the explicit per-module `moduleRoot` for modules that do\n * not live under a single shared root (auto-discovery). One of `moduleRoot` /\n * `coreSrcRoot` must be provided.\n */\n coreSrcRoot?: string\n /** Explicit module source directory. When set it overrides `coreSrcRoot + moduleId`. */\n moduleRoot?: string\n coreVersion?: string | null\n sourcePackage?: string | null\n sourceVersion?: string | null\n registryPath?: string | null\n registrySource?: string | null\n /**\n * App-root-relative POSIX root written into every emitted source path. Overrides the\n * default `node_modules/<package>/src/modules/<moduleId>` layout so an app-local module\n * emits `src/modules/<moduleId>` instead of a package path it does not live in.\n */\n portableSourceRoot?: string\n sourceKind?: ModuleFactProjectionSourceKind\n /** Generated-facts compatibility projection. Omitted means the corrected v2 contract. */\n factsContractVersion?: 1 | 2\n}\n\n/** A discovered module and the source directory its facts are extracted from. */\nexport interface ModuleFactSource {\n moduleId: string\n moduleRoot: string\n from?: string\n packageVersion?: string | null\n portableSourceRoot?: string\n sourceKind?: ModuleFactProjectionSourceKind\n}\n\nfunction readSourceFile(filePath: string): ts.SourceFile | null {\n if (!fs.existsSync(filePath)) return null\n const source = fs.readFileSync(filePath, 'utf8')\n const scriptKind = filePath.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS\n return ts.createSourceFile(filePath, source, ts.ScriptTarget.ES2020, true, scriptKind)\n}\n\nfunction resolveConventionFile(baseDir: string, basename: string): string | null {\n for (const extension of ['.ts', '.tsx']) {\n const candidate = path.join(baseDir, `${basename}${extension}`)\n if (fs.existsSync(candidate)) return candidate\n }\n return null\n}\n\nfunction readStringPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): string | undefined {\n for (const property of objectLiteral.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const name = ts.isIdentifier(property.name)\n ? property.name.text\n : ts.isStringLiteralLike(property.name)\n ? property.name.text\n : undefined\n if (name !== propertyName) continue\n if (ts.isStringLiteralLike(property.initializer)) return property.initializer.text\n return undefined\n }\n return undefined\n}\n\nfunction getClassDecoratorCall(node: ts.ClassDeclaration, decoratorName: string): ts.CallExpression | undefined {\n const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) ?? [] : []\n for (const decorator of decorators) {\n const expression = decorator.expression\n if (!ts.isCallExpression(expression)) continue\n if (ts.isIdentifier(expression.expression) && expression.expression.text === decoratorName) {\n return expression\n }\n }\n return undefined\n}\n\nfunction readDecoratorTableName(decoratorCall: ts.CallExpression): string | undefined {\n const firstArgument = decoratorCall.arguments[0]\n if (!firstArgument || !ts.isObjectLiteralExpression(firstArgument)) return undefined\n return readStringPropertyInitializer(firstArgument, 'tableName')\n}\n\nfunction getPropertyDecoratorName(member: ts.PropertyDeclaration): string | undefined {\n const decorators = ts.canHaveDecorators(member) ? ts.getDecorators(member) ?? [] : []\n for (const decorator of decorators) {\n const expression = decorator.expression\n if (!ts.isCallExpression(expression)) continue\n const firstArgument = expression.arguments[0]\n if (!firstArgument || !ts.isObjectLiteralExpression(firstArgument)) continue\n const columnName = readStringPropertyInitializer(firstArgument, 'name')\n if (columnName) return columnName\n }\n return undefined\n}\n\nfunction classHasUpdatedAtColumn(node: ts.ClassDeclaration): boolean {\n for (const member of node.members) {\n if (!ts.isPropertyDeclaration(member) || !member.name) continue\n const propertyName = ts.isIdentifier(member.name)\n ? member.name.text\n : ts.isStringLiteralLike(member.name)\n ? member.name.text\n : undefined\n if (propertyName === 'updatedAt') return true\n if (getPropertyDecoratorName(member) === 'updated_at') return true\n }\n return false\n}\n\nfunction readStaticAccessPath(candidate: ts.Expression): string[] | null {\n const access = unwrapExpression(candidate)\n if (ts.isIdentifier(access)) return [access.text]\n if (ts.isPropertyAccessExpression(access)) {\n const parent = readStaticAccessPath(access.expression)\n return parent ? [...parent, access.name.text] : null\n }\n if (ts.isElementAccessExpression(access) && access.argumentExpression) {\n const parent = readStaticAccessPath(access.expression)\n const key = unwrapExpression(access.argumentExpression)\n return parent && ts.isStringLiteralLike(key) ? [...parent, key.text] : null\n }\n return null\n}\n\n/**\n * Resolves an entity-id expression to its literal `module:entity` value.\n *\n * Modules reference entity ids three ways and all three are statically knowable:\n * a string literal, `E.<module>.<entity>` from the generated entity-id registry\n * (`entity-ids.ts` emits `E[module][entity] = '<module>:<entity>'`), and \u2014 when\n * `initializers` is supplied \u2014 a same-file `const ENTITY_ID = 'module:entity'`.\n * Anything else stays undefined: a guessed id is worse than a missing one.\n */\nfunction resolveEntityIdReference(\n expression: ts.Expression,\n initializers?: Map<string, ts.Expression>,\n visitedIdentifiers: Set<string> = new Set(),\n): string | undefined {\n const current = unwrapExpression(expression)\n if (ts.isStringLiteralLike(current)) return current.text\n const accessPath = readStaticAccessPath(current)\n if (accessPath?.length === 3 && accessPath[0] === 'E') {\n return `${accessPath[1]}:${accessPath[2]}`\n }\n if (initializers && ts.isIdentifier(current) && !visitedIdentifiers.has(current.text)) {\n visitedIdentifiers.add(current.text)\n const declaration = initializers.get(current.text)\n if (declaration) return resolveEntityIdReference(declaration, initializers, visitedIdentifiers)\n }\n return undefined\n}\n\nfunction collectCustomFieldEntityIds(ceFilePath: string | null): Set<string> {\n const result = new Set<string>()\n if (!ceFilePath) return result\n const sourceFile = readSourceFile(ceFilePath)\n if (!sourceFile) return result\n\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node)) {\n const initializer = getObjectPropertyInitializer(node, 'id')\n if (initializer) {\n const id = resolveEntityIdReference(initializer)\n if (id && id.includes(':')) result.add(id)\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction extractEntities(\n moduleId: string,\n entitiesFilePath: string | null,\n customFieldEntityIds: Set<string>,\n): ModuleEntityFact[] {\n const sourceFile = entitiesFilePath ? readSourceFile(entitiesFilePath) : null\n if (!sourceFile) return []\n\n const facts: ModuleEntityFact[] = []\n sourceFile.forEachChild((node) => {\n if (!ts.isClassDeclaration(node) || !node.name) return\n const isExported = node.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)\n if (!isExported) return\n const entityDecorator = getClassDecoratorCall(node, 'Entity')\n if (!entityDecorator) return\n\n const className = node.name.text\n const table = readDecoratorTableName(entityDecorator)\n if (!table) return\n\n const entityId = `${moduleId}:${toSnake(className)}`\n facts.push({\n id: entityId,\n class: className,\n table,\n editable: classHasUpdatedAtColumn(node),\n customFields: customFieldEntityIds.has(entityId),\n })\n })\n\n return facts\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression\n while (ts.isAsExpression(current) || ts.isParenthesizedExpression(current) || ts.isTypeAssertionExpression(current)) {\n current = current.expression\n }\n return current\n}\n\nfunction unwrapArrayLiteral(expression: ts.Expression): ts.ArrayLiteralExpression | null {\n const current = unwrapExpression(expression)\n return ts.isArrayLiteralExpression(current) ? current : null\n}\n\nfunction getPropertyName(property: ts.ObjectLiteralElementLike): string | undefined {\n if (!ts.isPropertyAssignment(property) && !ts.isShorthandPropertyAssignment(property)) return undefined\n const name = property.name\n if (!name) return undefined\n if (ts.isIdentifier(name)) return name.text\n if (ts.isStringLiteralLike(name)) return name.text\n // A computed key whose expression is a string literal or a same-file `const NAME = 'token'`\n // is still a statically known token. Without this, `{ [SERVICE_TOKEN]: asFunction(...) }` \u2014\n // the idiomatic, type-safe way to register a DI token from an exported const \u2014 yielded\n // undefined and the registration vanished from module facts with NO diagnostic, because the\n // unresolved-token path is only reached for a NAMED token whose Awilix kind is unrecognised.\n if (ts.isComputedPropertyName(name)) return resolveComputedPropertyKey(name.expression)\n return undefined\n}\n\n/** Resolves a computed key to its literal token when the value is statically knowable. */\nfunction resolveComputedPropertyKey(expression: ts.Expression): string | undefined {\n if (ts.isStringLiteralLike(expression)) return expression.text\n // `X as const` / `X satisfies Y` wrappers.\n if (ts.isAsExpression(expression) || ts.isSatisfiesExpression(expression)) {\n return resolveComputedPropertyKey(expression.expression)\n }\n if (ts.isParenthesizedExpression(expression)) return resolveComputedPropertyKey(expression.expression)\n if (!ts.isIdentifier(expression)) return undefined\n const sourceFile = expression.getSourceFile()\n if (!sourceFile) return undefined\n let resolved: string | undefined\n const visit = (node: ts.Node): void => {\n if (resolved) return\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.name.text === expression.text) {\n if (node.initializer) resolved = resolveComputedPropertyKey(node.initializer)\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return resolved\n}\n\nfunction getObjectPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): ts.Expression | undefined {\n for (const property of objectLiteral.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n if (getPropertyName(property) === propertyName) return property.initializer\n }\n return undefined\n}\n\nfunction findObjectLiteralDeclaration(\n sourceFile: ts.SourceFile,\n variableName: string,\n): ts.ObjectLiteralExpression | null {\n let result: ts.ObjectLiteralExpression | null = null\n const visit = (node: ts.Node): void => {\n if (result) return\n if (\n ts.isVariableDeclaration(node) &&\n ts.isIdentifier(node.name) &&\n node.name.text === variableName &&\n node.initializer\n ) {\n const unwrapped = unwrapExpression(node.initializer)\n if (ts.isObjectLiteralExpression(unwrapped)) {\n result = unwrapped\n return\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction buildVariableInitializerMap(sourceFile: ts.SourceFile): Map<string, ts.Expression> {\n const initializers = new Map<string, ts.Expression>()\n const visit = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n if (!initializers.has(node.name.text)) initializers.set(node.name.text, node.initializer)\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return initializers\n}\n\nfunction resolveToObjectLiteral(\n expression: ts.Expression,\n initializers: Map<string, ts.Expression>,\n): ts.ObjectLiteralExpression | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isObjectLiteralExpression(unwrapped)) return unwrapped\n if (ts.isIdentifier(unwrapped)) {\n const referenced = initializers.get(unwrapped.text)\n if (referenced) return resolveToObjectLiteral(referenced, initializers)\n }\n return null\n}\n\nfunction resolveToArrayLiteral(\n expression: ts.Expression,\n initializers: Map<string, ts.Expression>,\n): ts.ArrayLiteralExpression | null {\n const unwrapped = unwrapExpression(expression)\n if (ts.isArrayLiteralExpression(unwrapped)) return unwrapped\n if (ts.isIdentifier(unwrapped)) {\n const referenced = initializers.get(unwrapped.text)\n if (referenced) return resolveToArrayLiteral(referenced, initializers)\n }\n return null\n}\n\nfunction findDefaultExportExpression(sourceFile: ts.SourceFile): ts.Expression | null {\n for (const statement of sourceFile.statements) {\n if (ts.isExportAssignment(statement) && !statement.isExportEquals) return statement.expression\n }\n return null\n}\n\nfunction findArrayLiteralDeclaration(\n sourceFile: ts.SourceFile,\n variableName: string,\n): ts.ArrayLiteralExpression | null {\n let result: ts.ArrayLiteralExpression | null = null\n const visit = (node: ts.Node): void => {\n if (result) return\n if (\n ts.isVariableDeclaration(node) &&\n ts.isIdentifier(node.name) &&\n node.name.text === variableName &&\n node.initializer\n ) {\n const arrayLiteral = unwrapArrayLiteral(node.initializer)\n if (arrayLiteral) {\n result = arrayLiteral\n return\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return result\n}\n\nfunction extractEvents(eventsFilePath: string | null): ModuleEventFact[] {\n const sourceFile = eventsFilePath ? readSourceFile(eventsFilePath) : null\n if (!sourceFile) return []\n\n const eventsArray = findArrayLiteralDeclaration(sourceFile, 'events')\n if (!eventsArray) return []\n\n const facts: ModuleEventFact[] = []\n for (const element of eventsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const id = readStringPropertyInitializer(element, 'id')\n if (!id) continue\n const label = readStringPropertyInitializer(element, 'label')\n const category = readStringPropertyInitializer(element, 'category')\n const entity = readStringPropertyInitializer(element, 'entity')\n const fact: ModuleEventFact = {\n id,\n category: category ?? null,\n entity: entity ?? null,\n }\n const clientBroadcast = readBooleanPropertyInitializer(element, 'clientBroadcast')\n const portalBroadcast = readBooleanPropertyInitializer(element, 'portalBroadcast')\n if (label !== undefined) fact.label = label\n if (clientBroadcast !== undefined) fact.clientBroadcast = clientBroadcast\n if (portalBroadcast !== undefined) fact.portalBroadcast = portalBroadcast\n facts.push(fact)\n }\n\n return facts\n}\n\nfunction extractAclFeatures(aclFilePath: string | null): string[] {\n const sourceFile = aclFilePath ? readSourceFile(aclFilePath) : null\n if (!sourceFile) return []\n\n const featuresArray = findArrayLiteralDeclaration(sourceFile, 'features')\n if (!featuresArray) return []\n\n const featureIds: string[] = []\n const seen = new Set<string>()\n for (const element of featuresArray.elements) {\n let featureId: string | undefined\n if (ts.isObjectLiteralExpression(element)) {\n featureId = readStringPropertyInitializer(element, 'id')\n } else if (ts.isStringLiteralLike(element)) {\n featureId = element.text\n }\n if (!featureId || seen.has(featureId)) continue\n seen.add(featureId)\n featureIds.push(featureId)\n }\n\n return featureIds\n}\n\nfunction readBooleanPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): boolean | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n if (initializer.kind === ts.SyntaxKind.TrueKeyword) return true\n if (initializer.kind === ts.SyntaxKind.FalseKeyword) return false\n return undefined\n}\n\nfunction readStringArrayPropertyInitializer(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n): string[] | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n const arrayLiteral = unwrapArrayLiteral(initializer)\n if (!arrayLiteral) return undefined\n const values: string[] = []\n for (const element of arrayLiteral.elements) {\n if (ts.isStringLiteralLike(element)) values.push(element.text)\n }\n return values\n}\n\nfunction parseApiRouteAuthRule(metadataLiteral: ts.ObjectLiteralExpression): ApiRouteAuthRule {\n const rule: ApiRouteAuthRule = {}\n const requireAuth = readBooleanPropertyInitializer(metadataLiteral, 'requireAuth')\n if (requireAuth !== undefined) rule.requireAuth = requireAuth\n const requireFeatures = readStringArrayPropertyInitializer(metadataLiteral, 'requireFeatures')\n if (requireFeatures && requireFeatures.length > 0) rule.requireFeatures = requireFeatures\n const requireRoles = readStringArrayPropertyInitializer(metadataLiteral, 'requireRoles')\n if (requireRoles && requireRoles.length > 0) rule.requireRoles = requireRoles\n return rule\n}\n\nfunction parseApiRouteEntry(entryLiteral: ts.ObjectLiteralExpression): ModuleApiRouteFact | null {\n const routePath = readStringPropertyInitializer(entryLiteral, 'path')\n if (!routePath) return null\n\n const methods: string[] = []\n const seenMethods = new Set<string>()\n const handlersInitializer = getObjectPropertyInitializer(entryLiteral, 'handlers')\n if (handlersInitializer && ts.isObjectLiteralExpression(handlersInitializer)) {\n for (const property of handlersInitializer.properties) {\n const methodName = getPropertyName(property)\n if (methodName && !seenMethods.has(methodName)) {\n seenMethods.add(methodName)\n methods.push(methodName)\n }\n }\n } else {\n const singleMethod = readStringPropertyInitializer(entryLiteral, 'method')\n if (singleMethod && !seenMethods.has(singleMethod)) {\n seenMethods.add(singleMethod)\n methods.push(singleMethod)\n }\n }\n\n const auth: Record<string, ApiRouteAuthRule> = {}\n const metadataInitializer = getObjectPropertyInitializer(entryLiteral, 'metadata')\n if (metadataInitializer && ts.isObjectLiteralExpression(metadataInitializer)) {\n for (const property of metadataInitializer.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const methodName = getPropertyName(property)\n if (!methodName) continue\n const methodMetadata = unwrapExpression(property.initializer)\n if (!ts.isObjectLiteralExpression(methodMetadata)) continue\n auth[methodName] = parseApiRouteAuthRule(methodMetadata)\n if (!seenMethods.has(methodName)) {\n seenMethods.add(methodName)\n methods.push(methodName)\n }\n }\n }\n\n return { path: routePath, methods, auth, sourcePath: null }\n}\n\nfunction extractApiRoutes(\n moduleId: string,\n registrySource: string | null,\n registryDescription: string,\n routeSourcePaths: ReadonlyMap<string, string>,\n warnings: string[],\n): ModuleApiRouteFact[] {\n if (registrySource == null) {\n warnings.push(`[module-facts] module registry unavailable (${registryDescription}); API route auth omitted for ${moduleId}`)\n return []\n }\n\n const sourceFile = ts.createSourceFile(\n 'module-registry.generated.ts',\n registrySource,\n ts.ScriptTarget.ES2020,\n true,\n ts.ScriptKind.TS,\n )\n\n const routes: ModuleApiRouteFact[] = []\n const seenPaths = new Set<string>()\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node) && readStringPropertyInitializer(node, 'id') === moduleId) {\n const apisInitializer = getObjectPropertyInitializer(node, 'apis')\n const apisArray = apisInitializer ? unwrapArrayLiteral(apisInitializer) : null\n if (apisArray) {\n for (const element of apisArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const route = parseApiRouteEntry(element)\n if (route && !seenPaths.has(route.path)) {\n seenPaths.add(route.path)\n routes.push({ ...route, sourcePath: routeSourcePaths.get(route.path) ?? null })\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return routes\n}\n\nfunction resolveRegistrySource(options: ExtractModuleFactsOptions): { source: string | null; description: string } {\n if (typeof options.registrySource === 'string') {\n return { source: options.registrySource, description: 'registrySource' }\n }\n if (options.registryPath) {\n if (!fs.existsSync(options.registryPath)) {\n return { source: null, description: options.registryPath }\n }\n return { source: fs.readFileSync(options.registryPath, 'utf8'), description: options.registryPath }\n }\n return { source: null, description: 'registryPath not provided' }\n}\n\nfunction detectAwilixRegistrationKind(expression: ts.Expression): string | null {\n let current: ts.Expression = unwrapExpression(expression)\n while (ts.isCallExpression(current)) {\n const callee = current.expression\n if (ts.isIdentifier(callee)) return callee.text\n if (ts.isPropertyAccessExpression(callee)) {\n current = callee.expression\n continue\n }\n break\n }\n return null\n}\n\nfunction extractDiTokens(diFilePath: string | null): string[] {\n if (!diFilePath) return []\n const sourceFile = readSourceFile(diFilePath)\n if (!sourceFile) return []\n\n const tokens: string[] = []\n const seen = new Set<string>()\n const visit = (node: ts.Node): void => {\n if (\n ts.isCallExpression(node) &&\n ts.isPropertyAccessExpression(node.expression) &&\n node.expression.name.text === 'register'\n ) {\n const argument = node.arguments[0]\n if (argument && ts.isObjectLiteralExpression(argument)) {\n for (const property of argument.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const kind = detectAwilixRegistrationKind(property.initializer)\n if (kind !== 'asFunction' && kind !== 'asClass') continue\n const tokenName = getPropertyName(property)\n if (tokenName && !seen.has(tokenName)) {\n seen.add(tokenName)\n tokens.push(tokenName)\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return tokens\n}\n\nfunction extractSearchEntities(searchFilePath: string | null, warnings: string[]): string[] {\n if (!searchFilePath) return []\n const sourceFile = readSourceFile(searchFilePath)\n if (!sourceFile) return []\n\n const searchConfig = findObjectLiteralDeclaration(sourceFile, 'searchConfig')\n if (!searchConfig) {\n warnings.push(`[module-facts] search.ts present but no searchConfig object literal: ${searchFilePath}`)\n return []\n }\n const entitiesInitializer = getObjectPropertyInitializer(searchConfig, 'entities')\n const entitiesArray = entitiesInitializer ? unwrapArrayLiteral(entitiesInitializer) : null\n if (!entitiesArray) {\n warnings.push(`[module-facts] searchConfig.entities is not an array literal: ${searchFilePath}`)\n return []\n }\n\n // `entityId` is rarely a bare string literal: modules reference the entity through\n // `E.<module>.<entity>` or a same-file `const ENTITY_ID`. Reading only string literals\n // dropped every such entry with NO diagnostic, so a module shipping `search.ts` scored\n // zero search facts while looking healthy. Unresolvable entries now warn instead.\n const initializers = buildVariableInitializerMap(sourceFile)\n const entityIds: string[] = []\n const seen = new Set<string>()\n for (const element of entitiesArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const initializer = getObjectPropertyInitializer(element, 'entityId')\n const location = `${searchFilePath}:${nodeLine(sourceFile, element)}`\n if (!initializer) {\n warnings.push(`[module-facts] searchConfig entity declares no entityId: ${location}`)\n continue\n }\n const entityId = resolveEntityIdReference(initializer, initializers)\n if (!entityId) {\n warnings.push(`[module-facts] searchConfig entityId is not statically resolvable: ${location}`)\n continue\n }\n if (seen.has(entityId)) continue\n seen.add(entityId)\n entityIds.push(entityId)\n }\n return entityIds\n}\n\nfunction extractNotifications(notificationsFilePath: string | null, warnings: string[]): string[] {\n if (!notificationsFilePath) return []\n const sourceFile = readSourceFile(notificationsFilePath)\n if (!sourceFile) return []\n\n const notificationsArray =\n findArrayLiteralDeclaration(sourceFile, 'notificationTypes') ??\n findArrayLiteralDeclaration(sourceFile, 'notifications')\n if (!notificationsArray) {\n warnings.push(`[module-facts] notifications.ts present but no notificationTypes array literal: ${notificationsFilePath}`)\n return []\n }\n\n const notificationIds: string[] = []\n const seen = new Set<string>()\n for (const element of notificationsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const notificationId = readStringPropertyInitializer(element, 'type')\n if (notificationId && !seen.has(notificationId)) {\n seen.add(notificationId)\n notificationIds.push(notificationId)\n }\n }\n return notificationIds\n}\n\nfunction extractCli(cliFilePath: string | null, warnings: string[]): string[] {\n if (!cliFilePath) return []\n const sourceFile = readSourceFile(cliFilePath)\n if (!sourceFile) return []\n\n const defaultExport = findDefaultExportExpression(sourceFile)\n if (!defaultExport) {\n warnings.push(`[module-facts] cli.ts present but no default export: ${cliFilePath}`)\n return []\n }\n\n const initializers = buildVariableInitializerMap(sourceFile)\n const collectCommand = (objectLiteral: ts.ObjectLiteralExpression): string | undefined =>\n readStringPropertyInitializer(objectLiteral, 'command')\n\n const commands: string[] = []\n const seen = new Set<string>()\n const pushCommand = (command: string | undefined): void => {\n if (command && !seen.has(command)) {\n seen.add(command)\n commands.push(command)\n }\n }\n\n const arrayLiteral = resolveToArrayLiteral(defaultExport, initializers)\n if (arrayLiteral) {\n for (const element of arrayLiteral.elements) {\n const objectLiteral = resolveToObjectLiteral(element, initializers)\n if (objectLiteral) pushCommand(collectCommand(objectLiteral))\n }\n return commands\n }\n\n const singleObject = resolveToObjectLiteral(defaultExport, initializers)\n if (singleObject) {\n pushCommand(collectCommand(singleObject))\n return commands\n }\n\n warnings.push(`[module-facts] cli.ts default export is neither an array nor an object literal: ${cliFilePath}`)\n return commands\n}\n\nfunction listSourceFilesRecursive(directory: string): string[] {\n const files: string[] = []\n for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {\n if (entry.name === '__tests__' || entry.name === '__mocks__' || entry.name === 'node_modules') continue\n const fullPath = path.join(directory, entry.name)\n if (entry.isDirectory()) {\n files.push(...listSourceFilesRecursive(fullPath))\n } else if (\n /\\.tsx?$/.test(entry.name)\n && !entry.name.endsWith('.d.ts')\n && !/\\.(?:test|spec)\\.tsx?$/.test(entry.name)\n ) {\n files.push(fullPath)\n }\n }\n return files\n}\n\nfunction toPortableSourceRoot(moduleId: string, sourcePackage: string | null): string {\n return path.posix.join('node_modules', sourcePackage ?? '@open-mercato/core', 'src', 'modules', moduleId)\n}\n\n/**\n * An explicit portable root must stay app-root-relative and POSIX-shaped: every emitted\n * fact path and markdown link is resolved against the generated app root, so an absolute\n * path, a Windows separator, or a traversal segment would emit an unclickable or\n * machine-specific reference into a distributed artifact.\n */\nexport function assertPortableSourceRoot(moduleId: string, portableSourceRoot: string): string {\n const invalid = portableSourceRoot.length === 0\n || path.posix.isAbsolute(portableSourceRoot)\n || /^[A-Za-z]:/.test(portableSourceRoot)\n || portableSourceRoot.includes('\\\\')\n || portableSourceRoot.split('/').includes('..')\n if (invalid) {\n throw new Error(\n `[module-facts] portableSourceRoot for module \"${moduleId}\" must be a relative POSIX app path, received \"${portableSourceRoot}\"`,\n )\n }\n return portableSourceRoot\n}\n\nfunction toPortableSourcePath(moduleRoot: string, sourceRoot: string, filePath: string): string {\n const relativePath = path.relative(moduleRoot, filePath).split(path.sep).join('/')\n return path.posix.join(sourceRoot, relativePath)\n}\n\nfunction sourceHasDefaultExport(sourceFile: ts.SourceFile): boolean {\n return sourceFile.statements.some((statement) => {\n if (ts.isExportAssignment(statement) && !statement.isExportEquals) return true\n if (!ts.isFunctionDeclaration(statement) && !ts.isClassDeclaration(statement)) return false\n return statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword) ?? false\n })\n}\n\nfunction readRouteMetadataPath(sourceFile: ts.SourceFile): string | null {\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n return metadata ? readStringPropertyInitializer(metadata, 'path') ?? null : null\n}\n\nfunction extractApiRouteSourcePaths(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n): Map<string, string> {\n const apiRoot = path.join(moduleRoot, 'api')\n const sources = new Map<string, string>()\n if (!fs.existsSync(apiRoot)) return sources\n const methodDirectories = new Set(['get', 'post', 'put', 'patch', 'delete'])\n\n for (const filePath of listSourceFilesRecursive(apiRoot)) {\n const relativePath = path.relative(apiRoot, filePath).split(path.sep).join('/')\n const segments = relativePath.split('/')\n const fileName = segments.pop() as string\n const fileStem = fileName.replace(/\\.tsx?$/, '')\n let routeSegments: string[]\n if (fileStem === 'route') {\n routeSegments = segments\n } else if (segments[0] && methodDirectories.has(segments[0].toLowerCase())) {\n routeSegments = [...segments.slice(1), fileStem]\n } else {\n routeSegments = [...segments, fileStem]\n }\n const defaultPath = `/${[moduleId, ...routeSegments].filter(Boolean).join('/')}`\n const sourceFile = readSourceFile(filePath)\n const routePath = sourceFile ? readRouteMetadataPath(sourceFile) ?? defaultPath : defaultPath\n sources.set(routePath, toPortableSourcePath(moduleRoot, sourceRoot, filePath))\n }\n return sources\n}\n\nfunction extractModulePages(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n surface: 'backend' | 'frontend',\n): ModulePageFact[] {\n const pageRoot = path.join(moduleRoot, surface)\n if (!fs.existsSync(pageRoot)) return []\n const pages: ModulePageFact[] = []\n const seen = new Set<string>()\n\n for (const filePath of listSourceFilesRecursive(pageRoot)) {\n if (!filePath.endsWith('.tsx')) continue\n const relativePath = path.relative(pageRoot, filePath).split(path.sep).join('/')\n const segments = relativePath.split('/')\n const fileName = segments.pop() as string\n const fileStem = fileName.replace(/\\.tsx$/, '')\n const isModernPage = fileStem === 'page'\n if (!isModernPage && (fileStem === 'meta' || fileStem.endsWith('.meta') || /^[A-Z]/.test(fileStem))) continue\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile || !sourceHasDefaultExport(sourceFile)) continue\n const routeSegments = isModernPage ? segments : [...segments, fileStem]\n const routePath = surface === 'frontend'\n ? `/${routeSegments.filter(Boolean).join('/')}`\n : isModernPage\n ? `/backend/${routeSegments.join('/') || moduleId}`\n : `/backend/${routeSegments[0] === moduleId\n ? routeSegments.filter(Boolean).join('/')\n : [moduleId, ...routeSegments].filter(Boolean).join('/')}`\n if (seen.has(routePath)) continue\n seen.add(routePath)\n const metadataFilePath = resolvePageMetadataFile(path.dirname(filePath))\n const metadataSourceFile = metadataFilePath ? readSourceFile(metadataFilePath) : sourceFile\n const metadata = metadataSourceFile ? readPageMetadata(metadataSourceFile) : undefined\n pages.push({\n path: routePath,\n sourcePath: toPortableSourcePath(moduleRoot, sourceRoot, filePath),\n ...(metadataFilePath\n ? { metadataSourcePath: toPortableSourcePath(moduleRoot, sourceRoot, metadataFilePath) }\n : {}),\n ...(metadata ? { metadata } : {}),\n })\n }\n return pages.sort((left, right) => left.path.localeCompare(right.path))\n}\n\nfunction findAncestorVariableDeclaration(node: ts.Node): ts.VariableDeclaration | null {\n let current: ts.Node | undefined = node.parent\n while (current) {\n if (ts.isVariableDeclaration(current)) return current\n current = current.parent\n }\n return null\n}\n\nfunction findAncestorCallExpression(node: ts.Node): ts.CallExpression | null {\n let current: ts.Node | undefined = node.parent\n while (current) {\n if (ts.isCallExpression(current)) return current\n if (ts.isVariableDeclaration(current) || ts.isStatement(current)) return null\n current = current.parent\n }\n return null\n}\n\nfunction extractNamedAiFacts(\n filePaths: readonly string[],\n moduleRoot: string,\n sourceRoot: string,\n propertyName: 'name' | 'id',\n): Array<{ value: string; sourcePath: string }> {\n const facts: Array<{ value: string; sourcePath: string }> = []\n const seen = new Set<string>()\n for (const filePath of filePaths) {\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const initializers = buildVariableInitializerMap(sourceFile)\n const readDefinitionValue = (objectLiteral: ts.ObjectLiteralExpression): string | undefined => {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n const resolved = unwrapExpression(initializer)\n if (ts.isStringLiteralLike(resolved)) return resolved.text\n if (ts.isIdentifier(resolved)) {\n const declarationInitializer = initializers.get(resolved.text)\n if (declarationInitializer) {\n const declarationValue = unwrapExpression(declarationInitializer)\n if (ts.isStringLiteralLike(declarationValue)) return declarationValue.text\n }\n }\n return undefined\n }\n const visit = (node: ts.Node): void => {\n if (ts.isObjectLiteralExpression(node)) {\n const value = readDefinitionValue(node)\n if (value && !seen.has(value)) {\n const declaration = findAncestorVariableDeclaration(node)\n const declarationName = declaration && ts.isIdentifier(declaration.name) ? declaration.name.text : ''\n const declarationType = declaration?.type?.getText(sourceFile) ?? ''\n const call = findAncestorCallExpression(node)\n const callee = call?.expression.getText(sourceFile) ?? ''\n const isDefinition = propertyName === 'name'\n ? /AiTool/.test(declarationType) || /tool$/i.test(declarationName) || /AiTool/.test(callee)\n : /AiAgentDefinition/.test(declarationType) || /agent$/i.test(declarationName) || /defineAiAgent/.test(callee)\n if (isDefinition) {\n seen.add(value)\n facts.push({\n value,\n sourcePath: toPortableSourcePath(moduleRoot, sourceRoot, filePath),\n })\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n }\n return facts.sort((left, right) => left.value.localeCompare(right.value))\n}\n\nfunction extractAiTools(moduleRoot: string, sourceRoot: string): ModuleAiToolFact[] {\n const files = new Set<string>()\n const rootFile = resolveConventionFile(moduleRoot, 'ai-tools')\n if (rootFile) files.add(rootFile)\n const toolsDirectory = path.join(moduleRoot, 'ai-tools')\n if (fs.existsSync(toolsDirectory)) {\n for (const filePath of listSourceFilesRecursive(toolsDirectory)) files.add(filePath)\n }\n return extractNamedAiFacts([...files], moduleRoot, sourceRoot, 'name')\n .map((fact) => ({ name: fact.value, sourcePath: fact.sourcePath }))\n}\n\nfunction extractAiAgents(moduleRoot: string, sourceRoot: string): ModuleAiAgentFact[] {\n const agentsFile = resolveConventionFile(moduleRoot, 'ai-agents')\n if (!agentsFile) return []\n return extractNamedAiFacts([agentsFile], moduleRoot, sourceRoot, 'id')\n .map((fact) => ({ id: fact.value, sourcePath: fact.sourcePath }))\n}\n\nfunction extractTableIds(moduleRoot: string): string[] {\n if (!fs.existsSync(moduleRoot)) return []\n\n const tableIds: string[] = []\n const seen = new Set<string>()\n const collectLiteralValues = (expression: ts.Expression): string[] => {\n const current = unwrapExpression(expression)\n if (ts.isStringLiteralLike(current)) return [current.text]\n if (ts.isConditionalExpression(current)) {\n return [\n ...collectLiteralValues(current.whenTrue),\n ...collectLiteralValues(current.whenFalse),\n ]\n }\n return []\n }\n\n for (const filePath of listSourceFilesRecursive(moduleRoot)) {\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node)) {\n const propertyName = getPropertyName(node)\n if (propertyName === 'tableId' || propertyName === 'extensionTableId') {\n for (const value of collectLiteralValues(node.initializer)) {\n if (value && !seen.has(value)) {\n seen.add(value)\n tableIds.push(value)\n }\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n }\n tableIds.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))\n return tableIds\n}\n\nfunction extractHostEntityIds(entities: ModuleEntityFact[]): string[] {\n return entities.filter((entity) => entity.id.endsWith('_entity')).map((entity) => entity.id)\n}\n\nfunction extractModuleMeta(indexFilePath: string | null): { title: string | null; description: string | null } {\n if (!indexFilePath) return { title: null, description: null }\n const sourceFile = readSourceFile(indexFilePath)\n if (!sourceFile) return { title: null, description: null }\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) return { title: null, description: null }\n return {\n title: readStringPropertyInitializer(metadata, 'title') ?? null,\n description: readStringPropertyInitializer(metadata, 'description') ?? null,\n }\n}\n\nfunction nodeLine(sourceFile: ts.SourceFile, node: ts.Node): number {\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1\n}\n\nfunction readPropertyNameText(name: ts.PropertyName): string | undefined {\n if (ts.isIdentifier(name) || ts.isStringLiteralLike(name)) return name.text\n return undefined\n}\n\nfunction readMethodBearingPropertyNames(objectLiteral: ts.ObjectLiteralExpression): string[] {\n const names: string[] = []\n for (const property of objectLiteral.properties) {\n if (ts.isMethodDeclaration(property)) {\n const name = readPropertyNameText(property.name)\n if (name) names.push(name)\n continue\n }\n if (ts.isPropertyAssignment(property)) {\n const name = readPropertyNameText(property.name)\n if (!name) continue\n const initializer = unwrapExpression(property.initializer)\n if (ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer)) names.push(name)\n }\n }\n return names.sort((left, right) => left.localeCompare(right))\n}\n\nfunction readObjectKeyNames(objectLiteral: ts.ObjectLiteralExpression): string[] {\n const names: string[] = []\n for (const property of objectLiteral.properties) {\n const name = getPropertyName(property)\n if (name) names.push(name)\n }\n return names.sort((left, right) => left.localeCompare(right))\n}\n\nfunction mapDiRegistrationKind(base: string | null): ModuleDiRegistrationFact['registrationKind'] | null {\n switch (base) {\n case 'asFunction':\n return 'function'\n case 'asClass':\n return 'class'\n case 'asValue':\n return 'value'\n case 'aliasTo':\n return 'alias'\n default:\n return null\n }\n}\n\nfunction readDiChainMetadata(initializer: ts.Expression): {\n lifetime?: ModuleDiRegistrationFact['lifetime']\n injectionMode?: ModuleDiRegistrationFact['injectionMode']\n} {\n const result: {\n lifetime?: ModuleDiRegistrationFact['lifetime']\n injectionMode?: ModuleDiRegistrationFact['injectionMode']\n } = {}\n let current: ts.Expression = unwrapExpression(initializer)\n while (ts.isCallExpression(current) && ts.isPropertyAccessExpression(current.expression)) {\n const method = current.expression.name.text\n if ((method === 'singleton' || method === 'scoped' || method === 'transient') && !result.lifetime) {\n result.lifetime = method\n } else if (method === 'proxy' && !result.injectionMode) {\n result.injectionMode = 'proxy'\n } else if (method === 'classic' && !result.injectionMode) {\n result.injectionMode = 'classic'\n }\n current = unwrapExpression(current.expression.expression)\n }\n return result\n}\n\nfunction readDiProviderSymbol(\n initializer: ts.Expression,\n kind: ModuleDiRegistrationFact['registrationKind'],\n): string | undefined {\n let current: ts.Expression = unwrapExpression(initializer)\n while (ts.isCallExpression(current) && ts.isPropertyAccessExpression(current.expression)) {\n current = unwrapExpression(current.expression.expression)\n }\n if (!ts.isCallExpression(current)) return undefined\n const argument = current.arguments[0]\n if (!argument) return undefined\n if (kind === 'value') return undefined\n if (kind === 'alias' && ts.isStringLiteralLike(argument)) return argument.text\n if ((kind === 'function' || kind === 'class') && ts.isIdentifier(argument)) return argument.text\n return undefined\n}\n\nfunction extractDiRegistrationFacts(\n diFilePath: string | null,\n sourcePath: string,\n): { facts: ModuleDiRegistrationFact[]; unresolvedTokens: string[] } {\n if (!diFilePath) return { facts: [], unresolvedTokens: [] }\n const sourceFile = readSourceFile(diFilePath)\n if (!sourceFile) return { facts: [], unresolvedTokens: [] }\n\n const facts: ModuleDiRegistrationFact[] = []\n const unresolvedTokens: string[] = []\n const visit = (node: ts.Node): void => {\n if (\n ts.isCallExpression(node) &&\n ts.isPropertyAccessExpression(node.expression) &&\n node.expression.name.text === 'register'\n ) {\n const argument = node.arguments[0]\n if (argument && ts.isObjectLiteralExpression(argument)) {\n for (const property of argument.properties) {\n if (!ts.isPropertyAssignment(property)) continue\n const token = getPropertyName(property)\n if (!token) continue\n const kind = mapDiRegistrationKind(detectAwilixRegistrationKind(property.initializer))\n if (!kind) {\n if (!unresolvedTokens.includes(token)) unresolvedTokens.push(token)\n continue\n }\n const chain = readDiChainMetadata(property.initializer)\n const providerSymbol = readDiProviderSymbol(property.initializer, kind)\n facts.push({\n token,\n registrationKind: kind,\n ...(providerSymbol ? { providerSymbol } : {}),\n ...(chain.lifetime ? { lifetime: chain.lifetime } : {}),\n ...(chain.injectionMode ? { injectionMode: chain.injectionMode } : {}),\n source: { sourcePath, exportName: token, line: nodeLine(sourceFile, property) },\n })\n }\n }\n }\n node.forEachChild(visit)\n }\n sourceFile.forEachChild(visit)\n return { facts, unresolvedTokens }\n}\n\nfunction deriveLegacyDiTokens(facts: readonly ModuleDiRegistrationFact[]): string[] {\n const tokens: string[] = []\n const seen = new Set<string>()\n for (const fact of facts) {\n if (fact.registrationKind !== 'function' && fact.registrationKind !== 'class') continue\n if (seen.has(fact.token)) continue\n seen.add(fact.token)\n tokens.push(fact.token)\n }\n return tokens\n}\n\nfunction dedupeOwnedContractFacts(facts: readonly ModuleOwnedContractFact[]): ModuleOwnedContractFact[] {\n const byId = new Map<string, ModuleOwnedContractFact>()\n for (const fact of facts) {\n const existing = byId.get(fact.id)\n if (!existing) {\n byId.set(fact.id, fact)\n continue\n }\n if (fact.source.sourcePath.localeCompare(existing.source.sourcePath) < 0) byId.set(fact.id, fact)\n }\n return [...byId.values()].sort((left, right) => left.id.localeCompare(right.id))\n}\n\nconst PAGE_CONTEXT_VALUES = new Set(['main', 'admin', 'settings', 'profile'])\n\nfunction readAliasedStringProperty(\n metadata: ts.ObjectLiteralExpression,\n preferred: string,\n fallback: string,\n): string | undefined {\n return readStringPropertyInitializer(metadata, preferred) ?? readStringPropertyInitializer(metadata, fallback)\n}\n\nfunction readNumericProperty(metadata: ts.ObjectLiteralExpression, propertyName: string): number | undefined {\n const initializer = getObjectPropertyInitializer(metadata, propertyName)\n if (!initializer || !ts.isNumericLiteral(initializer)) return undefined\n return Number(initializer.text)\n}\n\nfunction readPageMetadata(sourceFile: ts.SourceFile): ModulePageMetadata | undefined {\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) return undefined\n const result: ModulePageMetadata = {}\n const requireAuth = readBooleanPropertyInitializer(metadata, 'requireAuth')\n if (requireAuth !== undefined) result.requireAuth = requireAuth\n const requireCustomerAuth = readBooleanPropertyInitializer(metadata, 'requireCustomerAuth')\n if (requireCustomerAuth !== undefined) result.requireCustomerAuth = requireCustomerAuth\n const requireFeatures = readStringArrayPropertyInitializer(metadata, 'requireFeatures')\n if (requireFeatures && requireFeatures.length > 0) result.requireFeatures = requireFeatures\n const requireCustomerFeatures = readStringArrayPropertyInitializer(metadata, 'requireCustomerFeatures')\n if (requireCustomerFeatures && requireCustomerFeatures.length > 0) {\n result.requireCustomerFeatures = requireCustomerFeatures\n }\n const navHidden = readBooleanPropertyInitializer(metadata, 'navHidden')\n if (navHidden !== undefined) result.navHidden = navHidden\n const navGroup = readAliasedStringProperty(metadata, 'pageGroup', 'group')\n if (navGroup) result.navGroup = navGroup\n const navGroupKey = readAliasedStringProperty(metadata, 'pageGroupKey', 'groupKey')\n if (navGroupKey) result.navGroupKey = navGroupKey\n const navOrder = readNumericProperty(metadata, 'pageOrder') ?? readNumericProperty(metadata, 'order')\n if (navOrder !== undefined) result.navOrder = navOrder\n const pageContext = readStringPropertyInitializer(metadata, 'pageContext')\n if (pageContext && PAGE_CONTEXT_VALUES.has(pageContext)) {\n result.pageContext = pageContext as ModulePageMetadata['pageContext']\n }\n return Object.keys(result).length > 0 ? result : undefined\n}\n\n/**\n * Mirrors the runtime companion-file convention: a page's metadata comes from\n * `page.meta.*` (or `meta.*`) in the page directory when one exists, and only\n * otherwise from the page component itself.\n */\nfunction resolvePageMetadataFile(pageDirectory: string): string | null {\n for (const baseName of ['page.meta', 'meta']) {\n for (const extension of MODULE_CODE_EXTENSIONS) {\n const candidate = path.join(pageDirectory, `${baseName}${extension}`)\n if (fs.existsSync(candidate)) return candidate\n }\n }\n return null\n}\n\nfunction extractModuleMetadataContract(\n indexFilePath: string | null,\n moduleId: string,\n sourcePath: string | null,\n): ModuleOwnedContractFact | null {\n if (!indexFilePath || !sourcePath) return null\n const sourceFile = readSourceFile(indexFilePath)\n if (!sourceFile) return null\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) return null\n const facts: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n const name = readStringPropertyInitializer(metadata, 'name')\n if (name) facts.name = name\n const version = readStringPropertyInitializer(metadata, 'version')\n if (version) facts.version = version\n const requires = readStringArrayPropertyInitializer(metadata, 'requires')\n if (requires && requires.length > 0) facts.requires = requires\n const ejectable = readBooleanPropertyInitializer(metadata, 'ejectable')\n if (ejectable !== undefined) facts.ejectable = ejectable\n return {\n kind: 'module-metadata',\n id: moduleId,\n source: { sourcePath, exportName: 'metadata', line: nodeLine(sourceFile, metadata) },\n ...(Object.keys(facts).length > 0 ? { metadata: facts } : {}),\n }\n}\n\nfunction extractCommandContractCandidates(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n): Array<{ id: string; sourcePath: string }> {\n const commandsRoot = path.join(moduleRoot, 'commands')\n if (!fs.existsSync(commandsRoot)) return []\n const candidates: Array<{ id: string; sourcePath: string }> = []\n for (const filePath of listSourceFilesRecursive(commandsRoot)) {\n if (path.basename(filePath).replace(/\\.tsx?$/, '') === 'interceptors') continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n for (const id of extractCommandIdsFromSource(filePath)) candidates.push({ id, sourcePath })\n }\n return candidates\n}\n\n/**\n * Runtime worker id: `metadata.id` when declared, otherwise the path-derived\n * `<moduleId>:workers:<...segments>:<fileStem>` that `discoverWorkers` builds.\n */\nfunction deriveWorkerId(moduleId: string, workersRoot: string, filePath: string): string {\n const relativePath = path.relative(workersRoot, filePath).split(path.sep).join('/')\n const segments = relativePath.split('/')\n const fileName = segments.pop() as string\n const fileStem = fileName.replace(/\\.tsx?$/, '')\n return [moduleId, 'workers', ...segments, fileStem].filter(Boolean).join(':')\n}\n\n/** Resolves a string property directly or through a local `const` in the same file. */\nfunction readResolvedStringProperty(\n objectLiteral: ts.ObjectLiteralExpression,\n propertyName: string,\n initializers: Map<string, ts.Expression>,\n): string | undefined {\n const initializer = getObjectPropertyInitializer(objectLiteral, propertyName)\n if (!initializer) return undefined\n const resolved = unwrapExpression(initializer)\n if (ts.isStringLiteralLike(resolved)) return resolved.text\n if (ts.isIdentifier(resolved)) {\n const declaration = initializers.get(resolved.text)\n if (declaration) {\n const declarationValue = unwrapExpression(declaration)\n if (ts.isStringLiteralLike(declarationValue)) return declarationValue.text\n }\n }\n return undefined\n}\n\nfunction readImportedStringIdentifier(\n sourceFile: ts.SourceFile,\n sourcePath: string,\n identifier: string,\n): string | undefined {\n for (const statement of sourceFile.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteralLike(statement.moduleSpecifier)) continue\n const importClause = statement.importClause\n const bindings = importClause?.namedBindings\n if (!bindings || !ts.isNamedImports(bindings)) continue\n const imported = bindings.elements.find((element) => element.name.text === identifier)\n if (!imported) continue\n const request = statement.moduleSpecifier.text\n if (!request.startsWith('.')) return undefined\n const basePath = path.resolve(path.dirname(sourcePath), request)\n const candidates = [\n `${basePath}.ts`,\n `${basePath}.tsx`,\n path.join(basePath, 'index.ts'),\n path.join(basePath, 'index.tsx'),\n ]\n const importedPath = candidates.find((candidate) => fs.existsSync(candidate))\n if (!importedPath) return undefined\n const importedSource = readSourceFile(importedPath)\n if (!importedSource) return undefined\n const exportName = imported.propertyName?.text ?? imported.name.text\n const declaration = importedSource.statements\n .filter(ts.isVariableStatement)\n .flatMap((variable) => [...variable.declarationList.declarations])\n .find((candidate) => ts.isIdentifier(candidate.name) && candidate.name.text === exportName)\n const initializer = declaration?.initializer ? unwrapExpression(declaration.initializer) : null\n return initializer && ts.isStringLiteralLike(initializer) ? initializer.text : undefined\n }\n return undefined\n}\n\nfunction extractWorkerContracts(\n moduleId: string,\n moduleRoot: string,\n sourceRoot: string,\n): { facts: ModuleOwnedContractFact[]; unresolved: ModuleFactDiagnostic[] } {\n const workersRoot = path.join(moduleRoot, 'workers')\n if (!fs.existsSync(workersRoot)) return { facts: [], unresolved: [] }\n const facts: ModuleOwnedContractFact[] = []\n const unresolved: ModuleFactDiagnostic[] = []\n for (const filePath of listSourceFilesRecursive(workersRoot)) {\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const metadata = findObjectLiteralDeclaration(sourceFile, 'metadata')\n if (!metadata) continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const source = { sourcePath, exportName: 'metadata', line: nodeLine(sourceFile, metadata) }\n const initializers = buildVariableInitializerMap(sourceFile)\n const workerId = readResolvedStringProperty(metadata, 'id', initializers)\n ?? deriveWorkerId(moduleId, workersRoot, filePath)\n\n // Runtime skips any worker without a queue, so a worker missing the required\n // property is not a contract; a present-but-dynamic queue is reported instead.\n const hasQueueProperty = getObjectPropertyInitializer(metadata, 'queue') !== undefined\n const queueInitializer = getObjectPropertyInitializer(metadata, 'queue')\n const queue = readResolvedStringProperty(metadata, 'queue', initializers)\n ?? (queueInitializer && ts.isIdentifier(unwrapExpression(queueInitializer))\n ? readImportedStringIdentifier(sourceFile, filePath, (unwrapExpression(queueInitializer) as ts.Identifier).text)\n : undefined)\n if (!hasQueueProperty) {\n unresolved.push({ code: 'unresolved-static-contract', kind: 'worker', id: workerId, source })\n continue\n }\n\n const workerMetadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n if (queue) workerMetadata.queue = queue\n else unresolved.push({ code: 'unresolved-static-contract', kind: 'worker', id: workerId, source })\n const name = readResolvedStringProperty(metadata, 'name', initializers)\n if (name) workerMetadata.name = name\n const concurrencyInitializer = getObjectPropertyInitializer(metadata, 'concurrency')\n if (concurrencyInitializer && ts.isNumericLiteral(concurrencyInitializer)) {\n workerMetadata.concurrency = Number(concurrencyInitializer.text)\n }\n facts.push({\n kind: 'worker',\n id: workerId,\n source,\n ...(Object.keys(workerMetadata).length > 0 ? { metadata: workerMetadata } : {}),\n })\n }\n return { facts: dedupeOwnedContractFacts(facts), unresolved }\n}\n\nfunction extractPageMiddlewareContracts(\n moduleRoot: string,\n sourceRoot: string,\n): { facts: ModuleOwnedContractFact[]; unresolved: ModuleFactDiagnostic[] } {\n const facts: ModuleOwnedContractFact[] = []\n const unresolved: ModuleFactDiagnostic[] = []\n for (const surface of ['backend', 'frontend'] as const) {\n const filePath = resolveConventionFile(path.join(moduleRoot, surface), 'middleware')\n if (!filePath) continue\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const middlewareArray =\n findArrayLiteralDeclaration(sourceFile, 'middleware') ??\n (() => {\n const defaultExport = findDefaultExportExpression(sourceFile)\n return defaultExport ? unwrapArrayLiteral(defaultExport) : null\n })()\n if (!middlewareArray) continue\n let index = 0\n for (const element of middlewareArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const middlewareId = readStringPropertyInitializer(element, 'id')\n if (!middlewareId) {\n unresolved.push({\n code: 'unresolved-static-contract',\n kind: 'page-middleware',\n id: `${sourcePath}#${index}`,\n source: { sourcePath, line: nodeLine(sourceFile, element) },\n })\n index += 1\n continue\n }\n const metadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = { surface }\n const mode = readStringPropertyInitializer(element, 'mode')\n if (mode) metadata.mode = mode\n const priorityInitializer = getObjectPropertyInitializer(element, 'priority')\n if (priorityInitializer && ts.isNumericLiteral(priorityInitializer)) {\n metadata.priority = Number(priorityInitializer.text)\n }\n facts.push({\n kind: 'page-middleware',\n id: middlewareId,\n source: { sourcePath, exportName: 'middleware', line: nodeLine(sourceFile, element) },\n metadata,\n })\n index += 1\n }\n }\n return { facts: dedupeOwnedContractFacts(facts), unresolved }\n}\n\nfunction extractSetupContract(\n moduleId: string,\n setupFilePath: string | null,\n sourcePath: string | null,\n): ModuleOwnedContractFact | null {\n if (!setupFilePath || !sourcePath) return null\n const sourceFile = readSourceFile(setupFilePath)\n if (!sourceFile) return null\n const setupObject =\n findObjectLiteralDeclaration(sourceFile, 'setup') ??\n (() => {\n const defaultExport = findDefaultExportExpression(sourceFile)\n if (!defaultExport) return null\n const unwrapped = unwrapExpression(defaultExport)\n return ts.isObjectLiteralExpression(unwrapped) ? unwrapped : null\n })()\n if (!setupObject) return null\n const hooks = readMethodBearingPropertyNames(setupObject)\n const metadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n if (hooks.length > 0) metadata.hooks = hooks\n const roleFeatures = getObjectPropertyInitializer(setupObject, 'defaultRoleFeatures')\n if (roleFeatures && ts.isObjectLiteralExpression(roleFeatures)) {\n const roles = readObjectKeyNames(roleFeatures)\n if (roles.length > 0) metadata.roles = roles\n }\n const customerRoleFeatures = getObjectPropertyInitializer(setupObject, 'defaultCustomerRoleFeatures')\n if (customerRoleFeatures && ts.isObjectLiteralExpression(customerRoleFeatures)) {\n const customerRoles = readObjectKeyNames(customerRoleFeatures)\n if (customerRoles.length > 0) metadata.customerRoles = customerRoles\n }\n return {\n kind: 'setup',\n id: `${moduleId}:setup`,\n source: { sourcePath, exportName: 'setup', line: nodeLine(sourceFile, setupObject) },\n ...(Object.keys(metadata).length > 0 ? { metadata } : {}),\n }\n}\n\nfunction extractEncryptionContracts(\n encryptionFilePath: string | null,\n sourcePath: string | null,\n): ModuleOwnedContractFact[] {\n if (!encryptionFilePath || !sourcePath) return []\n const sourceFile = readSourceFile(encryptionFilePath)\n if (!sourceFile) return []\n const mapsArray =\n findArrayLiteralDeclaration(sourceFile, 'defaultEncryptionMaps') ??\n findArrayLiteralDeclaration(sourceFile, 'encryptionMaps')\n if (!mapsArray) return []\n const facts: ModuleOwnedContractFact[] = []\n for (const element of mapsArray.elements) {\n if (!ts.isObjectLiteralExpression(element)) continue\n const entityId = readStringPropertyInitializer(element, 'entityId')\n if (!entityId) continue\n const fieldsInitializer = getObjectPropertyInitializer(element, 'fields')\n const fields: string[] = []\n if (fieldsInitializer) {\n const fieldsArray = unwrapArrayLiteral(fieldsInitializer)\n if (fieldsArray) {\n for (const fieldElement of fieldsArray.elements) {\n if (!ts.isObjectLiteralExpression(fieldElement)) continue\n const field = readStringPropertyInitializer(fieldElement, 'field')\n if (field) fields.push(field)\n }\n }\n }\n facts.push({\n kind: 'encryption',\n id: entityId,\n source: { sourcePath, exportName: 'defaultEncryptionMaps', line: nodeLine(sourceFile, element) },\n ...(fields.length > 0 ? { metadata: { fields: fields.sort((left, right) => left.localeCompare(right)) } } : {}),\n })\n }\n return dedupeOwnedContractFacts(facts)\n}\n\nfunction extractCustomEntityContracts(\n ceFilePath: string | null,\n sourcePath: string | null,\n): ModuleOwnedContractFact[] {\n if (!ceFilePath || !sourcePath) return []\n const entityIds = [...collectCustomFieldEntityIds(ceFilePath)].sort((left, right) => left.localeCompare(right))\n return entityIds.map((id) => ({\n kind: 'custom-entity' as const,\n id,\n source: { sourcePath, exportName: 'default' },\n }))\n}\n\n/**\n * Keyed AI override exports. Agent *extensions* (`aiAgentExtensions`) patch an agent\n * additively and belong to the `ai.extensions` array; these two replace or disable an\n * entry by key and map to exact `ai.agents.<id>` / `ai.tools.<id>` override targets.\n */\nconst AI_OVERRIDE_EXPORTS = [\n { exportName: 'aiAgentOverrides', target: 'agent' },\n { exportName: 'aiToolOverrides', target: 'tool' },\n] as const\n\nfunction extractAiExtensionContracts(\n moduleRoot: string,\n sourceRoot: string,\n): ModuleOwnedContractFact[] {\n const facts: ModuleOwnedContractFact[] = []\n const sources: Array<{ basename: string; relativeDir: string }> = [\n { basename: 'ai-agents', relativeDir: '.' },\n { basename: 'ai-tools', relativeDir: '.' },\n { basename: 'ai-agents.extensions', relativeDir: '.' },\n { basename: 'ai-tools.extensions', relativeDir: '.' },\n ]\n for (const entry of sources) {\n const filePath = resolveConventionFile(path.join(moduleRoot, entry.relativeDir), entry.basename)\n if (!filePath) continue\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) continue\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const extensionsArray = findArrayLiteralDeclaration(sourceFile, 'aiAgentExtensions')\n if (extensionsArray) {\n for (const element of extensionsArray.elements) {\n const objectLiteral = ts.isObjectLiteralExpression(element)\n ? element\n : ts.isCallExpression(element) && element.arguments[0] && ts.isObjectLiteralExpression(element.arguments[0])\n ? element.arguments[0]\n : null\n if (!objectLiteral) continue\n const targetAgentId = readStringPropertyInitializer(objectLiteral, 'targetAgentId')\n if (!targetAgentId) continue\n facts.push({\n kind: 'ai-extension',\n id: `agent-extension:${targetAgentId}`,\n source: { sourcePath, exportName: 'aiAgentExtensions', line: nodeLine(sourceFile, objectLiteral) },\n metadata: { target: 'agent', mode: 'extension', targetAgentId },\n })\n }\n }\n // `aiAgentOverrides` / `aiToolOverrides` are keyed replace-or-disable maps; only\n // their keys are contract facts. Values (agent/tool definitions, `null` disables)\n // are never read or serialized.\n for (const { exportName, target } of AI_OVERRIDE_EXPORTS) {\n const overridesObject = findObjectLiteralDeclaration(sourceFile, exportName)\n if (!overridesObject) continue\n for (const property of overridesObject.properties) {\n const overrideId = getPropertyName(property)\n if (!overrideId) continue\n facts.push({\n kind: 'ai-extension',\n id: `${target}-override:${overrideId}`,\n source: { sourcePath, exportName, line: nodeLine(sourceFile, property) },\n metadata: { target, mode: 'override', overrideKey: overrideId },\n })\n }\n }\n }\n return dedupeOwnedContractFacts(facts)\n}\n\nfunction extractGeneratorPluginContracts(\n moduleRoot: string,\n sourceRoot: string,\n): { facts: ModuleOwnedContractFact[]; unresolved: ModuleFactDiagnostic[] } {\n const filePath = resolveConventionFile(moduleRoot, 'generators')\n if (!filePath) return { facts: [], unresolved: [] }\n const sourceFile = readSourceFile(filePath)\n if (!sourceFile) return { facts: [], unresolved: [] }\n const pluginsArray = findArrayLiteralDeclaration(sourceFile, 'generatorPlugins')\n if (!pluginsArray) return { facts: [], unresolved: [] }\n const sourcePath = toPortableSourcePath(moduleRoot, sourceRoot, filePath)\n const initializers = buildVariableInitializerMap(sourceFile)\n const facts: ModuleOwnedContractFact[] = []\n const unresolved: ModuleFactDiagnostic[] = []\n let index = 0\n for (const element of pluginsArray.elements) {\n const objectLiteral = resolveToObjectLiteral(element, initializers)\n if (!objectLiteral) {\n index += 1\n continue\n }\n const pluginId = readStringPropertyInitializer(objectLiteral, 'id')\n if (!pluginId) {\n unresolved.push({\n code: 'unresolved-static-contract',\n kind: 'generator-plugin',\n id: `${sourcePath}#${index}`,\n source: { sourcePath, exportName: 'generatorPlugins', line: nodeLine(sourceFile, objectLiteral) },\n })\n index += 1\n continue\n }\n const metadata: Record<string, ModuleFactSafeScalar | ModuleFactSafeScalar[]> = {}\n const conventionFile = readStringPropertyInitializer(objectLiteral, 'conventionFile')\n if (conventionFile) metadata.conventionFile = conventionFile\n const outputFileName = readStringPropertyInitializer(objectLiteral, 'outputFileName')\n if (outputFileName) metadata.outputFileName = outputFileName\n facts.push({\n kind: 'generator-plugin',\n id: pluginId,\n source: { sourcePath, exportName: 'generatorPlugins', line: nodeLine(sourceFile, objectLiteral) },\n ...(Object.keys(metadata).length > 0 ? { metadata } : {}),\n })\n index += 1\n }\n return { facts: dedupeOwnedContractFacts(facts), unresolved }\n}\n\nfunction compareSourceRefs(left: ModuleFactSourceRef, right: ModuleFactSourceRef): number {\n return (\n left.sourcePath.localeCompare(right.sourcePath) ||\n (left.line ?? 0) - (right.line ?? 0) ||\n (left.exportName ?? '').localeCompare(right.exportName ?? '')\n )\n}\n\nfunction sameSourceRef(left: ModuleFactSourceRef, right: ModuleFactSourceRef): boolean {\n return (\n left.sourcePath === right.sourcePath &&\n (left.line ?? null) === (right.line ?? null) &&\n (left.exportName ?? null) === (right.exportName ?? null)\n )\n}\n\n// Every proven `(kind, id)` reaches `factSources`. Facts whose declaration site is already\n// serialized inline (pages, CLI commands, routes, AI tools/agents, reused contributions) and\n// the owned families (which carry `source` inside `ownedContracts`) are emitted as a typed\n// `factRef` pointer instead of a duplicated source ref, so the index stays uniform without\n// copying provenance payloads past the determinism byte guard. Duplicate detection runs over\n// ALL candidates regardless of which projection they take.\ntype ProvenanceCandidate = {\n kind: ModuleFactSourceKind\n id: string\n source?: ModuleFactSourceRef\n factRef?: ModuleFactRef\n}\n\nfunction provenanceCandidateOrderKey(candidate: ProvenanceCandidate): string {\n if (candidate.source) {\n return JSON.stringify([\n 0,\n candidate.source.sourcePath,\n candidate.source.line ?? 0,\n candidate.source.exportName ?? '',\n ])\n }\n return JSON.stringify([1, candidate.factRef?.factSection ?? '', candidate.factRef?.factKey ?? ''])\n}\n\nfunction buildProvenanceIndex(candidates: readonly ProvenanceCandidate[]): {\n factSources: ModuleFactSourceEntry[]\n diagnostics: ModuleFactDiagnostic[]\n} {\n const grouped = new Map<string, ProvenanceCandidate[]>()\n for (const candidate of candidates) {\n const key = JSON.stringify([candidate.kind, candidate.id])\n const group = grouped.get(key) ?? []\n group.push(candidate)\n grouped.set(key, group)\n }\n // Keep the provenance index compact: sourcePath is the provenance and (kind,id) the\n // stable identity, so exportName and line (recoverable from source) are dropped here.\n // Owned families retain the richer source ref inside `ownedContracts`.\n const factSources: ModuleFactSourceEntry[] = []\n const diagnostics: ModuleFactDiagnostic[] = []\n for (const group of grouped.values()) {\n const sorted = [...group].sort(\n (left, right) => provenanceCandidateOrderKey(left).localeCompare(provenanceCandidateOrderKey(right)),\n )\n const canonical = sorted[0]\n factSources.push(\n canonical.factRef\n ? {\n kind: canonical.kind,\n id: canonical.id,\n factRef: {\n factSection: canonical.factRef.factSection,\n ...(canonical.factRef.factKey === canonical.id\n ? {}\n : { factKey: canonical.factRef.factKey }),\n },\n }\n : {\n kind: canonical.kind,\n id: canonical.id,\n source: { sourcePath: (canonical.source as ModuleFactSourceRef).sourcePath },\n },\n )\n const canonicalKey = provenanceCandidateOrderKey(canonical)\n for (const rejected of sorted.slice(1)) {\n if (provenanceCandidateOrderKey(rejected) === canonicalKey) continue\n diagnostics.push({\n code: 'duplicate-source',\n kind: rejected.kind,\n id: rejected.id,\n ...(rejected.source ? { source: rejected.source } : {}),\n })\n }\n }\n factSources.sort(\n (left, right) => left.kind.localeCompare(right.kind) || left.id.localeCompare(right.id),\n )\n diagnostics.sort(\n (left, right) =>\n left.code.localeCompare(right.code) ||\n left.kind.localeCompare(right.kind) ||\n left.id.localeCompare(right.id) ||\n compareSourceRefs(left.source ?? { sourcePath: '' }, right.source ?? { sourcePath: '' }),\n )\n return { factSources, diagnostics }\n}\n\nfunction buildOwnedContracts(\n families: ReadonlyArray<[ModuleOwnedContractKind, ModuleOwnedContractFact[]]>,\n): ModuleOwnedContracts | undefined {\n const result: ModuleOwnedContracts = {}\n for (const [kind, facts] of families) {\n if (facts.length === 0) continue\n // Drop the (constant/redundant) exportName from the emitted source ref; the line\n // anchor plus sourcePath already pin the declaration and keep the JSON compact.\n result[kind] = facts.map((fact) => ({\n ...fact,\n source: {\n sourcePath: fact.source.sourcePath,\n ...(fact.source.line ? { line: fact.source.line } : {}),\n },\n }))\n }\n return Object.keys(result).length > 0 ? result : undefined\n}\n\nconst CONTRIBUTION_KIND_TO_SOURCE_KIND: Partial<Record<string, ModuleFactSourceKind>> = {\n subscriber: 'subscriber',\n}\n\nconst REGISTRY_TO_SOURCE_KIND: Partial<Record<string, ModuleFactSourceKind>> = {\n vector: 'vector',\n integration: 'integration',\n payment: 'integration',\n shipping: 'integration',\n currency: 'integration',\n}\n\nexport function extractModuleFacts(options: ExtractModuleFactsOptions): ModuleFacts {\n const { moduleId, coreVersion = null, sourcePackage = null, sourceVersion = null } = options\n const moduleRoot = options.moduleRoot\n ?? (options.coreSrcRoot ? path.join(options.coreSrcRoot, moduleId) : null)\n if (!moduleRoot) {\n throw new Error(`[internal] extractModuleFacts requires moduleRoot or coreSrcRoot for module \"${moduleId}\"`)\n }\n const sourceRoot = options.portableSourceRoot\n ? assertPortableSourceRoot(moduleId, options.portableSourceRoot)\n : toPortableSourceRoot(moduleId, sourcePackage)\n\n const entitiesFilePath =\n resolveConventionFile(path.join(moduleRoot, 'data'), 'entities') ??\n resolveConventionFile(path.join(moduleRoot, 'db'), 'entities') ??\n resolveConventionFile(path.join(moduleRoot, 'data'), 'schema')\n const ceFilePath = resolveConventionFile(moduleRoot, 'ce')\n const eventsFilePath = resolveConventionFile(moduleRoot, 'events')\n const aclFilePath = resolveConventionFile(moduleRoot, 'acl')\n const diFilePath = resolveConventionFile(moduleRoot, 'di')\n const searchFilePath = resolveConventionFile(moduleRoot, 'search')\n const notificationsFilePath = resolveConventionFile(moduleRoot, 'notifications')\n const cliFilePath = resolveConventionFile(moduleRoot, 'cli')\n const indexFilePath = resolveConventionFile(moduleRoot, 'index')\n const setupFilePath = resolveConventionFile(moduleRoot, 'setup')\n const encryptionFilePath = resolveConventionFile(moduleRoot, 'encryption')\n\n const portableOf = (filePath: string | null): string | null =>\n filePath ? toPortableSourcePath(moduleRoot, sourceRoot, filePath) : null\n\n const warnings: string[] = []\n const { title, description } = extractModuleMeta(indexFilePath)\n const customFieldEntityIds = collectCustomFieldEntityIds(ceFilePath)\n const entities = extractEntities(moduleId, entitiesFilePath, customFieldEntityIds)\n const events = extractEvents(eventsFilePath)\n const aclFeatures = extractAclFeatures(aclFilePath)\n\n const { source: registrySource, description: registryDescription } = resolveRegistrySource(options)\n const apiRouteSourcePaths = extractApiRouteSourcePaths(moduleId, moduleRoot, sourceRoot)\n const apiRoutes = extractApiRoutes(moduleId, registrySource, registryDescription, apiRouteSourcePaths, warnings)\n const diRegistrations = extractDiRegistrationFacts(diFilePath, portableOf(diFilePath) ?? '')\n const diTokens = deriveLegacyDiTokens(diRegistrations.facts)\n for (const legacyToken of extractDiTokens(diFilePath)) {\n if (!diTokens.includes(legacyToken)) diTokens.push(legacyToken)\n }\n const searchEntities = extractSearchEntities(searchFilePath, warnings)\n const notifications = extractNotifications(notificationsFilePath, warnings)\n const cli = extractCli(cliFilePath, warnings)\n const cliCommands = cliFilePath\n ? cli.map((command) => ({\n command,\n sourcePath: toPortableSourcePath(moduleRoot, sourceRoot, cliFilePath),\n }))\n : []\n const backendPages = extractModulePages(moduleId, moduleRoot, sourceRoot, 'backend')\n const frontendPages = extractModulePages(moduleId, moduleRoot, sourceRoot, 'frontend')\n const aiTools = extractAiTools(moduleRoot, sourceRoot)\n const aiAgents = extractAiAgents(moduleRoot, sourceRoot)\n const hostTokens: ModuleHostTokens = {\n entityIds: extractHostEntityIds(entities),\n tableIds: extractTableIds(moduleRoot),\n }\n const extensionSurfaces = extractModuleExtensionFacts({\n moduleId,\n moduleRoot,\n sourceRoot,\n entities,\n events,\n apiRoutes,\n searchEntities,\n notifications,\n aiTools,\n aiAgents,\n factsContractVersion: options.factsContractVersion ?? 2,\n })\n\n const indexSourcePath = portableOf(indexFilePath)\n const diSourcePath = portableOf(diFilePath)\n const moduleMetadataFact = extractModuleMetadataContract(indexFilePath, moduleId, indexSourcePath)\n const commandCandidates = extractCommandContractCandidates(moduleId, moduleRoot, sourceRoot)\n const commandFacts = dedupeOwnedContractFacts(\n commandCandidates.map((candidate) => ({\n kind: 'command' as const,\n id: candidate.id,\n source: { sourcePath: candidate.sourcePath },\n })),\n )\n const workers = extractWorkerContracts(moduleId, moduleRoot, sourceRoot)\n const pageMiddleware = extractPageMiddlewareContracts(moduleRoot, sourceRoot)\n const setupFact = extractSetupContract(moduleId, setupFilePath, portableOf(setupFilePath))\n const encryptionFacts = extractEncryptionContracts(encryptionFilePath, portableOf(encryptionFilePath))\n const customEntityFacts = extractCustomEntityContracts(ceFilePath, portableOf(ceFilePath))\n const aiExtensionFacts = extractAiExtensionContracts(moduleRoot, sourceRoot)\n const generatorPlugins = extractGeneratorPluginContracts(moduleRoot, sourceRoot)\n const diContractFacts = dedupeOwnedContractFacts(\n diRegistrations.facts.map((fact) => ({\n kind: 'di-registration' as const,\n id: fact.token,\n source: fact.source,\n metadata: {\n registrationKind: fact.registrationKind,\n ...(fact.providerSymbol ? { providerSymbol: fact.providerSymbol } : {}),\n ...(fact.lifetime ? { lifetime: fact.lifetime } : {}),\n ...(fact.injectionMode ? { injectionMode: fact.injectionMode } : {}),\n },\n })),\n )\n\n const ownedContracts = buildOwnedContracts([\n ['module-metadata', moduleMetadataFact ? [moduleMetadataFact] : []],\n ['command', commandFacts],\n ['worker', workers.facts],\n ['page-middleware', pageMiddleware.facts],\n ['setup', setupFact ? [setupFact] : []],\n ['encryption', encryptionFacts],\n ['di-registration', diContractFacts],\n ['custom-entity', customEntityFacts],\n ['ai-extension', aiExtensionFacts],\n ['generator-plugin', generatorPlugins.facts],\n ])\n\n const provenanceCandidates: ProvenanceCandidate[] = []\n const pushSource = (kind: ModuleFactSourceKind, id: string, source: ModuleFactSourceRef): void => {\n provenanceCandidates.push({ kind, id, source })\n }\n const pushRef = (\n kind: ModuleFactSourceKind,\n id: string,\n source: ModuleFactSourceRef,\n factSection: string,\n factKey: string,\n ): void => {\n provenanceCandidates.push({ kind, id, source, factRef: { factSection, factKey } })\n }\n const pushOwnedRefs = (kind: ModuleOwnedContractKind, facts: readonly ModuleOwnedContractFact[]): void => {\n for (const fact of facts) pushRef(kind, fact.id, fact.source, `ownedContracts.${kind}`, fact.id)\n }\n if (moduleMetadataFact) {\n pushRef(\n 'module-metadata',\n moduleId,\n moduleMetadataFact.source,\n 'ownedContracts.module-metadata',\n moduleMetadataFact.id,\n )\n }\n if (entitiesFilePath) {\n const entitiesSourcePath = portableOf(entitiesFilePath) as string\n for (const entity of entities) {\n pushSource('entity', entity.id, { sourcePath: entitiesSourcePath, exportName: entity.class })\n }\n }\n if (eventsFilePath) {\n const eventsSourcePath = portableOf(eventsFilePath) as string\n for (const event of events) pushSource('event', event.id, { sourcePath: eventsSourcePath, exportName: 'events' })\n }\n if (aclFilePath) {\n const aclSourcePath = portableOf(aclFilePath) as string\n for (const feature of aclFeatures) pushSource('acl-feature', feature, { sourcePath: aclSourcePath, exportName: 'features' })\n }\n for (const route of apiRoutes) {\n if (route.sourcePath) {\n pushRef('api-route', route.path, { sourcePath: route.sourcePath }, 'apiRoutes', route.path)\n }\n }\n if (searchFilePath) {\n const searchSourcePath = portableOf(searchFilePath) as string\n for (const entityId of searchEntities) pushSource('search', entityId, { sourcePath: searchSourcePath, exportName: 'searchConfig' })\n }\n if (notificationsFilePath) {\n const notificationsSourcePath = portableOf(notificationsFilePath) as string\n for (const id of notifications) pushSource('notification', id, { sourcePath: notificationsSourcePath })\n }\n for (const command of cliCommands) {\n pushRef('cli-command', command.command, { sourcePath: command.sourcePath }, 'cliCommands', command.command)\n }\n for (const page of backendPages) {\n pushRef('backend-page', page.path, { sourcePath: page.sourcePath }, 'backendPages', page.path)\n }\n for (const page of frontendPages) {\n pushRef('frontend-page', page.path, { sourcePath: page.sourcePath }, 'frontendPages', page.path)\n }\n for (const tool of aiTools) pushRef('ai-tool', tool.name, { sourcePath: tool.sourcePath }, 'aiTools', tool.name)\n for (const agent of aiAgents) pushRef('ai-agent', agent.id, { sourcePath: agent.sourcePath }, 'aiAgents', agent.id)\n for (const candidate of commandCandidates) {\n pushRef('command', candidate.id, { sourcePath: candidate.sourcePath }, 'ownedContracts.command', candidate.id)\n }\n pushOwnedRefs('worker', workers.facts)\n pushOwnedRefs('page-middleware', pageMiddleware.facts)\n if (setupFact) pushOwnedRefs('setup', [setupFact])\n pushOwnedRefs('encryption', encryptionFacts)\n for (const fact of diRegistrations.facts) {\n pushRef('di-registration', fact.token, fact.source, 'ownedContracts.di-registration', fact.token)\n }\n pushOwnedRefs('custom-entity', customEntityFacts)\n pushOwnedRefs('ai-extension', aiExtensionFacts)\n pushOwnedRefs('generator-plugin', generatorPlugins.facts)\n const contributionRef = (contributionId: string): { factSection: string; factKey: string } => ({\n factSection: 'extensionSurfaces.contributions',\n factKey: contributionId,\n })\n for (const contribution of extensionSurfaces.contributions) {\n const contributionSource: ModuleFactSourceRef = {\n sourcePath: contribution.source.path,\n ...(contribution.source.symbol ? { exportName: contribution.source.symbol } : {}),\n }\n const ref = contributionRef(contribution.id)\n if (contribution.kind === 'subscriber') {\n pushRef('subscriber', contribution.id, contributionSource, ref.factSection, ref.factKey)\n continue\n }\n if (contribution.kind === 'specialized-registry') {\n const details = contribution.details as { registry?: string; registryId?: string }\n const sourceKind = details.registry ? REGISTRY_TO_SOURCE_KIND[details.registry] : undefined\n if (sourceKind) {\n pushRef(\n sourceKind,\n details.registryId ?? contribution.id,\n contributionSource,\n ref.factSection,\n ref.factKey,\n )\n }\n continue\n }\n const mapped = CONTRIBUTION_KIND_TO_SOURCE_KIND[contribution.kind]\n if (mapped) pushRef(mapped, contribution.id, contributionSource, ref.factSection, ref.factKey)\n }\n // extension-host / extension-contribution provenance is emitted as typed `factRef` pointers\n // rather than duplicated source refs: those facts already carry their own `source` inside\n // `extensionSurfaces.{hosts,contributions}`, and copying every declared host spot (hundreds\n // per large module) would push the shared JSON past the determinism byte guard asserted in\n // `module-facts.bc-guard.test.ts`.\n // Hosts are indexed by their registry `key`: `id` repeats across families (an entity id is\n // also an api-entity id), while `key` is unique inside a module.\n for (const host of extensionSurfaces.hosts) {\n provenanceCandidates.push({\n kind: 'extension-host',\n id: host.key,\n ...(host.source.kind === 'fact-ref' ? {} : { source: { sourcePath: host.source.path } }),\n factRef: { factSection: 'extensionSurfaces.hosts', factKey: host.key },\n })\n }\n for (const contribution of extensionSurfaces.contributions) {\n pushRef(\n 'extension-contribution',\n contribution.id,\n { sourcePath: contribution.source.path },\n 'extensionSurfaces.contributions',\n contribution.id,\n )\n }\n\n const provenance = buildProvenanceIndex(provenanceCandidates)\n const factDiagnostics = [\n ...provenance.diagnostics,\n ...workers.unresolved,\n ...pageMiddleware.unresolved,\n ...generatorPlugins.unresolved,\n ...diRegistrations.unresolvedTokens.map((token): ModuleFactDiagnostic => ({\n code: 'unresolved-static-contract',\n kind: 'di-registration',\n id: token,\n ...(diSourcePath ? { source: { sourcePath: diSourcePath, exportName: token } } : {}),\n })),\n ].sort(\n (left, right) =>\n left.code.localeCompare(right.code) ||\n left.kind.localeCompare(right.kind) ||\n left.id.localeCompare(right.id),\n )\n\n const facts: ModuleFacts = {\n module: moduleId,\n title,\n description,\n coreVersion,\n sourcePackage,\n sourceVersion,\n sourceRoot,\n ...(options.sourceKind === 'local-reference' ? { sourceKind: options.sourceKind } : {}),\n entities,\n events,\n aclFeatures,\n apiRoutes,\n diTokens,\n searchEntities,\n hostTokens,\n notifications,\n cli,\n backendPages,\n frontendPages,\n cliCommands,\n aiTools,\n aiAgents,\n extensionSurfaces,\n ...(provenance.factSources.length > 0 ? { factSources: provenance.factSources } : {}),\n ...(ownedContracts ? { ownedContracts } : {}),\n ...(factDiagnostics.length > 0 ? { factDiagnostics } : {}),\n warnings,\n }\n\n // Exact unified override targets (spec 2026-08-02-module-facts-exact-override-targets).\n // Adapters consume the fully-populated owned facts + contributions above.\n const overrides = collectModuleOverrideTargets(facts, buildFactSourceLookup(facts))\n if (overrides.overrideTargets.length > 0) facts.overrideTargets = overrides.overrideTargets\n if (overrides.overrideTargetDiagnostics.length > 0) {\n facts.overrideTargetDiagnostics = overrides.overrideTargetDiagnostics\n }\n return facts\n}\n\nexport interface ModuleFactsJsonEvent {\n id: string\n category: string | null\n entity: string | null\n clientBroadcast?: boolean\n portalBroadcast?: boolean\n}\n\nexport interface ModuleFactsJsonEntry {\n title: string | null\n description: string | null\n coreVersion: string | null\n sourcePackage: string | null\n sourceVersion: string | null\n sourceRoot: string\n /** Present only for `local-reference` projections; package sidecar entries omit it. */\n sourceKind?: ModuleFactProjectionSourceKind\n entities: ModuleEntityFact[]\n events: ModuleFactsJsonEvent[]\n aclFeatures: string[]\n apiRoutes: ModuleApiRouteFact[]\n diTokens: string[]\n searchEntities: string[]\n hostTokens: ModuleHostTokens\n notifications: string[]\n cli: string[]\n backendPages: ModulePageFact[]\n frontendPages: ModulePageFact[]\n cliCommands: ModuleCliCommandFact[]\n aiTools: ModuleAiToolFact[]\n aiAgents: ModuleAiAgentFact[]\n extensionSurfaces?: ModuleExtensionSurfaceFacts\n factSources?: ModuleFactSourceEntry[]\n ownedContracts?: ModuleOwnedContracts\n factDiagnostics?: ModuleFactDiagnostic[]\n overrideTargets?: ModuleOverrideTarget[]\n overrideTargetDiagnostics?: ModuleOverrideTargetDiagnostic[]\n}\n\nconst EMPTY_SECTION_MARKER = '_none_'\nconst MAX_ANCHORED_SECTION_BYTES = 32 * 1024\n\ninterface ModuleFactsRenderContext {\n sourceRoot: string\n sourceLinkPrefix: string\n}\n\ninterface ModuleFactsAnchor {\n title: string\n offset: number\n size: string\n depth: number\n}\n\ninterface GroupedTableRows {\n title: string\n rows: string[]\n}\n\nfunction renderGroupedTableSection(\n sectionHeading: string,\n header: string,\n divider: string,\n groups: readonly GroupedTableRows[],\n): string {\n const renderedGroups: string[] = []\n for (const group of groups) {\n const chunks: string[][] = []\n let currentRows: string[] = []\n const renderChunk = (rows: readonly string[], chunkIndex: number): string => {\n const continuation = chunkIndex === 0 ? '' : ` (continued ${chunkIndex + 1})`\n return [`### ${group.title}${continuation}`, '', header, divider, ...rows, ''].join('\\n')\n }\n for (const row of group.rows) {\n const candidateRows = [...currentRows, row]\n if (Buffer.byteLength(renderChunk(candidateRows, chunks.length)) <= MAX_ANCHORED_SECTION_BYTES) {\n currentRows = candidateRows\n continue\n }\n if (currentRows.length === 0) {\n throw new Error(`[module-facts] ${sectionHeading} group \"${group.title}\" contains a row larger than the anchored read cap`)\n }\n chunks.push(currentRows)\n currentRows = [row]\n if (Buffer.byteLength(renderChunk(currentRows, chunks.length)) > MAX_ANCHORED_SECTION_BYTES) {\n throw new Error(`[module-facts] ${sectionHeading} group \"${group.title}\" contains a row larger than the anchored read cap`)\n }\n }\n if (currentRows.length > 0) chunks.push(currentRows)\n renderedGroups.push(...chunks.map((rows, chunkIndex) => renderChunk(rows, chunkIndex)))\n }\n return [sectionHeading, '', ...renderedGroups].join('\\n').trimEnd()\n}\n\nfunction renderVersionStamp(\n coreVersion: string | null,\n sourcePackage: string | null,\n sourceVersion: string | null,\n): string {\n if (sourcePackage) {\n return `<!-- generated from ${sourcePackage} ${sourceVersion || '<unknown>'}; core ${coreVersion || '<unknown>'} \u2014 R1 staleness stamp -->`\n }\n const version = coreVersion && coreVersion.length > 0 ? coreVersion : '<unknown>'\n return `<!-- generated from @open-mercato/core ${version} \u2014 R1 staleness stamp -->`\n}\n\nfunction renderEntitiesSection(\n entities: ModuleEntityFact[],\n lookup: FactSourceLookup,\n context: ModuleFactsRenderContext,\n): string {\n if (entities.length === 0) return `## Entities\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Entity ID | Class | Table | Editable | CustomFields | Source |'\n const divider = '|---|---|---|---|---|---|'\n const rows = entities.map(\n (entity) =>\n `| ${entity.id} | ${entity.class} | ${entity.table} | ${entity.editable ? 'yes' : 'no'} | ${entity.customFields ? 'yes' : 'no'} | ${renderLookedUpSource(lookup, 'entity', entity.id, context)} |`,\n )\n return ['## Entities', '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderEventsSection(\n events: ModuleEventFact[],\n lookup: FactSourceLookup,\n context: ModuleFactsRenderContext,\n): string {\n const heading = `## Events (${events.length})`\n if (events.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| ID | Category | Entity | Browser transport | Source |'\n const divider = '|---|---|---|---|---|'\n const rows = events.map((event) => {\n const transports = [event.clientBroadcast ? 'client' : null, event.portalBroadcast ? 'portal' : null]\n .filter((value): value is string => value !== null)\n return `| ${event.id} | ${event.category ?? '\u2014'} | ${event.entity ?? '\u2014'} | ${transports.join(', ') || '\u2014'} | ${renderLookedUpSource(lookup, 'event', event.id, context)} |`\n })\n return [heading, '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderInlineListSection(heading: string, values: string[]): string {\n if (values.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n return `${heading}\\n\\n${values.join(' \u00B7 ')}`\n}\n\nfunction renderSourceLinkedListSection(\n heading: string,\n values: readonly string[],\n lookup: FactSourceLookup,\n kind: ModuleFactSourceKind,\n idColumnLabel: string,\n context: ModuleFactsRenderContext,\n): string {\n if (values.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = values.map((value) => `| ${value} | ${renderLookedUpSource(lookup, kind, value, context)} |`)\n return [heading, '', `| ${idColumnLabel} | Source |`, '|---|---|', ...rows].join('\\n')\n}\n\n/**\n * A generated fact only earns a markdown link when it names an exact module code\n * file. Directory-valued provenance (the module source root, framework hosts that\n * only know their owning package folder) renders as plain text: a link to a folder\n * resolves to nothing in an editor or on the repository browser, so emitting one\n * costs a consumer a dead click instead of taking them to the declaration site.\n */\nexport function isExactSourceFilePath(sourcePath: string): boolean {\n return MODULE_CODE_EXTENSIONS.some((extension) => sourcePath.endsWith(extension))\n}\n\nfunction renderSourceLabel(sourcePath: string, sourceRoot: string, line?: number): string {\n const relativeSourcePath = sourcePath.startsWith(`${sourceRoot}/`)\n ? sourcePath.slice(sourceRoot.length + 1)\n : sourcePath\n return line ? `${relativeSourcePath}:${line}` : relativeSourcePath\n}\n\nfunction renderSourceLink(sourcePath: string, context?: ModuleFactsRenderContext): string {\n if (!isExactSourceFilePath(sourcePath)) return sourcePath\n const label = context ? renderSourceLabel(sourcePath, context.sourceRoot) : sourcePath\n return `[${label}](${context?.sourceLinkPrefix ?? '../../../'}${sourcePath})`\n}\n\nfunction renderSourceRefLink(source: ModuleFactSourceRef, context: ModuleFactsRenderContext): string {\n const anchor = source.line ? `#L${source.line}` : ''\n if (!isExactSourceFilePath(source.sourcePath)) {\n return source.line ? `${source.sourcePath}:${source.line}` : source.sourcePath\n }\n const label = renderSourceLabel(source.sourcePath, context.sourceRoot, source.line)\n return `[${label}](${context.sourceLinkPrefix}${source.sourcePath}${anchor})`\n}\n\n\nfunction renderLookedUpSource(\n lookup: FactSourceLookup,\n kind: ModuleFactSourceKind,\n id: string,\n context: ModuleFactsRenderContext,\n): string {\n const source = lookup(kind, id)\n return source ? renderSourceRefLink(source, context) : '\u2014'\n}\n\nfunction renderSafeScalar(value: ModuleFactSafeScalar | ModuleFactSafeScalar[] | undefined): string {\n if (value === undefined || value === null) return '\u2014'\n if (Array.isArray(value)) return value.length > 0 ? value.map((entry) => String(entry)).join(', ') : '\u2014'\n return String(value)\n}\n\nfunction renderOwnedContractMetadata(metadata: ModuleOwnedContractFact['metadata']): string {\n if (!metadata) return '\u2014'\n const keys = Object.keys(metadata).sort((left, right) => left.localeCompare(right))\n if (keys.length === 0) return '\u2014'\n return keys.map((key) => `${key}=${renderSafeScalar(metadata[key])}`).join('; ')\n}\n\nfunction renderOwnedContractSection(\n heading: string,\n facts: readonly ModuleOwnedContractFact[] | undefined,\n context: ModuleFactsRenderContext,\n): string {\n if (!facts || facts.length === 0) return ''\n const rows = facts.map(\n (fact) => `| ${fact.id} | ${renderOwnedContractMetadata(fact.metadata)} | ${renderSourceRefLink(fact.source, context)} |`,\n )\n return [heading, '', '| ID | Metadata | Source |', '|---|---|---|', ...rows].join('\\n')\n}\n\nfunction renderDiRegistrationsSection(\n facts: readonly ModuleOwnedContractFact[] | undefined,\n context: ModuleFactsRenderContext,\n): string {\n if (!facts || facts.length === 0) return ''\n const rows = facts.map((fact) => {\n const metadata = fact.metadata ?? {}\n return `| ${fact.id} | ${renderSafeScalar(metadata.registrationKind)} | ${renderSafeScalar(metadata.lifetime)} | ${renderSafeScalar(metadata.injectionMode)} | ${renderSafeScalar(metadata.providerSymbol)} | ${renderSourceRefLink(fact.source, context)} |`\n })\n return [\n '## DI registrations (rich)',\n '',\n '| Token | Kind | Lifetime | Injection | Provider | Source |',\n '|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction describeAuthRule(rule: ApiRouteAuthRule | undefined): string {\n if (!rule) return 'public'\n if (rule.requireFeatures && rule.requireFeatures.length > 0) return rule.requireFeatures.join(', ')\n if (rule.requireRoles && rule.requireRoles.length > 0) return rule.requireRoles.join(', ')\n if (rule.requireAuth) return 'auth'\n return 'public'\n}\n\nfunction renderApiRouteAuthCell(route: ModuleApiRouteFact): string {\n if (route.methods.length === 0) return '\u2014'\n const groups: Array<{ label: string; methods: string[] }> = []\n for (const method of route.methods) {\n const label = describeAuthRule(route.auth[method])\n const existing = groups.find((group) => group.label === label)\n if (existing) existing.methods.push(method)\n else groups.push({ label, methods: [method] })\n }\n return groups.map((group) => `${group.methods.join('/')} \u2192 ${group.label}`).join(' \u00B7 ')\n}\n\nfunction renderApiRoutesSection(routes: ModuleApiRouteFact[], context: ModuleFactsRenderContext): string {\n if (routes.length === 0) return `## API routes\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Path | Methods | Auth (per-method requireFeatures) | Source |'\n const divider = '|---|---|---|---|'\n const rows = routes.map(\n (route) => `| ${route.path} | ${route.methods.join(' ')} | ${renderApiRouteAuthCell(route)} | ${route.sourcePath ? renderSourceLink(route.sourcePath, context) : '\u2014'} |`,\n )\n return ['## API routes', '', header, divider, ...rows].join('\\n')\n}\n\nfunction renderLinkedFactsSection(\n heading: string,\n facts: ReadonlyArray<{ label: string; sourcePath: string }>,\n context: ModuleFactsRenderContext,\n): string {\n if (facts.length === 0) return `${heading}\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = facts.map((fact) => `| ${fact.label} | ${renderSourceLink(fact.sourcePath, context)} |`)\n return [heading, '', '| ID / path | Source |', '|---|---|', ...rows].join('\\n')\n}\n\nfunction renderHostTokensSection(hostTokens: ModuleHostTokens): string {\n if (hostTokens.entityIds.length === 0 && hostTokens.tableIds.length === 0) {\n return `## Host extension points\\n\\n${EMPTY_SECTION_MARKER}`\n }\n const entityIdsLine = hostTokens.entityIds.length > 0 ? hostTokens.entityIds.join(' \u00B7 ') : EMPTY_SECTION_MARKER\n const tableIdsLine = hostTokens.tableIds.length > 0 ? hostTokens.tableIds.join(' \u00B7 ') : EMPTY_SECTION_MARKER\n return ['## Host extension points', '', `- Entity IDs: ${entityIdsLine}`, `- Table IDs: ${tableIdsLine}`].join('\\n')\n}\n\nfunction renderExtensionHostContext(host: ModuleExtensionSurfaceFacts['hosts'][number]): string {\n return host.contextContract ?? host.runtimeContract ?? host.scopeContract ?? '\u2014'\n}\n\nfunction renderExtensionHostSource(host: ModuleExtensionHostFact, context: ModuleFactsRenderContext): string {\n if (host.source.kind === 'fact-ref') return `${host.source.factSection}:${host.source.factKey}`\n return renderSourceRefLink({ sourcePath: host.source.path }, context)\n}\n\nfunction renderExtensionHostsSection(\n extensionSurfaces: ModuleExtensionSurfaceFacts,\n context: ModuleFactsRenderContext,\n): string {\n const boundHosts = extensionSurfaces.hosts.filter((host) => host.bound)\n if (boundHosts.length === 0) return `## UMES hosts\\n\\n${EMPTY_SECTION_MARKER}`\n const header = [\n '## UMES hosts',\n '',\n '| ID / pattern | Family | Supports | Context | Stability | Source |',\n '|---|---|---|---|---|---|',\n ]\n const renderRows = (hosts: readonly ModuleExtensionHostFact[]) => hosts.map((host) =>\n `| ${host.id} | ${host.family} | ${host.capabilities.join(', ') || '\u2014'} | ${renderExtensionHostContext(host)} | ${host.stability.toUpperCase()} | ${renderExtensionHostSource(host, context)} |`,\n )\n const compact = [...header, ...renderRows(boundHosts)].join('\\n')\n if (Buffer.byteLength(compact) <= MAX_ANCHORED_SECTION_BYTES) return compact\n const families = [...new Set(boundHosts.map((host) => host.family))]\n return renderGroupedTableSection(\n '## UMES hosts',\n '| ID / pattern | Family | Supports | Context | Stability | Source |',\n '|---|---|---|---|---|---|',\n families.map((family) => ({\n title: family,\n rows: renderRows(boundHosts.filter((host) => host.family === family)),\n })),\n )\n}\n\nfunction compactContributionDetails(contribution: ModuleExtensionContributionFact): string {\n const details = contribution.details as unknown as Record<string, unknown>\n return Object.keys(details).sort((left, right) => left.localeCompare(right)).flatMap((key) => {\n const value = details[key]\n if (value === undefined) return []\n if (Array.isArray(value)) return [`${key}=${value.join(',') || 'none'}`]\n if (value && typeof value === 'object') {\n const nested = Object.keys(value as Record<string, unknown>).sort((left, right) => left.localeCompare(right)).map((nestedKey) => {\n const nestedValue = (value as Record<string, unknown>)[nestedKey]\n return `${nestedKey}:${Array.isArray(nestedValue) ? nestedValue.join(',') : String(nestedValue)}`\n })\n return [`${key}={${nested.join(';')}}`]\n }\n return [`${key}=${String(value)}`]\n }).join('; ')\n}\n\nfunction renderExtensionContributionsSection(\n extensionSurfaces: ModuleExtensionSurfaceFacts,\n context: ModuleFactsRenderContext,\n): string {\n if (extensionSurfaces.contributions.length === 0) return `## UMES contributions\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = extensionSurfaces.contributions.map((contribution) => {\n const targets = contribution.targets.map((entry) => entry.id).join(', ')\n const resolution = contribution.targets.map((entry) => entry.resolution).join(', ')\n const phases = [...(contribution.phases ?? []), ...(contribution.operations ?? [])].join(', ') || '\u2014'\n const source = renderSourceRefLink({ sourcePath: contribution.source.path }, context)\n return `| ${contribution.id} | ${contribution.kind} | ${targets || '\u2014'} | ${phases} | ${compactContributionDetails(contribution)} | ${resolution || '\u2014'} | ${source} |`\n })\n return [\n '## UMES contributions',\n '',\n '| ID | Kind | Target | Phase / operations | Contract | Resolution | Source |',\n '|---|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderExtensionDiagnosticsSection(extensionSurfaces: ModuleExtensionSurfaceFacts): string {\n const unbound = extensionSurfaces.hosts.filter((host) => !host.bound)\n if (unbound.length === 0 && extensionSurfaces.unresolved.length === 0) return ''\n const diagnostics = [\n ...unbound.map((host) => `- unbound-helper: ${host.id}`),\n ...extensionSurfaces.unresolved.map((entry) => `- ${entry.reason}: ${entry.key} (${entry.source.path})`),\n ]\n return ['## UMES diagnostics', '', ...diagnostics].join('\\n')\n}\n\nfunction renderExtensionTargetRef(target: ModuleExtensionTargetRef): string {\n const method = target.method ? ` ${target.method}` : ''\n const owner = target.moduleId ? ` @${target.moduleId}` : ''\n return `${target.kind}:${target.id}${method}${owner}`\n}\n\nfunction renderActivationBindingsSection(\n extensionSurfaces: ModuleExtensionSurfaceFacts,\n context: ModuleFactsRenderContext,\n): string {\n const activations = extensionSurfaces.activations ?? []\n if (activations.length === 0) return `## Active extension bindings\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = activations.map((activation) => {\n const phases = activation.phases && activation.phases.length > 0 ? activation.phases.join(', ') : '\u2014'\n const source = activation.source ? renderSourceRefLink(activation.source, context) : '\u2014'\n const bridge = activation.bridge ? `${activation.bridge.factSection}:${activation.bridge.factKey}` : '\u2014'\n return `| ${activation.id} | ${activation.kind} | ${renderExtensionTargetRef(activation.host)} | ${activation.contributionKinds.join(', ') || '\u2014'} | ${phases} | ${bridge} | ${source} |`\n })\n return [\n '## Active extension bindings',\n '',\n '| Activation | Kind | Host | Contribution kinds | Phases | Bridge | Source |',\n '|---|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderIncomingContributionsSection(\n extensionSurfaces: ModuleExtensionSurfaceFacts,\n context: ModuleFactsRenderContext,\n): string {\n const incoming = extensionSurfaces.incoming ?? []\n if (incoming.length === 0) return `## Incoming installed contributions\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = incoming.map((entry) => {\n const activation = entry.activationId ?? '\u2014'\n const source = entry.source ? renderSourceRefLink(entry.source, context) : '\u2014'\n return `| ${entry.contributorModuleId} | ${entry.contributionKind} | ${renderExtensionTargetRef(entry.target)} | ${entry.resolution} | ${activation} | ${entry.contributionId} \u00B7 ${source} |`\n })\n return [\n '## Incoming installed contributions',\n '',\n '| Contributor | Kind | Target | Resolution | Activation | Contribution \u00B7 Source |',\n '|---|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderContributionResolutionsSection(\n extensionSurfaces: ModuleExtensionSurfaceFacts,\n lookup: FactSourceLookup,\n context: ModuleFactsRenderContext,\n): string {\n const resolutions = extensionSurfaces.contributionResolutions ?? []\n if (resolutions.length === 0) return `## Contribution resolutions\\n\\n${EMPTY_SECTION_MARKER}`\n const rows = resolutions.map((resolution) => {\n const activations = resolution.activationIds.length > 0 ? resolution.activationIds.join(', ') : '\u2014'\n const source = renderLookedUpSource(lookup, 'extension-contribution', resolution.contributionId, context)\n return `| ${resolution.contributionId} | ${renderExtensionTargetRef(resolution.target)} | ${resolution.resolution} | ${activations} | ${source} |`\n })\n return [\n '## Contribution resolutions',\n '',\n '| Contribution | Target | Resolution | Activations | Source |',\n '|---|---|---|---|---|',\n ...rows,\n ].join('\\n')\n}\n\nfunction renderOverrideTargetPath(target: ModuleOverrideTarget): string {\n let display = 'overrides'\n for (let index = 0; index < target.path.length; index += 1) {\n const segment = target.path[index]\n const isKeyedTerminal = target.key !== undefined && index === target.path.length - 1\n display += isKeyedTerminal ? `[${JSON.stringify(segment)}]` : `.${segment}`\n }\n return display\n}\n\nfunction renderOverrideTargetsSection(\n targets: readonly ModuleOverrideTarget[] | undefined,\n context: ModuleFactsRenderContext,\n): string {\n if (!targets || targets.length === 0) return `## Exact override targets\\n\\n${EMPTY_SECTION_MARKER}`\n const header = '| Domain | Path / key | Supported modes | Referenced fact | Source |'\n const divider = '|---|---|---|---|---|'\n const renderRows = (group: readonly ModuleOverrideTarget[]) => group.map((target) => {\n const path = `\\`${renderOverrideTargetPath(target)}\\``\n const modes = target.modes.join(', ') || '\u2014'\n const fact = `${target.factRef.factSection}:${target.factRef.factKey}`\n return `| ${target.domain} | ${path} | ${modes} | ${fact} | ${renderSourceRefLink(target.source, context)} |`\n })\n const compact = ['## Exact override targets', '', header, divider, ...renderRows(targets)].join('\\n')\n if (Buffer.byteLength(compact) <= MAX_ANCHORED_SECTION_BYTES) return compact\n const domains = [...new Set(targets.map((target) => target.domain))]\n return renderGroupedTableSection(\n '## Exact override targets',\n header,\n divider,\n domains.map((domain) => ({\n title: domain,\n rows: renderRows(targets.filter((target) => target.domain === domain)),\n })),\n )\n}\n\nexport interface ReferenceProjectionFingerprints {\n sourceFingerprint: string\n taxonomyFingerprint: string\n}\n\nexport interface ModuleFactsMarkdownSection {\n slug: string\n title: string\n description: string\n markdown: string\n}\n\nexport interface ModuleFactsMarkdownDirectory {\n index: string\n sections: ModuleFactsMarkdownSection[]\n}\n\n/**\n * Header for a `local-reference` projection. It never claims a package version \u2014 the\n * module is app-local \u2014 and it states in the document itself that the activations and\n * exact override targets below describe behavior only after the module is opted in,\n * because the artifact is generated while the module is disabled.\n */\nfunction renderReferenceProjectionHeader(\n facts: ModuleFacts,\n fingerprints: ReferenceProjectionFingerprints,\n): string[] {\n return [\n `# ${facts.module} \u2014 module facts (generated reference projection, do not edit)`,\n `<!-- generated from local reference ${facts.sourceRoot}; source-fingerprint ${fingerprints.sourceFingerprint}; taxonomy-fingerprint ${fingerprints.taxonomyFingerprint} \u2014 R1 staleness stamp -->`,\n `> Reference projection: \\`${facts.module}\\` is not selected by the current runtime. Its activations and exact override targets describe behavior only after opt-in in \\`src/modules.ts\\`.`,\n `Source root: ${renderSourceLink(facts.sourceRoot)}`,\n ]\n}\n\nfunction buildModuleFactsSections(\n facts: ModuleFacts,\n context: ModuleFactsRenderContext,\n): string[] {\n const extensionSurfaces = facts.extensionSurfaces ?? { hosts: [], contributions: [], unresolved: [] }\n const lookup = buildFactSourceLookup(facts)\n const sections = [\n renderEntitiesSection(facts.entities, lookup, context),\n renderEventsSection(facts.events, lookup, context),\n renderSourceLinkedListSection(\n `## ACL features (${facts.aclFeatures.length})`,\n facts.aclFeatures,\n lookup,\n 'acl-feature',\n 'Feature',\n context,\n ),\n renderApiRoutesSection(facts.apiRoutes, context),\n renderLinkedFactsSection(\n '## Backend pages',\n facts.backendPages.map((page) => ({ label: page.path, sourcePath: page.sourcePath })),\n context,\n ),\n renderLinkedFactsSection(\n '## Frontend pages',\n facts.frontendPages.map((page) => ({ label: page.path, sourcePath: page.sourcePath })),\n context,\n ),\n renderSourceLinkedListSection('## DI service tokens', facts.diTokens, lookup, 'di-registration', 'Token', context),\n renderSourceLinkedListSection('## Search entities', facts.searchEntities, lookup, 'search', 'Entity ID', context),\n renderHostTokensSection(facts.hostTokens),\n renderExtensionHostsSection(extensionSurfaces, context),\n renderExtensionContributionsSection(extensionSurfaces, context),\n renderActivationBindingsSection(extensionSurfaces, context),\n renderIncomingContributionsSection(extensionSurfaces, context),\n renderContributionResolutionsSection(extensionSurfaces, lookup, context),\n renderExtensionDiagnosticsSection(extensionSurfaces),\n renderSourceLinkedListSection('## Notifications', facts.notifications, lookup, 'notification', 'Notification ID', context),\n renderLinkedFactsSection(\n '## CLI commands',\n facts.cliCommands.map((command) => ({ label: command.command, sourcePath: command.sourcePath })),\n context,\n ),\n renderLinkedFactsSection(\n '## AI tools / MCP capabilities',\n facts.aiTools.map((tool) => ({ label: tool.name, sourcePath: tool.sourcePath })),\n context,\n ),\n renderLinkedFactsSection(\n '## AI agents',\n facts.aiAgents.map((agent) => ({ label: agent.id, sourcePath: agent.sourcePath })),\n context,\n ),\n renderOverrideTargetsSection(facts.overrideTargets, context),\n ].filter((section) => section.length > 0)\n const owned = facts.ownedContracts ?? {}\n sections.push(...[\n renderOwnedContractSection('## Owned contract \u2014 module metadata', owned['module-metadata'], context),\n renderOwnedContractSection('## Domain commands', owned.command, context),\n renderOwnedContractSection('## Workers', owned.worker, context),\n renderOwnedContractSection('## Page middleware', owned['page-middleware'], context),\n renderOwnedContractSection('## Setup', owned.setup, context),\n renderOwnedContractSection('## Encryption', owned.encryption, context),\n renderDiRegistrationsSection(owned['di-registration'], context),\n renderOwnedContractSection('## Custom entities', owned['custom-entity'], context),\n renderOwnedContractSection('## AI extensions', owned['ai-extension'], context),\n renderOwnedContractSection('## Generator plugins', owned['generator-plugin'], context),\n ].filter((section) => section.length > 0))\n return sections\n}\n\nfunction sectionTitle(section: string): string {\n return section.split('\\n', 1)[0].replace(/^## /, '').replace(/\\s+\\(\\d+\\)\\s*$/, '')\n}\n\nfunction sectionSlug(title: string): string {\n return title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n}\n\nfunction approximateSize(markdown: string): string {\n return `~${Math.max(1, Math.ceil(Buffer.byteLength(markdown) / 1024))} KB`\n}\n\nfunction collectSectionAnchors(sections: readonly string[]): ModuleFactsAnchor[] {\n const anchors: ModuleFactsAnchor[] = []\n let sectionOffset = 0\n for (const section of sections) {\n const lines = section.split('\\n')\n anchors.push({ title: sectionTitle(section), offset: sectionOffset, size: approximateSize(section), depth: 0 })\n for (let index = 0; index < lines.length; index += 1) {\n if (lines[index].startsWith('### ')) {\n const nextSubheading = lines.slice(index + 1).findIndex((line) => line.startsWith('### '))\n const end = nextSubheading === -1 ? lines.length : index + 1 + nextSubheading\n anchors.push({\n title: `${sectionTitle(section)} / ${lines[index].slice(4)}`,\n offset: sectionOffset + index,\n size: approximateSize(lines.slice(index, end).join('\\n')),\n depth: 1,\n })\n }\n }\n sectionOffset += lines.length + 1\n }\n return anchors\n}\n\nfunction renderSectionedMarkdown(\n facts: ModuleFacts,\n header: readonly string[],\n sections: readonly string[],\n): string {\n const anchors = collectSectionAnchors(sections)\n const indexLineCount = 6 + anchors.length\n const firstSectionLine = header.length + indexLineCount + 1\n const contents = anchors.map((anchor) => {\n const prefix = anchor.depth === 1 ? ' ' : ''\n return `${prefix}- ${anchor.title} \u2014 L${firstSectionLine + anchor.offset}, ${anchor.size}`\n })\n return [\n ...header,\n '',\n '## Contents',\n '',\n ...contents,\n '',\n 'Read caps: a read that does not reach the end-of-facts marker was truncated \u2014 re-read the missing sections by their line anchors.',\n '',\n sections.join('\\n\\n'),\n '',\n `<!-- end module facts: ${facts.module} \u2014 ${sections.length} sections -->`,\n '',\n ].join('\\n')\n}\n\n/**\n * @deprecated Superseded by {@link renderModuleFactsDirectory}, which both build\n * pipelines write. The hrefs rendered here assume the retired flat\n * `.ai/guides/modules/<id>.md` location and resolve one path segment short of the\n * shipped `<id>/index.md` layout. Retained so existing callers keep working.\n */\nexport function renderModuleFactsMarkdown(\n facts: ModuleFacts,\n referenceProjection?: ReferenceProjectionFingerprints,\n): string {\n const header = facts.sourceKind === 'local-reference' && referenceProjection\n ? renderReferenceProjectionHeader(facts, referenceProjection)\n : [\n `# ${facts.module} \u2014 module facts (generated, do not edit)`,\n renderVersionStamp(facts.coreVersion, facts.sourcePackage, facts.sourceVersion),\n `Source root: ${renderSourceLink(facts.sourceRoot)}`,\n ]\n const context = { sourceRoot: facts.sourceRoot, sourceLinkPrefix: '../../../' }\n return renderSectionedMarkdown(facts, header, buildModuleFactsSections(facts, context))\n}\n\nexport function renderModuleFactsDirectory(\n facts: ModuleFacts,\n referenceProjection?: ReferenceProjectionFingerprints,\n): ModuleFactsMarkdownDirectory {\n const header = facts.sourceKind === 'local-reference' && referenceProjection\n ? renderReferenceProjectionHeader(facts, referenceProjection)\n : [\n `# ${facts.module} \u2014 module facts (generated, do not edit)`,\n renderVersionStamp(facts.coreVersion, facts.sourcePackage, facts.sourceVersion),\n `Source root: ${facts.sourceRoot}`,\n ]\n const context = { sourceRoot: facts.sourceRoot, sourceLinkPrefix: '../../../../' }\n const renderedSections = buildModuleFactsSections(facts, context)\n .filter((section) => !section.endsWith(`\\n\\n${EMPTY_SECTION_MARKER}`))\n const sectionEntries = renderedSections.map((section) => {\n const title = sectionTitle(section)\n const slug = sectionSlug(title)\n const markdown = [\n `# ${facts.module} \u2014 ${title}`,\n '',\n '[Back to module index](index.md)',\n '',\n section,\n '',\n `<!-- end module facts section: ${facts.module}/${slug} -->`,\n '',\n ].join('\\n')\n const subsections = collectSectionAnchors([section])\n .filter((anchor) => anchor.depth === 1)\n .map((anchor) => ({ ...anchor, line: anchor.offset + 5 }))\n return {\n section: {\n slug,\n title,\n description: `Generated ${title.toLowerCase()} facts for ${facts.module}.`,\n markdown,\n },\n subsections,\n }\n })\n const sections = sectionEntries.map((entry) => entry.section)\n const sectionLinks = sectionEntries.flatMap(({ section, subsections }) => [\n `- [${section.title}](${section.slug}.md) \u2014 ${approximateSize(section.markdown)} \u2014 ${section.description}`,\n ...subsections.map((anchor) =>\n ` - ${anchor.title} \u2014 ${section.slug}.md:L${anchor.line}, ${anchor.size}`,\n ),\n ])\n const index = [\n ...header,\n '',\n '## Sections',\n '',\n ...sectionLinks,\n '',\n 'Read only the section files needed for the task; every section ends with a completion marker.',\n `A section absent from this list has no facts for ${facts.module}; this index is complete only when the read reaches the marker below.`,\n '',\n `<!-- end module facts: ${facts.module} \u2014 ${sections.length} sections -->`,\n '',\n ].join('\\n')\n return { index, sections }\n}\n\nexport function toModuleFactsJsonEntry(facts: ModuleFacts): ModuleFactsJsonEntry {\n return {\n title: facts.title,\n description: facts.description,\n coreVersion: facts.coreVersion,\n sourcePackage: facts.sourcePackage,\n sourceVersion: facts.sourceVersion,\n sourceRoot: facts.sourceRoot,\n ...(facts.sourceKind === 'local-reference' ? { sourceKind: facts.sourceKind } : {}),\n entities: facts.entities,\n events: facts.events.map((event) => ({\n id: event.id,\n category: event.category,\n entity: event.entity,\n ...(event.clientBroadcast !== undefined ? { clientBroadcast: event.clientBroadcast } : {}),\n ...(event.portalBroadcast !== undefined ? { portalBroadcast: event.portalBroadcast } : {}),\n })),\n aclFeatures: facts.aclFeatures,\n apiRoutes: facts.apiRoutes,\n diTokens: facts.diTokens,\n searchEntities: facts.searchEntities,\n hostTokens: facts.hostTokens,\n notifications: facts.notifications,\n cli: facts.cli,\n backendPages: facts.backendPages,\n frontendPages: facts.frontendPages,\n cliCommands: facts.cliCommands,\n aiTools: facts.aiTools,\n aiAgents: facts.aiAgents,\n ...(facts.extensionSurfaces ? { extensionSurfaces: facts.extensionSurfaces } : {}),\n ...(facts.factSources && facts.factSources.length > 0 ? { factSources: facts.factSources } : {}),\n ...(facts.ownedContracts && Object.keys(facts.ownedContracts).length > 0\n ? { ownedContracts: facts.ownedContracts }\n : {}),\n ...(facts.factDiagnostics && facts.factDiagnostics.length > 0\n ? { factDiagnostics: facts.factDiagnostics }\n : {}),\n ...(facts.overrideTargets && facts.overrideTargets.length > 0\n ? { overrideTargets: facts.overrideTargets }\n : {}),\n ...(facts.overrideTargetDiagnostics && facts.overrideTargetDiagnostics.length > 0\n ? { overrideTargetDiagnostics: facts.overrideTargetDiagnostics }\n : {}),\n }\n}\n\nexport function buildModuleFactsJsonObject(\n factsByModule: Record<string, ModuleFacts>,\n): Record<string, ModuleFactsJsonEntry> {\n const result: Record<string, ModuleFactsJsonEntry> = {}\n for (const moduleId of Object.keys(factsByModule).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))) {\n result[moduleId] = toModuleFactsJsonEntry(factsByModule[moduleId])\n }\n return result\n}\n\nexport function renderModuleFactsJson(factsByModule: Record<string, ModuleFacts>): string {\n return `${JSON.stringify(buildModuleFactsJsonObject(factsByModule), null, 2)}\\n`\n}\n\n/**\n * The normal package sidecar (`module-facts.json`) and the enabled-filtered package\n * markdown subset carry package-provided modules only. An app-local module reaching\n * either output would publish `bound` activations and exact override targets for code\n * the runtime does not select, so it fails the build instead of shipping.\n */\nexport function assertPackageModuleFactsOnly(factsByModule: Record<string, ModuleFacts>): void {\n const offenders = Object.values(factsByModule)\n .filter((facts) => facts.sourceKind === 'local-reference' || !facts.sourceRoot.startsWith('node_modules/'))\n .map((facts) => `${facts.module} (${facts.sourceRoot})`)\n .sort((left, right) => left.localeCompare(right))\n if (offenders.length > 0) {\n throw new Error(\n `[module-facts] normal package output must not contain app-local modules: ${offenders.join(', ')}`,\n )\n }\n}\n\nfunction sha256Hex(value: string | Buffer): string {\n return createHash('sha256').update(value).digest('hex')\n}\n\n/**\n * Canonical form used by both reference fingerprints: object keys are recursively sorted\n * and set-valued arrays are sorted by their own canonical text. Structured `path` arrays\n * are ordered tuples whose segment order is part of the public target identity, so they\n * retain their declared order.\n */\nfunction canonicalizeFingerprintValue(value: unknown, propertyName?: string): unknown {\n if (Array.isArray(value)) {\n const items = value\n .map((item) => {\n const canonical = canonicalizeFingerprintValue(item)\n return { canonical, text: JSON.stringify(canonical) ?? '' }\n })\n if (propertyName === 'path') return items.map((item) => item.canonical)\n return items\n .sort((left, right) => (left.text < right.text ? -1 : left.text > right.text ? 1 : 0))\n .map((item) => item.canonical)\n }\n if (value !== null && typeof value === 'object') {\n const record = value as Record<string, unknown>\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(record).sort((left, right) => (left < right ? -1 : left > right ? 1 : 0))) {\n if (record[key] === undefined) continue\n result[key] = canonicalizeFingerprintValue(record[key], key)\n }\n return result\n }\n return value\n}\n\nfunction canonicalFingerprintJson(value: unknown): string {\n return JSON.stringify(canonicalizeFingerprintValue(value))\n}\n\nconst REFERENCE_FINGERPRINT_SKIPPED_DIRECTORIES = new Set(['__tests__', '__integration__', 'node_modules'])\n\n/**\n * SHA-256 over the canonical JSON of `{ path, sha256 }` records sorted by path, where\n * `path` is the portable app-relative path so the value is identical across the\n * authoring, template, and emitted roots. Test-only directories are excluded because the\n * scaffold does not emit them, so including them would make the emitted app's recomputed\n * fingerprint disagree with the one built from the template.\n */\nexport function computeModuleSourceFingerprint(moduleRoot: string, portableSourceRoot: string): string {\n assertPortableSourceRoot(path.basename(portableSourceRoot), portableSourceRoot)\n const records: { path: string; sha256: string }[] = []\n const walk = (directory: string): void => {\n const entries = fs.readdirSync(directory, { withFileTypes: true })\n for (const entry of entries) {\n const fullPath = path.join(directory, entry.name)\n if (entry.isDirectory()) {\n if (REFERENCE_FINGERPRINT_SKIPPED_DIRECTORIES.has(entry.name)) continue\n walk(fullPath)\n continue\n }\n if (!entry.isFile()) continue\n records.push({\n path: toPortableSourcePath(moduleRoot, portableSourceRoot, fullPath),\n sha256: sha256Hex(fs.readFileSync(fullPath)),\n })\n }\n }\n walk(moduleRoot)\n records.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0))\n return sha256Hex(canonicalFingerprintJson(records))\n}\n\n/**\n * Provenance and release metadata are not taxonomy: a version bump must not invalidate\n * the classification fingerprint. Every remaining section of the emitted entry is a\n * classified set and contributes.\n */\nconst TAXONOMY_EXCLUDED_SECTIONS = new Set([\n 'title',\n 'description',\n 'coreVersion',\n 'sourcePackage',\n 'sourceVersion',\n 'sourceRoot',\n 'sourceKind',\n])\n\nfunction collectTaxonomyRecords(\n setName: string,\n value: unknown,\n records: { setName: string; value: unknown }[],\n): void {\n if (value === undefined) return\n if (Array.isArray(value)) {\n for (const item of value) records.push({ setName, value: canonicalizeFingerprintValue(item) })\n return\n }\n if (value !== null && typeof value === 'object') {\n for (const [key, child] of Object.entries(value as Record<string, unknown>)) {\n collectTaxonomyRecords(`${setName}.${key}`, child, records)\n }\n return\n }\n records.push({ setName, value })\n}\n\n/**\n * SHA-256 over the canonical JSON of `{ setName, value }` records sorted by set name and\n * canonicalized value. Each record carries a complete literal or structured entry \u2014 key,\n * suffix, capabilities, `bound`, phases, operations included \u2014 so no delimiter-joined\n * tuple can collapse two distinct classifications into one fingerprint input.\n */\nexport function computeModuleTaxonomyFingerprint(entry: ModuleFactsJsonEntry): string {\n const records: { setName: string; value: unknown }[] = []\n for (const [setName, value] of Object.entries(entry as unknown as Record<string, unknown>)) {\n if (TAXONOMY_EXCLUDED_SECTIONS.has(setName)) continue\n collectTaxonomyRecords(setName, value, records)\n }\n const decorated = records\n .map((record) => ({ record, text: JSON.stringify(record.value) ?? '' }))\n .sort((left, right) =>\n left.record.setName < right.record.setName\n ? -1\n : left.record.setName > right.record.setName\n ? 1\n : left.text < right.text\n ? -1\n : left.text > right.text\n ? 1\n : 0,\n )\n return sha256Hex(JSON.stringify(decorated.map((item) => item.record)))\n}\n\nexport interface ReferenceModuleFactsEntry {\n moduleId: string\n projectionKind: 'activated-reference'\n sourceKind: 'local-reference'\n runtimeSelected: false\n sourceFingerprint: string\n taxonomyFingerprint: string\n /**\n * The enum-derived classification of every taxonomy `facts` is expressed in, built\n * by the same generation run. It travels with the projection so a reader of the\n * emitted sheet can tell a value the example really emits from one that is only\n * reserved, pending, or reachable through a negative fixture.\n */\n factCoverage: ModuleFactCoverageFamily[]\n facts: ModuleFactsJsonEntry\n}\n\nexport type ReferenceModuleFactsJson = Record<string, ReferenceModuleFactsEntry>\n\nexport function renderReferenceModuleFactsJson(bundle: ReferenceModuleFactsJson): string {\n const ordered: ReferenceModuleFactsJson = {}\n for (const moduleId of Object.keys(bundle).sort((left, right) => (left < right ? -1 : left > right ? 1 : 0))) {\n ordered[moduleId] = bundle[moduleId]\n }\n return `${JSON.stringify(ordered, null, 2)}\\n`\n}\n\nexport interface ExtractLocalReferenceModuleFactsOptions {\n /** Package-provided sources, exactly as the normal batch receives them. */\n packageSources: readonly ModuleFactSource[]\n /** The app-local module projected into the reference bundle. */\n reference: ModuleFactSource\n registryPath?: string | null\n registrySource?: string | null\n coreVersion?: string | null\n}\n\nexport interface LocalReferenceModuleFactsResult {\n entry: ReferenceModuleFactsEntry\n /** @deprecated Flat rendering; read `directory` for the shipped layout. */\n markdown: string\n directory: ModuleFactsMarkdownDirectory\n warnings: string[]\n /**\n * First-party targets the activated projection could not correlate. They also remain in\n * the emitted `facts.extensionSurfaces.unresolved`, so the artifact states its own gaps\n * rather than presenting a partial surface as complete.\n */\n unresolvedTargets: string[]\n}\n\n/**\n * Produces the reference projection of an app-local module from an explicitly activated,\n * disposable selection context: the local source is appended to the package sources and\n * the whole set runs through the same `extractAllModuleFacts` selection and correlation\n * batch, so incoming contributions and optional targets resolve exactly as they would\n * after opt-in. Merging an independently extracted object into a finished batch is\n * forbidden \u2014 it would silently drop both resolutions. The batch is disposable: the\n * caller keeps only this module's projection and never writes the rest, which is why the\n * normal package outputs stay byte-identical.\n */\nexport function extractLocalReferenceModuleFacts(\n options: ExtractLocalReferenceModuleFactsOptions,\n): LocalReferenceModuleFactsResult {\n const { reference } = options\n if (reference.sourceKind !== 'local-reference') {\n throw new Error(\n `[module-facts] reference source \"${reference.moduleId}\" must declare sourceKind \"local-reference\"`,\n )\n }\n const portableSourceRoot = reference.portableSourceRoot\n if (!portableSourceRoot) {\n throw new Error(`[module-facts] reference source \"${reference.moduleId}\" must declare portableSourceRoot`)\n }\n assertPortableSourceRoot(reference.moduleId, portableSourceRoot)\n\n const sources = appendLocalReferenceModuleSource(options.packageSources, reference)\n const activated = extractAllModuleFacts({\n sources,\n registryPath: options.registryPath ?? null,\n registrySource: options.registrySource ?? null,\n coreVersion: options.coreVersion ?? null,\n // The disposable projection collects rather than throws: an app-local module can name\n // a target whose classification is still missing from the shared extension reader, and\n // aborting there would delete the whole reference bundle instead of publishing the\n // exact gap. Normal package output keeps the strict default.\n unresolvedFirstPartyTargets: 'collect',\n })\n const facts = activated.factsByModule[reference.moduleId]\n if (!facts) {\n throw new Error(`[module-facts] reference module \"${reference.moduleId}\" produced no facts`)\n }\n if (facts.sourceRoot !== portableSourceRoot) {\n throw new Error(\n `[module-facts] reference module \"${reference.moduleId}\" emitted non-portable source root \"${facts.sourceRoot}\"`,\n )\n }\n\n const jsonEntry = toModuleFactsJsonEntry(facts)\n const fingerprints: ReferenceProjectionFingerprints = {\n sourceFingerprint: computeModuleSourceFingerprint(reference.moduleRoot, portableSourceRoot),\n taxonomyFingerprint: computeModuleTaxonomyFingerprint(jsonEntry),\n }\n return {\n entry: {\n moduleId: reference.moduleId,\n projectionKind: 'activated-reference',\n sourceKind: 'local-reference',\n runtimeSelected: false,\n ...fingerprints,\n factCoverage: activated.factCoverage ?? buildModuleFactCoverageLedger(),\n facts: jsonEntry,\n },\n markdown: renderModuleFactsMarkdown(facts, fingerprints),\n directory: renderModuleFactsDirectory(facts, fingerprints),\n warnings: activated.warnings,\n unresolvedTargets: activated.unresolvedFirstPartyTargets ?? [],\n }\n}\n\nexport interface ExtractAllModuleFactsOptions {\n /**\n * Discovered module sources (auto-discovery path). When provided, each entry's\n * explicit `moduleRoot` is used and `coreSrcRoot`/`moduleIds` are ignored.\n */\n sources?: readonly ModuleFactSource[]\n /** Legacy shared-root path. Used only when `sources` is not provided. */\n coreSrcRoot?: string\n registryPath?: string | null\n registrySource?: string | null\n coreVersion?: string | null\n /** @deprecated Legacy explicit module-id list; only consulted when `sources` is absent. */\n moduleIds?: readonly string[]\n /**\n * `throw` (the default, and the only value any normal package output uses) aborts the\n * batch when a first-party extension target does not correlate. `collect` keeps the\n * unresolved entries in `extensionSurfaces.unresolved` and reports them on the result\n * so a disposable projection can publish the gap instead of silently dropping it.\n */\n unresolvedFirstPartyTargets?: 'throw' | 'collect'\n /** Generated-facts compatibility projection. Omitted means the corrected v2 contract. */\n factsContractVersion?: 1 | 2\n}\n\nexport interface ExtractAllModuleFactsResult {\n factsByModule: Record<string, ModuleFacts>\n /** @deprecated Flat rendering; read `directoryByModule` for the shipped layout. */\n markdownByModule: Record<string, string>\n directoryByModule: Record<string, ModuleFactsMarkdownDirectory>\n warnings: string[]\n frameworkMarkdown: string\n /** Always empty under the default `throw` policy, which aborts before returning. */\n unresolvedFirstPartyTargets?: string[]\n /**\n * The enum-derived coverage ledger for the taxonomies these facts are expressed\n * in, built during generation so an enum value with no classification aborts the\n * run instead of shipping an unclassified public value.\n */\n factCoverage?: ModuleFactCoverageFamily[]\n}\n\n/**\n * `<moduleId>:<contributionId>:<targetId>` for every first-party contribution target that\n * did not correlate \u2014 the same identity {@link assertNoUnresolvedExtensionTargets} throws\n * with, so a collected batch reports exactly what a strict batch would have refused.\n */\nexport function collectUnresolvedFirstPartyTargets(\n surfacesByModule: Readonly<Record<string, ModuleExtensionSurfaceFacts>>,\n): string[] {\n return Object.entries(surfacesByModule)\n .flatMap(([moduleId, surface]) =>\n surface.unresolved\n .filter((entry) => entry.reason === 'unresolved-first-party-target')\n .map((entry) => `${moduleId}:${entry.key}`),\n )\n .sort((left, right) => left.localeCompare(right))\n}\n\nexport function extractAllModuleFacts(options: ExtractAllModuleFactsOptions): ExtractAllModuleFactsResult {\n return withModuleExtensionFactExtractionCache(() => extractAllModuleFactsWithCache(options))\n}\n\nfunction extractAllModuleFactsWithCache(options: ExtractAllModuleFactsOptions): ExtractAllModuleFactsResult {\n const factCoverage = buildModuleFactCoverageLedger()\n const sources: ModuleFactSource[] = options.sources\n ? [...options.sources]\n : (options.coreSrcRoot\n ? (options.moduleIds ?? []).map((moduleId) => ({\n moduleId,\n moduleRoot: path.join(options.coreSrcRoot as string, moduleId),\n }))\n : [])\n\n const factsByModule: Record<string, ModuleFacts> = {}\n const markdownByModule: Record<string, string> = {}\n const directoryByModule: Record<string, ModuleFactsMarkdownDirectory> = {}\n const warnings: string[] = []\n for (const source of sources) {\n const facts = extractModuleFacts({\n moduleId: source.moduleId,\n moduleRoot: source.moduleRoot,\n coreVersion: options.coreVersion ?? null,\n sourcePackage: source.from ?? null,\n sourceVersion: source.packageVersion ?? null,\n registryPath: options.registryPath ?? null,\n registrySource: options.registrySource ?? null,\n ...(source.portableSourceRoot ? { portableSourceRoot: source.portableSourceRoot } : {}),\n ...(source.sourceKind ? { sourceKind: source.sourceKind } : {}),\n factsContractVersion: options.factsContractVersion ?? 2,\n })\n factsByModule[source.moduleId] = facts\n warnings.push(...facts.warnings)\n }\n const surfacesByModule = Object.fromEntries(\n Object.entries(factsByModule).map(([moduleId, facts]) => [\n moduleId,\n facts.extensionSurfaces ?? { hosts: [], contributions: [], unresolved: [] },\n ]),\n )\n const correlated = correlateModuleExtensionFacts({\n surfacesByModule,\n entityIds: new Set(Object.values(factsByModule).flatMap((facts) => facts.entities.map((entity) => entity.id))),\n eventIds: new Set(Object.values(factsByModule).flatMap((facts) => facts.events.map((event) => event.id))),\n apiRoutes: new Set([\n ...Object.values(factsByModule).flatMap((facts) => facts.apiRoutes.map((route) => route.path)),\n ...sources.flatMap((source) => extractKnownApiRouteIds(source.moduleId, source.moduleRoot)),\n ]),\n commandIds: new Set(sources.flatMap((source) => extractKnownCommandIds(source.moduleId, source.moduleRoot))),\n factsContractVersion: options.factsContractVersion ?? 2,\n })\n const unresolvedFirstPartyTargets = collectUnresolvedFirstPartyTargets(correlated)\n if ((options.unresolvedFirstPartyTargets ?? 'throw') === 'throw') assertNoUnresolvedExtensionTargets(correlated)\n const apiRouteOwners = new Map<string, {\n moduleId: string\n source: ModuleFactSourceRef\n bridges: ApiRouteInterceptorBridge[]\n }>()\n const commandOwners = new Map<string, { moduleId: string; source: ModuleFactSourceRef }>()\n for (const source of [...sources].sort((left, right) => left.moduleId.localeCompare(right.moduleId))) {\n const facts = factsByModule[source.moduleId]\n const sourceRoot = facts ? facts.sourceRoot : source.moduleId\n const owners = extractActivationTargetOwners({\n moduleId: source.moduleId,\n moduleRoot: source.moduleRoot,\n sourceRoot,\n })\n for (const route of owners.apiRoutes) {\n if (!apiRouteOwners.has(route.id)) {\n apiRouteOwners.set(route.id, { moduleId: source.moduleId, source: route.source, bridges: route.bridges })\n }\n }\n for (const command of owners.commands) {\n if (!commandOwners.has(command.id)) commandOwners.set(command.id, { moduleId: source.moduleId, source: command.source })\n }\n }\n const withIncoming = correlateIncomingExtensions({\n surfacesByModule: correlated,\n apiRouteOwners,\n commandOwners,\n })\n for (const moduleId of Object.keys(factsByModule).sort((left, right) => left.localeCompare(right))) {\n factsByModule[moduleId].extensionSurfaces = withIncoming[moduleId]\n markdownByModule[moduleId] = renderModuleFactsMarkdown(factsByModule[moduleId])\n directoryByModule[moduleId] = renderModuleFactsDirectory(factsByModule[moduleId])\n warnings.push(...correlated[moduleId].unresolved.map((entry) =>\n `[module-facts] ${moduleId} ${entry.reason}: ${entry.key} (${entry.source.path})`,\n ))\n }\n return {\n factsByModule,\n markdownByModule,\n directoryByModule,\n warnings,\n frameworkMarkdown: renderFrameworkExtensionPointsMarkdown(),\n unresolvedFirstPartyTargets,\n factCoverage,\n }\n}\n\n/**\n * Enum-derived `factCoverage` ledger \u2014 spec\n * `.ai/specs/2026-07-31-standalone-canonical-example-module.md`,\n * \u00A7 PR #4883 Module-Fact and Extension-Topology Contract.\n *\n * Every finite public set is enumerated from the `as const` ledger that also derives\n * its type, so an added enum value has no ledger row and fails\n * {@link buildModuleFactCoverageLedger} instead of joining the public surface\n * unclassified. The purpose of the ledger is to make a *silent zero* impossible: a\n * family cannot claim canonical coverage while the real extractor publishes no\n * contribution for it.\n */\nexport type ModuleFactCoverageStatus =\n /** The canonical example really emits it; a real extraction proves a non-zero count. */\n | 'emitted-example'\n /** A framework/app-level setting that never becomes a module contribution. */\n | 'framework-only'\n /** Described by the framework catalog only; the example contributes nothing for it. */\n | 'catalog-only'\n /** In the closed public set, but no generator code path emits it today. */\n | 'currently-unbound'\n /**\n * Required to be `emitted-example` by the spec but NOT emitted yet. The status\n * itself states the gap, so a machine reader keying on `status` alone is never\n * told the example emits something it does not.\n */\n | 'pending-emission'\n /** Only a deliberately broken fixture produces it; canonical output emits none. */\n | 'negative-fixture'\n\nexport type ModuleFactCoverageRow = {\n value: string\n status: ModuleFactCoverageStatus\n note: string\n /**\n * Names the slice that owns closing a `pending-emission` gap. A pending row is\n * asserted to have a *zero* real count, so it can never be mistaken for proven\n * coverage and cannot go stale once the gap closes.\n */\n pendingEmission?: string\n /**\n * Set when the value is extractable only from the generated module registry rather\n * than from module source, so a source-only extraction legitimately reports zero.\n *\n * This is the only way a row skips the non-zero proof, so the flag is proven rather\n * than trusted: `module-facts.example-fact-coverage.test.ts` asserts every row\n * carrying it counts zero from a source-only extraction of the example AND non-zero\n * once the same extraction is handed a module registry.\n */\n requiresGeneratedRegistry?: true\n}\n\nexport type ModuleFactCoverageFamily = {\n family: string\n enumSource: string\n rows: ModuleFactCoverageRow[]\n}\n\nconst FACT_SOURCE_KIND_COVERAGE: Record<ModuleFactSourceKind, ModuleFactCoverageRow> = {\n 'module-metadata': { value: 'module-metadata', status: 'emitted-example', note: 'example/index.ts ModuleInfo export' },\n entity: { value: 'entity', status: 'emitted-example', note: 'example/data/entities.ts ORM entities' },\n event: { value: 'event', status: 'emitted-example', note: 'example/events.ts typed event definitions' },\n 'acl-feature': { value: 'acl-feature', status: 'emitted-example', note: 'example/acl.ts RBAC features' },\n 'api-route': {\n value: 'api-route',\n status: 'emitted-example',\n note: 'example/api/**/route.ts; route facts are read from the generated module registry, not from module source',\n requiresGeneratedRegistry: true,\n },\n 'di-registration': { value: 'di-registration', status: 'emitted-example', note: 'example/di.ts Awilix container.register' },\n search: { value: 'search', status: 'emitted-example', note: 'example/search.ts indexed entity declaration' },\n vector: {\n value: 'vector',\n status: 'emitted-example',\n note: 'example/vector.ts deterministic Todo vector declaration',\n },\n notification: { value: 'notification', status: 'emitted-example', note: 'example/notifications.ts notification types' },\n 'cli-command': { value: 'cli-command', status: 'emitted-example', note: 'example/cli.ts module commands' },\n 'backend-page': { value: 'backend-page', status: 'emitted-example', note: 'example/backend/**/page.tsx admin pages' },\n 'frontend-page': { value: 'frontend-page', status: 'emitted-example', note: 'example/frontend/**/page.tsx portal pages' },\n 'ai-tool': { value: 'ai-tool', status: 'emitted-example', note: 'example/ai-tools.ts defineAiTool declarations' },\n 'ai-agent': { value: 'ai-agent', status: 'emitted-example', note: 'example/ai-agents.ts defineAiAgent declarations' },\n 'ai-extension': { value: 'ai-extension', status: 'emitted-example', note: 'example AI agent/tool override and extension records' },\n command: { value: 'command', status: 'emitted-example', note: 'example/commands/todos.ts command handlers' },\n subscriber: { value: 'subscriber', status: 'emitted-example', note: 'example/subscribers/*.ts event subscribers' },\n worker: { value: 'worker', status: 'emitted-example', note: 'example/workers/*.ts queue workers' },\n 'page-middleware': { value: 'page-middleware', status: 'emitted-example', note: 'example/backend/middleware.ts page guard' },\n setup: { value: 'setup', status: 'emitted-example', note: 'example/setup.ts tenant setup hooks' },\n encryption: { value: 'encryption', status: 'emitted-example', note: 'example/encryption.ts field encryption map' },\n 'custom-entity': { value: 'custom-entity', status: 'emitted-example', note: 'example/ce.ts custom entity and field DSL' },\n integration: { value: 'integration', status: 'emitted-example', note: 'example/lib/mock-*-adapter.ts integration registrations' },\n 'generator-plugin': {\n value: 'generator-plugin',\n status: 'emitted-example',\n note: 'example/generators.ts deterministic reference-index generator plugin',\n },\n 'extension-host': { value: 'extension-host', status: 'emitted-example', note: 'example/extension-points.ts declared hosts' },\n 'extension-contribution': {\n value: 'extension-contribution',\n status: 'emitted-example',\n note: 'example widget, DataTable, CrudForm, interceptor and enricher contributions',\n },\n}\n\nconst OWNED_CONTRACT_KIND_COVERAGE: Record<ModuleOwnedContractKind, ModuleFactCoverageRow> = {\n 'module-metadata': { value: 'module-metadata', status: 'emitted-example', note: 'ModuleInfo owned contract' },\n command: { value: 'command', status: 'emitted-example', note: 'example/commands/todos.ts' },\n worker: { value: 'worker', status: 'emitted-example', note: 'example/workers/*.ts' },\n 'page-middleware': { value: 'page-middleware', status: 'emitted-example', note: 'example/backend/middleware.ts' },\n setup: { value: 'setup', status: 'emitted-example', note: 'example/setup.ts' },\n encryption: { value: 'encryption', status: 'emitted-example', note: 'example/encryption.ts' },\n 'di-registration': {\n value: 'di-registration',\n status: 'emitted-example',\n note: 'example/di.ts scoped Todo summary cache service consumed by a route',\n },\n 'custom-entity': { value: 'custom-entity', status: 'emitted-example', note: 'example/ce.ts' },\n 'ai-extension': { value: 'ai-extension', status: 'emitted-example', note: 'example AI override/extension record' },\n 'generator-plugin': {\n value: 'generator-plugin',\n status: 'emitted-example',\n note: 'example/generators.ts deterministic reference-index generator plugin',\n },\n}\n\nconst OVERRIDE_DOMAIN_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n ai: { value: 'ai', status: 'emitted-example', note: 'ai.agents, ai.tools and ai.extensions targets' },\n routes: { value: 'routes', status: 'emitted-example', note: 'routes.api and routes.pages targets' },\n events: { value: 'events', status: 'emitted-example', note: 'events.subscribers targets' },\n workers: { value: 'workers', status: 'emitted-example', note: 'workers targets' },\n widgets: { value: 'widgets', status: 'emitted-example', note: 'widgets.injection, .components and .dashboard targets' },\n notifications: { value: 'notifications', status: 'emitted-example', note: 'notifications.types and notifications.handlers targets' },\n interceptors: { value: 'interceptors', status: 'emitted-example', note: 'API interceptor targets' },\n commandInterceptors: { value: 'commandInterceptors', status: 'emitted-example', note: 'command interceptor targets' },\n enrichers: { value: 'enrichers', status: 'emitted-example', note: 'response enricher targets' },\n guards: { value: 'guards', status: 'emitted-example', note: 'page-middleware guard targets' },\n cli: { value: 'cli', status: 'emitted-example', note: 'CLI command targets' },\n setup: { value: 'setup', status: 'emitted-example', note: 'setup hook and default-role targets' },\n acl: { value: 'acl', status: 'emitted-example', note: 'acl.features targets' },\n di: { value: 'di', status: 'emitted-example', note: 'DI token targets' },\n encryption: { value: 'encryption', status: 'emitted-example', note: 'encryption.maps targets' },\n nav: {\n value: 'nav',\n status: 'framework-only',\n note: 'nav.groupOrder is an app-level framework setting; no module target is ever emitted for it',\n },\n}\n\nconst OVERRIDE_MODE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'disable-replace': {\n value: 'disable-replace',\n status: 'emitted-example',\n note: 'default mode for most example override hosts',\n },\n replace: { value: 'replace', status: 'emitted-example', note: 'the setup host replaces wholesale' },\n additive: { value: 'additive', status: 'emitted-example', note: 'the ai.extensions host merges additively' },\n}\n\nconst OVERRIDE_NOTE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'safe-metadata-only': {\n value: 'safe-metadata-only',\n status: 'emitted-example',\n note: 'emitted on the metadata-only override target',\n },\n 'page-middleware-not-mutation-guard': {\n value: 'page-middleware-not-mutation-guard',\n status: 'emitted-example',\n note: 'emitted on the guards target so a page guard is not read as a mutation guard',\n },\n}\n\n/**\n * Every `negative-fixture` row here names a code that a real fixture in\n * `module-override-targets.diagnostic-wiring.test.ts` drives out of\n * `collectModuleOverrideTargets`; the coverage test asserts that fixture set matches\n * these rows exactly, so a row can never claim a fixture that does not exist.\n */\nconst OVERRIDE_DIAGNOSTIC_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'missing-owned-fact': {\n value: 'missing-owned-fact',\n status: 'currently-unbound',\n note: 'reserved by the spec\\'s closed diagnostic set; no adapter emits it today, so not even a broken fixture can produce it',\n },\n 'missing-source': {\n value: 'missing-source',\n status: 'negative-fixture',\n note: 'a fact whose provenance cannot be proven yields this and no target; activated canonical output emits none',\n },\n 'unsupported-dynamic-key': {\n value: 'unsupported-dynamic-key',\n status: 'negative-fixture',\n note: 'a key the runtime cannot address yields this and no target; activated canonical output emits none',\n },\n 'unknown-framework-domain': {\n value: 'unknown-framework-domain',\n status: 'negative-fixture',\n note: 'the framework catalog does not describe the dotted host at all',\n },\n 'unknown-framework-mode': {\n value: 'unknown-framework-mode',\n status: 'negative-fixture',\n note: 'the framework catalog describes the host but names an operation that is not a public mode',\n },\n}\n\nconst CONTRIBUTION_KIND_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n widget: { value: 'widget', status: 'emitted-example', note: 'example widget injection and dashboard registrations' },\n 'data-table': { value: 'data-table', status: 'emitted-example', note: 'example DataTable extension entries' },\n 'crud-form': { value: 'crud-form', status: 'emitted-example', note: 'example CrudForm field and lifecycle entries' },\n 'component-override': { value: 'component-override', status: 'emitted-example', note: 'example replace, wrapper and props component entries' },\n 'response-enricher': { value: 'response-enricher', status: 'emitted-example', note: 'example customer priority response enricher' },\n 'api-interceptor': { value: 'api-interceptor', status: 'emitted-example', note: 'example CRUD API interceptor entries' },\n 'command-interceptor': { value: 'command-interceptor', status: 'emitted-example', note: 'example command interceptor entries' },\n 'mutation-guard': { value: 'mutation-guard', status: 'emitted-example', note: 'example Todo mutation guard' },\n 'entity-extension': { value: 'entity-extension', status: 'emitted-example', note: 'example customer entity extension' },\n subscriber: { value: 'subscriber', status: 'emitted-example', note: 'example synchronous and asynchronous subscribers' },\n 'browser-reaction': { value: 'browser-reaction', status: 'emitted-example', note: 'example client, portal and notification reactions' },\n 'specialized-registry': { value: 'specialized-registry', status: 'emitted-example', note: 'example notification, search, AI and mock adapter registries' },\n 'module-override': { value: 'module-override', status: 'catalog-only', note: 'app-owned configuration is not an outgoing module contribution' },\n}\n\nconst ACTIVATION_KIND_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'crud-response-enricher': { value: 'crud-response-enricher', status: 'currently-unbound', note: 'example contributes a response enricher but owns no CRUD response call site for its customer target' },\n 'query-enricher': { value: 'query-enricher', status: 'currently-unbound', note: 'example contributes a query enricher but owns no query-engine call site for its customer target' },\n 'mutation-guard': { value: 'mutation-guard', status: 'emitted-example', note: 'Todo mutation-guard route bridge' },\n 'api-interceptor-bridge': { value: 'api-interceptor-bridge', status: 'emitted-example', note: 'CRUD route interceptor pipeline' },\n 'command-interceptor-bridge': { value: 'command-interceptor-bridge', status: 'emitted-example', note: 'exact Todo command bus target' },\n 'widget-injection-consumer': { value: 'widget-injection-consumer', status: 'emitted-example', note: 'bound injection host consumer' },\n 'component-extension-consumer': { value: 'component-extension-consumer', status: 'emitted-example', note: 'bound component handle consumer' },\n 'dashboard-host-consumer': { value: 'dashboard-host-consumer', status: 'emitted-example', note: 'framework dashboard registry consumer' },\n}\n\nconst HOST_FAMILY_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n generic: { value: 'generic', status: 'emitted-example', note: 'example headless injection host' },\n menu: { value: 'menu', status: 'framework-only', note: 'framework menu hosts consumed by example widgets' },\n 'data-table': { value: 'data-table', status: 'emitted-example', note: 'example Todo DataTable host' },\n 'crud-form': { value: 'crud-form', status: 'emitted-example', note: 'example Todo CrudForm host' },\n detail: { value: 'detail', status: 'framework-only', note: 'framework detail hosts consumed by example widgets' },\n 'portal-page': { value: 'portal-page', status: 'framework-only', note: 'framework portal host consumed by example widgets' },\n 'component-handle': { value: 'component-handle', status: 'emitted-example', note: 'example replaceable component host' },\n entity: { value: 'entity', status: 'emitted-example', note: 'example entity fact-reference hosts' },\n 'api-route': { value: 'api-route', status: 'framework-only', note: 'API route hosts are owned by the target module and consumed by example interceptors' },\n command: { value: 'command', status: 'framework-only', note: 'command hosts are owned by the target module and consumed by example interceptors' },\n event: { value: 'event', status: 'emitted-example', note: 'example event fact-reference hosts' },\n 'query-lifecycle': { value: 'query-lifecycle', status: 'emitted-example', note: 'example Todo query lifecycle hosts' },\n dashboard: { value: 'dashboard', status: 'framework-only', note: 'framework dashboard host consumed by example widgets' },\n notification: { value: 'notification', status: 'framework-only', note: 'framework notification host consumed by the example registry' },\n integration: { value: 'integration', status: 'framework-only', note: 'framework integration detail host consumed by example widgets' },\n 'specialized-registry': { value: 'specialized-registry', status: 'framework-only', note: 'framework-owned specialist registries accept example entries' },\n 'module-override': { value: 'module-override', status: 'framework-only', note: 'framework override catalog owns these hosts' },\n}\n\nconst HOST_CAPABILITY_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'render-widget': { value: 'render-widget', status: 'emitted-example', note: 'example render widget host and contributions' },\n 'headless-widget': { value: 'headless-widget', status: 'currently-unbound', note: 'injection-table facts do not yet distinguish headless widget payloads' },\n 'menu-item': { value: 'menu-item', status: 'currently-unbound', note: 'injection-table facts do not yet distinguish menu item payloads' },\n 'column-widget': { value: 'column-widget', status: 'emitted-example', note: 'example DataTable column host' },\n 'row-action': { value: 'row-action', status: 'emitted-example', note: 'example DataTable row-action host' },\n 'bulk-action': { value: 'bulk-action', status: 'emitted-example', note: 'example DataTable bulk-action host' },\n 'filter-widget': { value: 'filter-widget', status: 'emitted-example', note: 'example DataTable filter host' },\n 'toolbar-widget': { value: 'toolbar-widget', status: 'emitted-example', note: 'example DataTable toolbar host' },\n 'field-widget': { value: 'field-widget', status: 'emitted-example', note: 'example CrudForm field host' },\n 'lifecycle-handler': { value: 'lifecycle-handler', status: 'emitted-example', note: 'example CrudForm lifecycle host' },\n 'component-replacement': { value: 'component-replacement', status: 'emitted-example', note: 'example replaceable DataTable, CrudForm and component hosts' },\n 'response-enricher': { value: 'response-enricher', status: 'emitted-example', note: 'example entity enricher host' },\n 'query-enricher': { value: 'query-enricher', status: 'emitted-example', note: 'example query-enricher host' },\n 'api-interceptor': { value: 'api-interceptor', status: 'emitted-example', note: 'example API interceptor contribution and route bridge' },\n 'command-interceptor': { value: 'command-interceptor', status: 'emitted-example', note: 'example command interceptor and exact command owner' },\n 'mutation-guard': { value: 'mutation-guard', status: 'emitted-example', note: 'example entity mutation guard host' },\n 'entity-extension': { value: 'entity-extension', status: 'emitted-example', note: 'example entity extension host' },\n 'async-subscriber': { value: 'async-subscriber', status: 'emitted-example', note: 'example event subscriber host' },\n 'sync-subscriber': { value: 'sync-subscriber', status: 'emitted-example', note: 'example synchronous event subscriber host' },\n 'browser-client': { value: 'browser-client', status: 'emitted-example', note: 'example client-broadcast event host' },\n 'browser-portal': { value: 'browser-portal', status: 'emitted-example', note: 'example portal-broadcast event host' },\n 'registry-contribution': { value: 'registry-contribution', status: 'emitted-example', note: 'example specialized registry contributions' },\n 'module-override': { value: 'module-override', status: 'framework-only', note: 'framework override hosts; app configuration is not a contribution' },\n}\n\nconst HOST_ACTIVATION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n always: { value: 'always', status: 'emitted-example', note: 'always-active example declarations' },\n 'host-opt-in': { value: 'host-opt-in', status: 'emitted-example', note: 'example entity extension and response-enricher hosts' },\n 'caller-opt-in': { value: 'caller-opt-in', status: 'emitted-example', note: 'example query lifecycle and query enricher' },\n 'feature-gated': { value: 'feature-gated', status: 'currently-unbound', note: 'feature requirements are emitted but are not a distinct activation value' },\n}\n\nconst TARGET_KIND_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n module: { value: 'module', status: 'emitted-example', note: 'example module-scoped registry target' },\n entity: { value: 'entity', status: 'emitted-example', note: 'example entity extension, enricher and guard targets' },\n 'api-route': { value: 'api-route', status: 'emitted-example', note: 'example API interceptor targets' },\n command: { value: 'command', status: 'emitted-example', note: 'example exact and wildcard command targets' },\n 'widget-spot': { value: 'widget-spot', status: 'emitted-example', note: 'example injection targets' },\n component: { value: 'component', status: 'emitted-example', note: 'example component override targets' },\n event: { value: 'event', status: 'emitted-example', note: 'example subscriber targets' },\n notification: { value: 'notification', status: 'emitted-example', note: 'example notification registry target' },\n wildcard: { value: 'wildcard', status: 'emitted-example', note: 'example wildcard subscriber and interceptor targets' },\n}\n\nconst HOST_RESOLUTION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n exact: { value: 'exact', status: 'emitted-example', note: 'example exact declared hosts' },\n pattern: { value: 'pattern', status: 'emitted-example', note: 'example patterned host surfaces' },\n framework: { value: 'framework', status: 'framework-only', note: 'framework catalog host identity' },\n 'fact-ref': { value: 'fact-ref', status: 'emitted-example', note: 'example entity, event and query fact-reference hosts' },\n}\n\nconst TARGET_RESOLUTION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n exact: { value: 'exact', status: 'emitted-example', note: 'example exact target correlation' },\n pattern: { value: 'pattern', status: 'emitted-example', note: 'example wildcard and patterned target correlation' },\n framework: { value: 'framework', status: 'emitted-example', note: 'example contribution to a framework host' },\n 'fact-ref': { value: 'fact-ref', status: 'emitted-example', note: 'example contribution to a generated fact owner' },\n 'optional-external': { value: 'optional-external', status: 'emitted-example', note: 'example optional module target remains fail-soft' },\n unresolved: { value: 'unresolved', status: 'negative-fixture', note: 'only malformed targets remain unresolved' },\n}\n\nconst TOPOLOGY_RESOLUTION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n bound: { value: 'bound', status: 'emitted-example', note: 'example contribution reaches a verified runtime activation' },\n 'capability-only': { value: 'capability-only', status: 'emitted-example', note: 'declaration-backed capability without a separate caller activation' },\n 'optional-target-missing': { value: 'optional-target-missing', status: 'emitted-example', note: 'optional external target absent from the selected module set' },\n wildcard: { value: 'wildcard', status: 'emitted-example', note: 'wildcard contribution resolves against selected targets' },\n unresolved: { value: 'unresolved', status: 'negative-fixture', note: 'only malformed first-party targets remain unresolved' },\n}\n\nconst SPECIALIZED_REGISTRY_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n notification: { value: 'notification', status: 'emitted-example', note: 'example notification type registry' },\n integration: { value: 'integration', status: 'emitted-example', note: 'example credential-free integration bundle identity' },\n search: { value: 'search', status: 'emitted-example', note: 'example Todo search registry' },\n vector: { value: 'vector', status: 'emitted-example', note: 'example deterministic Todo vector registry' },\n ai: { value: 'ai', status: 'emitted-example', note: 'example AI tool and agent registries' },\n payment: { value: 'payment', status: 'emitted-example', note: 'example mock payment descriptors' },\n shipping: { value: 'shipping', status: 'emitted-example', note: 'example mock shipping registry identity' },\n currency: { value: 'currency', status: 'emitted-example', note: 'example deterministic currency provider identity' },\n workflow: { value: 'workflow', status: 'emitted-example', note: 'example event-triggered Todo workflow identity' },\n}\n\nconst COMPONENT_MODE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n replace: { value: 'replace', status: 'emitted-example', note: 'example replacement component' },\n wrapper: { value: 'wrapper', status: 'emitted-example', note: 'example decorating wrapper component' },\n props: { value: 'props', status: 'emitted-example', note: 'example props-transform component' },\n}\n\nconst FACT_DIAGNOSTIC_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'duplicate-source': { value: 'duplicate-source', status: 'negative-fixture', note: 'duplicate provenance fixture; canonical output emits none' },\n 'unresolved-static-contract': { value: 'unresolved-static-contract', status: 'negative-fixture', note: 'dynamic contract fixture; canonical output emits none' },\n}\n\nconst UNRESOLVED_REASON_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n 'unclassified-binding': { value: 'unclassified-binding', status: 'negative-fixture', note: 'malformed extension declaration fixture' },\n 'unbound-declaration': { value: 'unbound-declaration', status: 'negative-fixture', note: 'declared host without a real caller fixture' },\n 'dynamic-without-pattern': { value: 'dynamic-without-pattern', status: 'negative-fixture', note: 'dynamic host without a declared pattern fixture' },\n 'unresolved-first-party-target': { value: 'unresolved-first-party-target', status: 'negative-fixture', note: 'broken first-party target fixture' },\n}\n\nconst DATA_TABLE_SURFACE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n header: { value: 'header', status: 'emitted-example', note: 'bound Todo table header' },\n footer: { value: 'footer', status: 'emitted-example', note: 'bound Todo table footer' },\n toolbar: { value: 'toolbar', status: 'emitted-example', note: 'bound Todo table toolbar' },\n searchTrailing: { value: 'searchTrailing', status: 'emitted-example', note: 'bound Todo table search trailing surface' },\n columns: { value: 'columns', status: 'emitted-example', note: 'bound Todo table columns' },\n rowActions: { value: 'rowActions', status: 'emitted-example', note: 'bound Todo table row actions' },\n bulkActions: { value: 'bulkActions', status: 'emitted-example', note: 'bound Todo table bulk actions' },\n filters: { value: 'filters', status: 'emitted-example', note: 'bound Todo table filters' },\n replacement: { value: 'replacement', status: 'emitted-example', note: 'bound Todo table replacement' },\n emptyState: { value: 'emptyState', status: 'currently-unbound', note: 'catalog-declared DataTable surface has no runtime host' },\n}\n\nconst CRUD_FORM_SURFACE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n base: { value: 'base', status: 'emitted-example', note: 'bound Todo form base' },\n header: { value: 'header', status: 'emitted-example', note: 'bound Todo form header' },\n fields: { value: 'fields', status: 'emitted-example', note: 'bound Todo form fields' },\n replacement: { value: 'replacement', status: 'emitted-example', note: 'bound Todo form replacement' },\n beforeFields: { value: 'beforeFields', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n afterFields: { value: 'afterFields', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n footer: { value: 'footer', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n sidebar: { value: 'sidebar', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n group: { value: 'group', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n fieldBefore: { value: 'fieldBefore', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n fieldAfter: { value: 'fieldAfter', status: 'currently-unbound', note: 'catalog-declared CrudForm surface has no runtime host' },\n}\n\nconst CRUD_FORM_LIFECYCLE_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n transformValidation: { value: 'transformValidation', status: 'emitted-example', note: 'example Todo form lifecycle transformValidation' },\n transformDisplayData: { value: 'transformDisplayData', status: 'emitted-example', note: 'example Todo form lifecycle transformDisplayData' },\n onBeforeNavigate: { value: 'onBeforeNavigate', status: 'emitted-example', note: 'example Todo form lifecycle onBeforeNavigate' },\n onAppEvent: { value: 'onAppEvent', status: 'emitted-example', note: 'example Todo form lifecycle onAppEvent' },\n onVisibilityChange: { value: 'onVisibilityChange', status: 'emitted-example', note: 'example Todo form lifecycle onVisibilityChange' },\n onBeforeDelete: { value: 'onBeforeDelete', status: 'emitted-example', note: 'example Todo form lifecycle onBeforeDelete' },\n onDelete: { value: 'onDelete', status: 'emitted-example', note: 'example Todo form lifecycle onDelete' },\n onAfterDelete: { value: 'onAfterDelete', status: 'emitted-example', note: 'example Todo form lifecycle onAfterDelete' },\n onDeleteError: { value: 'onDeleteError', status: 'emitted-example', note: 'example Todo form lifecycle onDeleteError' },\n onFieldChange: { value: 'onFieldChange', status: 'emitted-example', note: 'example Todo form lifecycle onFieldChange' },\n transformFormData: { value: 'transformFormData', status: 'emitted-example', note: 'example Todo form lifecycle transformFormData' },\n onBeforeSave: { value: 'onBeforeSave', status: 'emitted-example', note: 'example Todo form lifecycle onBeforeSave' },\n onSave: { value: 'onSave', status: 'emitted-example', note: 'example Todo form lifecycle onSave' },\n onAfterSave: { value: 'onAfterSave', status: 'emitted-example', note: 'example Todo form lifecycle onAfterSave' },\n}\n\nconst CRUD_FORM_OPERATION_COVERAGE: Readonly<Record<string, ModuleFactCoverageRow>> = {\n create: { value: 'create', status: 'emitted-example', note: 'example Todo create lifecycle' },\n update: { value: 'update', status: 'currently-unbound', note: 'example lifecycle contribution is currently registered for create only' },\n delete: { value: 'delete', status: 'currently-unbound', note: 'example lifecycle contribution is currently registered for create only' },\n}\n\n/**\n * One family of the ledger. Both directions are enforced: an enumerated value with\n * no row, and a row classifying a value the enum no longer carries, each throw \u2014 so\n * neither an unclassified new value nor a stale row for a removed one can ship.\n */\nexport function buildCoverageFamily(\n family: string,\n enumSource: string,\n values: readonly string[],\n coverage: Readonly<Record<string, ModuleFactCoverageRow>>,\n): ModuleFactCoverageFamily {\n const rows: ModuleFactCoverageRow[] = []\n const missing: string[] = []\n for (const value of values) {\n const row = coverage[value]\n if (!row) {\n missing.push(value)\n continue\n }\n rows.push(row)\n }\n if (missing.length > 0) {\n throw new Error(\n `[module-facts] factCoverage family \"${family}\" has no row for: ${missing.join(', ')}. ` +\n 'Add an explicit classification instead of leaving the value unclassified.',\n )\n }\n const extra = Object.keys(coverage).filter((value) => !values.includes(value))\n if (extra.length > 0) {\n throw new Error(\n `[module-facts] factCoverage family \"${family}\" classifies values absent from the enum: ${extra.join(', ')}.`,\n )\n }\n return { family, enumSource, rows }\n}\n\n/**\n * Builds the whole ledger, throwing when an enumerated value lacks a row or a row\n * classifies a value the enum no longer carries. {@link extractAllModuleFacts} calls\n * it on every run, so either violation fails fact generation \u2014 not only the unit\n * test \u2014 and the built ledger is returned on the generation result so the published\n * mirrors have a single generated authority to be checked against.\n */\nexport function buildModuleFactCoverageLedger(): ModuleFactCoverageFamily[] {\n return [\n buildCoverageFamily(\n 'ModuleFactSourceKind',\n 'packages/cli/src/lib/generators/module-facts.ts#MODULE_FACT_SOURCE_KINDS',\n MODULE_FACT_SOURCE_KINDS,\n FACT_SOURCE_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOwnedContractKind',\n 'packages/cli/src/lib/generators/module-facts.ts#MODULE_OWNED_CONTRACT_KINDS',\n MODULE_OWNED_CONTRACT_KINDS,\n OWNED_CONTRACT_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideDomain',\n 'packages/cli/src/lib/generators/module-override-targets.ts#ALL_OVERRIDE_DOMAINS',\n ALL_OVERRIDE_DOMAINS,\n OVERRIDE_DOMAIN_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideMode',\n 'packages/cli/src/lib/generators/module-override-targets.ts#MODULE_OVERRIDE_MODES',\n MODULE_OVERRIDE_MODES,\n OVERRIDE_MODE_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideTargetNote',\n 'packages/cli/src/lib/generators/module-override-targets.ts#MODULE_OVERRIDE_TARGET_NOTES',\n MODULE_OVERRIDE_TARGET_NOTES,\n OVERRIDE_NOTE_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleOverrideTargetDiagnosticCode',\n 'packages/cli/src/lib/generators/module-override-targets.ts#MODULE_OVERRIDE_TARGET_DIAGNOSTIC_CODES',\n MODULE_OVERRIDE_TARGET_DIAGNOSTIC_CODES,\n OVERRIDE_DIAGNOSTIC_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionContributionKind',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_CONTRIBUTION_KINDS',\n MODULE_EXTENSION_CONTRIBUTION_KINDS,\n CONTRIBUTION_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionActivationKind',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_ACTIVATION_KINDS',\n MODULE_EXTENSION_ACTIVATION_KINDS,\n ACTIVATION_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ExtensionHostFamily',\n 'packages/shared/src/modules/widgets/extension-points.ts#EXTENSION_HOST_FAMILIES',\n EXTENSION_HOST_FAMILIES,\n HOST_FAMILY_COVERAGE,\n ),\n buildCoverageFamily(\n 'ExtensionHostCapability',\n 'packages/shared/src/modules/widgets/extension-points.ts#EXTENSION_HOST_CAPABILITIES',\n EXTENSION_HOST_CAPABILITIES,\n HOST_CAPABILITY_COVERAGE,\n ),\n buildCoverageFamily(\n 'ExtensionHostActivation',\n 'packages/shared/src/modules/widgets/extension-points.ts#EXTENSION_HOST_ACTIVATIONS',\n EXTENSION_HOST_ACTIVATIONS,\n HOST_ACTIVATION_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionTargetKind',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_TARGET_KINDS',\n MODULE_EXTENSION_TARGET_KINDS,\n TARGET_KIND_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionHostResolution',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_HOST_RESOLUTIONS',\n MODULE_EXTENSION_HOST_RESOLUTIONS,\n HOST_RESOLUTION_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionTargetResolution',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_TARGET_RESOLUTIONS',\n MODULE_EXTENSION_TARGET_RESOLUTIONS,\n TARGET_RESOLUTION_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionResolution',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_RESOLUTIONS',\n MODULE_EXTENSION_RESOLUTIONS,\n TOPOLOGY_RESOLUTION_COVERAGE,\n ),\n buildCoverageFamily(\n 'SpecializedRegistry',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_SPECIALIZED_REGISTRIES',\n MODULE_SPECIALIZED_REGISTRIES,\n SPECIALIZED_REGISTRY_COVERAGE,\n ),\n buildCoverageFamily(\n 'ComponentOverrideMode',\n 'packages/shared/src/modules/widgets/extension-points.ts#COMPONENT_OVERRIDE_MODES',\n COMPONENT_OVERRIDE_MODES,\n COMPONENT_MODE_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleFactDiagnosticCode',\n 'packages/cli/src/lib/generators/module-facts.ts#MODULE_FACT_DIAGNOSTIC_CODES',\n MODULE_FACT_DIAGNOSTIC_CODES,\n FACT_DIAGNOSTIC_COVERAGE,\n ),\n buildCoverageFamily(\n 'ModuleExtensionUnresolvedReason',\n 'packages/shared/src/modules/widgets/extension-points.ts#MODULE_EXTENSION_UNRESOLVED_REASONS',\n MODULE_EXTENSION_UNRESOLVED_REASONS,\n UNRESOLVED_REASON_COVERAGE,\n ),\n buildCoverageFamily(\n 'DataTableExtensionSurface',\n 'packages/shared/src/modules/widgets/extension-points.ts#DATA_TABLE_EXTENSION_SURFACE_KEYS',\n DATA_TABLE_EXTENSION_SURFACE_KEYS,\n DATA_TABLE_SURFACE_COVERAGE,\n ),\n buildCoverageFamily(\n 'CrudFormExtensionSurface',\n 'packages/shared/src/modules/widgets/extension-points.ts#CRUD_FORM_EXTENSION_SURFACE_KEYS',\n CRUD_FORM_EXTENSION_SURFACE_KEYS,\n CRUD_FORM_SURFACE_COVERAGE,\n ),\n buildCoverageFamily(\n 'CrudFormLifecyclePhase',\n 'packages/shared/src/modules/widgets/extension-points.ts#CRUD_FORM_LIFECYCLE_PHASES',\n CRUD_FORM_LIFECYCLE_PHASES,\n CRUD_FORM_LIFECYCLE_COVERAGE,\n ),\n buildCoverageFamily(\n 'CrudFormOperation',\n 'packages/shared/src/modules/widgets/extension-points.ts#CRUD_FORM_OPERATIONS',\n CRUD_FORM_OPERATIONS,\n CRUD_FORM_OPERATION_COVERAGE,\n ),\n ]\n}\n\n/**\n * Real per-value counts for every ledger family, read from an extracted module's\n * facts. This is the anti-silent-zero oracle: a ledger claim is checked against what\n * the extractor actually published, never against a hand-maintained inventory row.\n */\nexport function countModuleFactCoverage(facts: ModuleFacts): Record<string, Record<string, number>> {\n const increment = (counts: Record<string, number>, value: string): void => {\n counts[value] = (counts[value] ?? 0) + 1\n }\n const factSourceKind: Record<string, number> = {}\n for (const entry of facts.factSources ?? []) {\n increment(factSourceKind, entry.kind)\n }\n const ownedContractKind: Record<string, number> = {}\n for (const [kind, list] of Object.entries(facts.ownedContracts ?? {})) {\n ownedContractKind[kind] = (list ?? []).length\n }\n const overrideDomain: Record<string, number> = {}\n const overrideMode: Record<string, number> = {}\n const overrideNote: Record<string, number> = {}\n for (const target of facts.overrideTargets ?? []) {\n overrideDomain[target.domain] = (overrideDomain[target.domain] ?? 0) + 1\n for (const mode of target.modes) overrideMode[mode] = (overrideMode[mode] ?? 0) + 1\n for (const note of target.notes ?? []) overrideNote[note] = (overrideNote[note] ?? 0) + 1\n }\n const overrideDiagnosticCode: Record<string, number> = {}\n for (const diagnostic of facts.overrideTargetDiagnostics ?? []) {\n increment(overrideDiagnosticCode, diagnostic.code)\n }\n const contributionKind: Record<string, number> = {}\n const activationKind: Record<string, number> = {}\n const hostFamily: Record<string, number> = {}\n const hostCapability: Record<string, number> = {}\n const hostActivation: Record<string, number> = {}\n const targetKind: Record<string, number> = {}\n const hostResolution: Record<string, number> = {}\n const targetResolution: Record<string, number> = {}\n const topologyResolution: Record<string, number> = {}\n const specializedRegistry: Record<string, number> = {}\n const componentMode: Record<string, number> = {}\n const factDiagnosticCode: Record<string, number> = {}\n const unresolvedReason: Record<string, number> = {}\n const dataTableSurface: Record<string, number> = {}\n const crudFormSurface: Record<string, number> = {}\n const crudFormLifecycle: Record<string, number> = {}\n const crudFormOperation: Record<string, number> = {}\n const surfaces = facts.extensionSurfaces\n for (const host of surfaces?.hosts ?? []) {\n increment(hostFamily, host.family)\n increment(hostResolution, host.resolution)\n increment(hostActivation, host.activation ?? 'always')\n for (const capability of host.capabilities) increment(hostCapability, capability)\n for (const phase of host.phases ?? []) increment(crudFormLifecycle, phase)\n for (const operation of host.operations ?? []) increment(crudFormOperation, operation)\n const [owner, surface] = host.key.split('.')\n if (owner === 'todosTable' && surface) increment(dataTableSurface, surface)\n if (owner === 'todoForm' && surface) increment(crudFormSurface, surface)\n }\n for (const contribution of surfaces?.contributions ?? []) {\n increment(contributionKind, contribution.kind)\n increment(hostActivation, contribution.activation ?? 'always')\n for (const target of contribution.targets) increment(targetResolution, target.resolution)\n for (const operation of contribution.operations ?? []) increment(crudFormOperation, operation)\n if (contribution.kind === 'specialized-registry') increment(specializedRegistry, contribution.details.registry)\n if (contribution.kind === 'component-override') increment(componentMode, contribution.details.mode)\n if (contribution.kind === 'widget') {\n if (contribution.details.payload === 'headless') increment(hostCapability, 'headless-widget')\n if (contribution.details.payload === 'menu') increment(hostCapability, 'menu-item')\n if (contribution.details.payload === 'dashboard' || contribution.details.payload === 'notification' || contribution.details.payload === 'integration') {\n increment(hostCapability, 'registry-contribution')\n }\n }\n if (contribution.kind === 'api-interceptor') increment(hostCapability, 'api-interceptor')\n if (contribution.kind === 'command-interceptor') increment(hostCapability, 'command-interceptor')\n }\n for (const activation of surfaces?.activations ?? []) increment(activationKind, activation.kind)\n for (const resolution of surfaces?.contributionResolutions ?? []) {\n increment(targetKind, resolution.target.kind)\n increment(topologyResolution, resolution.resolution)\n for (const id of resolution.activationIds) {\n const kind = MODULE_EXTENSION_ACTIVATION_KINDS.find((candidate) => id.endsWith(`:${candidate}`))\n if (kind) increment(activationKind, kind)\n }\n }\n for (const diagnostic of facts.factDiagnostics ?? []) increment(factDiagnosticCode, diagnostic.code)\n for (const unresolved of surfaces?.unresolved ?? []) increment(unresolvedReason, unresolved.reason)\n return {\n ModuleFactSourceKind: factSourceKind,\n ModuleOwnedContractKind: ownedContractKind,\n ModuleOverrideDomain: overrideDomain,\n ModuleOverrideMode: overrideMode,\n ModuleOverrideTargetNote: overrideNote,\n ModuleOverrideTargetDiagnosticCode: overrideDiagnosticCode,\n ModuleExtensionContributionKind: contributionKind,\n ModuleExtensionActivationKind: activationKind,\n ExtensionHostFamily: hostFamily,\n ExtensionHostCapability: hostCapability,\n ExtensionHostActivation: hostActivation,\n ModuleExtensionTargetKind: targetKind,\n ModuleExtensionHostResolution: hostResolution,\n ModuleExtensionTargetResolution: targetResolution,\n ModuleExtensionResolution: topologyResolution,\n SpecializedRegistry: specializedRegistry,\n ComponentOverrideMode: componentMode,\n ModuleFactDiagnosticCode: factDiagnosticCode,\n ModuleExtensionUnresolvedReason: unresolvedReason,\n DataTableExtensionSurface: dataTableSurface,\n CrudFormExtensionSurface: crudFormSurface,\n CrudFormLifecyclePhase: crudFormLifecycle,\n CrudFormOperation: crudFormOperation,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP,SAAS,eAAe;AACxB,SAAS,mCAAmC;AAC5C,SAAS,8BAA8B;AAEvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,6BAAoD;AAC7D,SAAS,wCAAwC;AAgG1C,MAAM,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