@resolveio/server-lib 22.3.42 → 22.3.43
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/ai/assistant-core-heuristics.d.ts +11 -0
- package/ai/assistant-core-heuristics.js +356 -0
- package/ai/assistant-core-heuristics.js.map +1 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.d.ts +3 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.js +214 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.js.map +1 -0
- package/ai/resolveio-platform-intelligence-memory.d.ts +20 -0
- package/ai/resolveio-platform-intelligence-memory.js +341 -0
- package/ai/resolveio-platform-intelligence-memory.js.map +1 -0
- package/{src/ai/resolveio-platform-intelligence-types.ts → ai/resolveio-platform-intelligence-types.d.ts} +15 -20
- package/ai/resolveio-platform-intelligence-types.js +4 -0
- package/ai/resolveio-platform-intelligence-types.js.map +1 -0
- package/ai/resolveio-platform-intelligence.d.ts +6 -0
- package/ai/resolveio-platform-intelligence.js +463 -0
- package/ai/resolveio-platform-intelligence.js.map +1 -0
- package/client-server-app.d.ts +1 -0
- package/client-server-app.js +68 -0
- package/client-server-app.js.map +1 -0
- package/collections/ai-terminal-conversation.collection.d.ts +2 -0
- package/collections/ai-terminal-conversation.collection.js +140 -0
- package/collections/ai-terminal-conversation.collection.js.map +1 -0
- package/collections/ai-terminal-issue-report.collection.d.ts +2 -0
- package/collections/ai-terminal-issue-report.collection.js +148 -0
- package/collections/ai-terminal-issue-report.collection.js.map +1 -0
- package/collections/ai-terminal-message.collection.d.ts +2 -0
- package/collections/ai-terminal-message.collection.js +121 -0
- package/collections/ai-terminal-message.collection.js.map +1 -0
- package/collections/app-setting.collection.d.ts +3 -0
- package/collections/app-setting.collection.js +103 -0
- package/collections/app-setting.collection.js.map +1 -0
- package/collections/app-status.collection.d.ts +3 -0
- package/collections/app-status.collection.js +57 -0
- package/collections/app-status.collection.js.map +1 -0
- package/collections/communication-metric.collection.d.ts +2 -0
- package/collections/communication-metric.collection.js +133 -0
- package/collections/communication-metric.collection.js.map +1 -0
- package/collections/counter.collection.d.ts +3 -0
- package/collections/counter.collection.js +56 -0
- package/collections/counter.collection.js.map +1 -0
- package/collections/cron-job-history.collection.d.ts +3 -0
- package/collections/cron-job-history.collection.js +137 -0
- package/collections/cron-job-history.collection.js.map +1 -0
- package/collections/cron-job.collection.d.ts +3 -0
- package/collections/cron-job.collection.js +92 -0
- package/collections/cron-job.collection.js.map +1 -0
- package/collections/customer-notification.collection.d.ts +3 -0
- package/collections/customer-notification.collection.js +130 -0
- package/collections/customer-notification.collection.js.map +1 -0
- package/collections/customer-portal-password.collection.d.ts +3 -0
- package/collections/customer-portal-password.collection.js +75 -0
- package/collections/customer-portal-password.collection.js.map +1 -0
- package/collections/email-history.collection.d.ts +3 -0
- package/collections/email-history.collection.js +127 -0
- package/collections/email-history.collection.js.map +1 -0
- package/collections/email-verified.collection.d.ts +3 -0
- package/collections/email-verified.collection.js +62 -0
- package/collections/email-verified.collection.js.map +1 -0
- package/collections/file.collection.d.ts +3 -0
- package/collections/file.collection.js +74 -0
- package/collections/file.collection.js.map +1 -0
- package/collections/flag-update.collection.d.ts +3 -0
- package/collections/flag-update.collection.js +57 -0
- package/collections/flag-update.collection.js.map +1 -0
- package/collections/flag.collection.d.ts +3 -0
- package/collections/flag.collection.js +57 -0
- package/collections/flag.collection.js.map +1 -0
- package/collections/log-method-latency.collection.d.ts +3 -0
- package/collections/log-method-latency.collection.js +77 -0
- package/collections/log-method-latency.collection.js.map +1 -0
- package/collections/log-subscription.collection.d.ts +3 -0
- package/collections/log-subscription.collection.js +80 -0
- package/collections/log-subscription.collection.js.map +1 -0
- package/collections/log.collection.d.ts +3 -0
- package/collections/log.collection.js +93 -0
- package/collections/log.collection.js.map +1 -0
- package/collections/logged-in-users.collection.d.ts +3 -0
- package/collections/logged-in-users.collection.js +67 -0
- package/collections/logged-in-users.collection.js.map +1 -0
- package/collections/monitor-cpu.collection.d.ts +3 -0
- package/collections/monitor-cpu.collection.js +65 -0
- package/collections/monitor-cpu.collection.js.map +1 -0
- package/collections/monitor-function.collection.d.ts +3 -0
- package/collections/monitor-function.collection.js +74 -0
- package/collections/monitor-function.collection.js.map +1 -0
- package/collections/monitor-memory.collection.d.ts +3 -0
- package/collections/monitor-memory.collection.js +77 -0
- package/collections/monitor-memory.collection.js.map +1 -0
- package/collections/monitor-mongo.collection.d.ts +3 -0
- package/collections/monitor-mongo.collection.js +71 -0
- package/collections/monitor-mongo.collection.js.map +1 -0
- package/collections/notification.collection.d.ts +3 -0
- package/collections/notification.collection.js +57 -0
- package/collections/notification.collection.js.map +1 -0
- package/collections/openai-usage-ledger.collection.d.ts +2 -0
- package/collections/openai-usage-ledger.collection.js +124 -0
- package/collections/openai-usage-ledger.collection.js.map +1 -0
- package/collections/report-builder-dashboard-builder.collection.d.ts +3 -0
- package/collections/report-builder-dashboard-builder.collection.js +109 -0
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -0
- package/collections/report-builder-library.collection.d.ts +3 -0
- package/collections/report-builder-library.collection.js +87 -0
- package/collections/report-builder-library.collection.js.map +1 -0
- package/collections/report-builder-report.collection.d.ts +4 -0
- package/collections/report-builder-report.collection.js +184 -0
- package/collections/report-builder-report.collection.js.map +1 -0
- package/collections/user-group.collection.d.ts +4 -0
- package/collections/user-group.collection.js +89 -0
- package/collections/user-group.collection.js.map +1 -0
- package/collections/user-guide.collection.d.ts +3 -0
- package/collections/user-guide.collection.js +57 -0
- package/collections/user-guide.collection.js.map +1 -0
- package/collections/user.collection.d.ts +4 -0
- package/collections/user.collection.js +180 -0
- package/collections/user.collection.js.map +1 -0
- package/cron/cron.d.ts +14 -0
- package/cron/cron.js +216 -0
- package/cron/cron.js.map +1 -0
- package/fixtures/cron-jobs.d.ts +1 -0
- package/fixtures/cron-jobs.js +150 -0
- package/fixtures/cron-jobs.js.map +1 -0
- package/fixtures/init.d.ts +1 -0
- package/fixtures/init.js +91 -0
- package/fixtures/init.js.map +1 -0
- package/http/auth.d.ts +2 -0
- package/http/auth.js +906 -0
- package/http/auth.js.map +1 -0
- package/http/health.d.ts +1 -0
- package/http/health.js +11 -0
- package/http/health.js.map +1 -0
- package/http/home.d.ts +1 -0
- package/http/home.js +134 -0
- package/http/home.js.map +1 -0
- package/http/slow-query-publication.d.ts +2 -0
- package/http/slow-query-publication.js +99 -0
- package/http/slow-query-publication.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/index.js.map +1 -0
- package/managers/ai-assistant-codex-manager.manager.d.ts +67 -0
- package/managers/ai-assistant-codex-manager.manager.js +1113 -0
- package/managers/ai-assistant-codex-manager.manager.js.map +1 -0
- package/managers/communication-metric.manager.d.ts +16 -0
- package/managers/communication-metric.manager.js +134 -0
- package/managers/communication-metric.manager.js.map +1 -0
- package/managers/cron.manager.d.ts +20 -0
- package/managers/cron.manager.js +534 -0
- package/managers/cron.manager.js.map +1 -0
- package/managers/customer-notification-content.manager.d.ts +55 -0
- package/managers/customer-notification-content.manager.js +158 -0
- package/managers/customer-notification-content.manager.js.map +1 -0
- package/managers/diagnostic-manager-bootstrap.d.ts +9 -0
- package/managers/diagnostic-manager-bootstrap.js +260 -0
- package/managers/diagnostic-manager-bootstrap.js.map +1 -0
- package/managers/error-auto-fix.manager.d.ts +149 -0
- package/managers/error-auto-fix.manager.js +3064 -0
- package/managers/error-auto-fix.manager.js.map +1 -0
- package/managers/local-log.manager.d.ts +18 -0
- package/managers/local-log.manager.js +88 -0
- package/managers/local-log.manager.js.map +1 -0
- package/managers/method.manager.d.ts +83 -0
- package/managers/method.manager.js +1941 -0
- package/managers/method.manager.js.map +1 -0
- package/managers/mongo.manager.d.ts +224 -0
- package/managers/mongo.manager.js +5000 -0
- package/managers/mongo.manager.js.map +1 -0
- package/managers/monitor.manager.d.ts +70 -0
- package/managers/monitor.manager.js +550 -0
- package/managers/monitor.manager.js.map +1 -0
- package/managers/openai-usage-ledger.manager.d.ts +15 -0
- package/managers/openai-usage-ledger.manager.js +144 -0
- package/managers/openai-usage-ledger.manager.js.map +1 -0
- package/managers/slow-query-verifier.manager.d.ts +144 -0
- package/managers/slow-query-verifier.manager.js +3857 -0
- package/managers/slow-query-verifier.manager.js.map +1 -0
- package/managers/slow-query.manager.d.ts +28 -0
- package/managers/slow-query.manager.js +468 -0
- package/managers/slow-query.manager.js.map +1 -0
- package/managers/subscription.manager.d.ts +169 -0
- package/managers/subscription.manager.js +3434 -0
- package/managers/subscription.manager.js.map +1 -0
- package/managers/websocket.manager.d.ts +73 -0
- package/managers/websocket.manager.js +673 -0
- package/managers/websocket.manager.js.map +1 -0
- package/managers/worker-dispatcher.manager.d.ts +120 -0
- package/managers/worker-dispatcher.manager.js +1266 -0
- package/managers/worker-dispatcher.manager.js.map +1 -0
- package/managers/worker-server.manager.d.ts +35 -0
- package/managers/worker-server.manager.js +582 -0
- package/managers/worker-server.manager.js.map +1 -0
- package/methods/accounts.d.ts +2 -0
- package/methods/accounts.js +624 -0
- package/methods/accounts.js.map +1 -0
- package/methods/ai-terminal.d.ts +336 -0
- package/methods/ai-terminal.js +22782 -0
- package/methods/ai-terminal.js.map +1 -0
- package/methods/app-settings.d.ts +2 -0
- package/methods/app-settings.js +169 -0
- package/methods/app-settings.js.map +1 -0
- package/methods/aws.d.ts +2 -0
- package/methods/aws.js +877 -0
- package/methods/aws.js.map +1 -0
- package/methods/collections.d.ts +2 -0
- package/methods/collections.js +719 -0
- package/methods/collections.js.map +1 -0
- package/methods/counters.d.ts +2 -0
- package/methods/counters.js +113 -0
- package/methods/counters.js.map +1 -0
- package/methods/cron-jobs.d.ts +2 -0
- package/methods/cron-jobs.js +2475 -0
- package/methods/cron-jobs.js.map +1 -0
- package/methods/customer-notifications.d.ts +2 -0
- package/methods/customer-notifications.js +528 -0
- package/methods/customer-notifications.js.map +1 -0
- package/methods/diagnostics.d.ts +2 -0
- package/methods/diagnostics.js +703 -0
- package/methods/diagnostics.js.map +1 -0
- package/methods/flag-updates.d.ts +2 -0
- package/methods/flag-updates.js +8 -0
- package/methods/flag-updates.js.map +1 -0
- package/methods/flags.d.ts +2 -0
- package/methods/flags.js +8 -0
- package/methods/flags.js.map +1 -0
- package/methods/logs.d.ts +2 -0
- package/methods/logs.js +751 -0
- package/methods/logs.js.map +1 -0
- package/methods/mongo-explorer.d.ts +2 -0
- package/methods/mongo-explorer.js +1808 -0
- package/methods/mongo-explorer.js.map +1 -0
- package/methods/monitor.d.ts +2 -0
- package/methods/monitor.js +543 -0
- package/methods/monitor.js.map +1 -0
- package/methods/pdf.d.ts +2 -0
- package/methods/pdf.js +1216 -0
- package/methods/pdf.js.map +1 -0
- package/methods/publications.d.ts +1 -0
- package/methods/publications.js +183 -0
- package/methods/publications.js.map +1 -0
- package/methods/report-builder.d.ts +2 -0
- package/methods/report-builder.js +3094 -0
- package/methods/report-builder.js.map +1 -0
- package/methods/support.d.ts +2 -0
- package/methods/support.js +430 -0
- package/methods/support.js.map +1 -0
- package/models/ai-terminal-conversation.model.d.ts +17 -0
- package/models/ai-terminal-conversation.model.js +4 -0
- package/models/ai-terminal-conversation.model.js.map +1 -0
- package/models/ai-terminal-issue-report.model.d.ts +19 -0
- package/models/ai-terminal-issue-report.model.js +4 -0
- package/models/ai-terminal-issue-report.model.js.map +1 -0
- package/models/ai-terminal-message.model.d.ts +22 -0
- package/models/ai-terminal-message.model.js +4 -0
- package/models/ai-terminal-message.model.js.map +1 -0
- package/models/app-setting.model.d.ts +16 -0
- package/models/app-setting.model.js +4 -0
- package/models/app-setting.model.js.map +1 -0
- package/{src/models/app-status.model.ts → models/app-status.model.d.ts} +2 -3
- package/models/app-status.model.js +4 -0
- package/models/app-status.model.js.map +1 -0
- package/{src/models/billing-logged-in-users.model.ts → models/billing-logged-in-users.model.d.ts} +4 -5
- package/models/billing-logged-in-users.model.js +4 -0
- package/models/billing-logged-in-users.model.js.map +1 -0
- package/models/collection-document.model.d.ts +21 -0
- package/models/collection-document.model.js +4 -0
- package/models/collection-document.model.js.map +1 -0
- package/models/communication-metric.model.d.ts +20 -0
- package/models/communication-metric.model.js +4 -0
- package/models/communication-metric.model.js.map +1 -0
- package/{src/models/counter.model.ts → models/counter.model.d.ts} +3 -4
- package/models/counter.model.js +4 -0
- package/models/counter.model.js.map +1 -0
- package/models/cron-job-history.model.d.ts +15 -0
- package/models/cron-job-history.model.js +4 -0
- package/models/cron-job-history.model.js.map +1 -0
- package/models/cron-job.model.d.ts +14 -0
- package/models/cron-job.model.js +4 -0
- package/models/cron-job.model.js.map +1 -0
- package/models/customer-notification.model.d.ts +26 -0
- package/models/customer-notification.model.js +4 -0
- package/models/customer-notification.model.js.map +1 -0
- package/models/customer-portal-password.model.d.ts +11 -0
- package/models/customer-portal-password.model.js +4 -0
- package/models/customer-portal-password.model.js.map +1 -0
- package/models/dialog.model.d.ts +23 -0
- package/models/dialog.model.js +4 -0
- package/models/dialog.model.js.map +1 -0
- package/models/email-history.model.d.ts +31 -0
- package/{src/models/email-history.model.ts → models/email-history.model.js} +4 -35
- package/models/email-history.model.js.map +1 -0
- package/{src/models/email-verified.model.ts → models/email-verified.model.d.ts} +5 -6
- package/models/email-verified.model.js +4 -0
- package/models/email-verified.model.js.map +1 -0
- package/{src/models/file.model.ts → models/file.model.d.ts} +7 -8
- package/models/file.model.js +4 -0
- package/models/file.model.js.map +1 -0
- package/{src/models/flag-update.model.ts → models/flag-update.model.d.ts} +3 -4
- package/models/flag-update.model.js +4 -0
- package/models/flag-update.model.js.map +1 -0
- package/{src/models/flag.model.ts → models/flag.model.d.ts} +3 -4
- package/models/flag.model.js +4 -0
- package/models/flag.model.js.map +1 -0
- package/models/log-method-latency.model.d.ts +10 -0
- package/models/log-method-latency.model.js +4 -0
- package/models/log-method-latency.model.js.map +1 -0
- package/{src/models/log-subscription.model.ts → models/log-subscription.model.d.ts} +9 -11
- package/models/log-subscription.model.js +4 -0
- package/models/log-subscription.model.js.map +1 -0
- package/models/log.model.d.ts +17 -0
- package/models/log.model.js +4 -0
- package/models/log.model.js.map +1 -0
- package/{src/models/logged-in-users.model.ts → models/logged-in-users.model.d.ts} +5 -6
- package/models/logged-in-users.model.js +4 -0
- package/models/logged-in-users.model.js.map +1 -0
- package/{src/models/method-response.model.ts → models/method-response.model.d.ts} +6 -7
- package/models/method-response.model.js +4 -0
- package/models/method-response.model.js.map +1 -0
- package/models/method.model.d.ts +26 -0
- package/models/method.model.js +4 -0
- package/models/method.model.js.map +1 -0
- package/{src/models/monitor-cpu.model.ts → models/monitor-cpu.model.d.ts} +7 -9
- package/models/monitor-cpu.model.js +4 -0
- package/models/monitor-cpu.model.js.map +1 -0
- package/models/monitor-function.model.d.ts +14 -0
- package/models/monitor-function.model.js +4 -0
- package/models/monitor-function.model.js.map +1 -0
- package/models/monitor-memory.model.d.ts +15 -0
- package/models/monitor-memory.model.js +4 -0
- package/models/monitor-memory.model.js.map +1 -0
- package/models/monitor-mongo.model.d.ts +13 -0
- package/models/monitor-mongo.model.js +4 -0
- package/models/monitor-mongo.model.js.map +1 -0
- package/{src/models/notification.model.ts → models/notification.model.d.ts} +4 -6
- package/models/notification.model.js +4 -0
- package/models/notification.model.js.map +1 -0
- package/models/openai-usage-ledger.model.d.ts +15 -0
- package/models/openai-usage-ledger.model.js +4 -0
- package/models/openai-usage-ledger.model.js.map +1 -0
- package/models/pagination.model.d.ts +11 -0
- package/models/pagination.model.js +28 -0
- package/models/pagination.model.js.map +1 -0
- package/models/permission.model.d.ts +12 -0
- package/models/permission.model.js +4 -0
- package/models/permission.model.js.map +1 -0
- package/models/report-builder-dashboard-builder.model.d.ts +25 -0
- package/models/report-builder-dashboard-builder.model.js +4 -0
- package/models/report-builder-dashboard-builder.model.js.map +1 -0
- package/models/report-builder-library.model.d.ts +17 -0
- package/models/report-builder-library.model.js +4 -0
- package/models/report-builder-library.model.js.map +1 -0
- package/models/report-builder-report.model.d.ts +121 -0
- package/models/report-builder-report.model.js +4 -0
- package/models/report-builder-report.model.js.map +1 -0
- package/models/report-builder.model.d.ts +61 -0
- package/models/report-builder.model.js +4 -0
- package/models/report-builder.model.js.map +1 -0
- package/models/select-data-label.model.d.ts +9 -0
- package/models/select-data-label.model.js +4 -0
- package/models/select-data-label.model.js.map +1 -0
- package/models/server-message.model.d.ts +32 -0
- package/models/server-message.model.js +4 -0
- package/models/server-message.model.js.map +1 -0
- package/models/slow-query-report.model.d.ts +23 -0
- package/models/slow-query-report.model.js +4 -0
- package/models/slow-query-report.model.js.map +1 -0
- package/models/subscription.model.d.ts +31 -0
- package/models/subscription.model.js +4 -0
- package/models/subscription.model.js.map +1 -0
- package/models/support-ticket.model.d.ts +87 -0
- package/models/support-ticket.model.js +4 -0
- package/models/support-ticket.model.js.map +1 -0
- package/models/user-group.model.d.ts +20 -0
- package/models/user-group.model.js +4 -0
- package/models/user-group.model.js.map +1 -0
- package/{src/models/user-guide.model.ts → models/user-guide.model.d.ts} +4 -5
- package/models/user-guide.model.js +4 -0
- package/models/user-guide.model.js.map +1 -0
- package/models/user.model.d.ts +84 -0
- package/models/user.model.js +4 -0
- package/models/user.model.js.map +1 -0
- package/package.json +1 -1
- package/private/images/ResolveIO.png +0 -0
- package/public_api.js +115 -0
- package/public_api.js.map +1 -0
- package/publications/ai-terminal.d.ts +1 -0
- package/publications/ai-terminal.js +122 -0
- package/publications/ai-terminal.js.map +1 -0
- package/publications/app-settings.d.ts +2 -0
- package/publications/app-settings.js +28 -0
- package/publications/app-settings.js.map +1 -0
- package/publications/app-status.d.ts +2 -0
- package/publications/app-status.js +16 -0
- package/publications/app-status.js.map +1 -0
- package/publications/cron-jobs.d.ts +2 -0
- package/publications/cron-jobs.js +88 -0
- package/publications/cron-jobs.js.map +1 -0
- package/publications/customer-notifications.d.ts +2 -0
- package/publications/customer-notifications.js +161 -0
- package/publications/customer-notifications.js.map +1 -0
- package/publications/files.d.ts +2 -0
- package/publications/files.js +36 -0
- package/publications/files.js.map +1 -0
- package/publications/flags-update.d.ts +2 -0
- package/publications/flags-update.js +22 -0
- package/publications/flags-update.js.map +1 -0
- package/publications/flags.d.ts +2 -0
- package/publications/flags.js +22 -0
- package/publications/flags.js.map +1 -0
- package/publications/logs.d.ts +2 -0
- package/publications/logs.js +164 -0
- package/publications/logs.js.map +1 -0
- package/publications/notifications.d.ts +2 -0
- package/publications/notifications.js +16 -0
- package/publications/notifications.js.map +1 -0
- package/publications/report-builder-dashboard-builders.d.ts +2 -0
- package/publications/report-builder-dashboard-builders.js +42 -0
- package/publications/report-builder-dashboard-builders.js.map +1 -0
- package/publications/report-builder-libraries.d.ts +2 -0
- package/publications/report-builder-libraries.js +90 -0
- package/publications/report-builder-libraries.js.map +1 -0
- package/publications/report-builder-reports.d.ts +2 -0
- package/publications/report-builder-reports.js +50 -0
- package/publications/report-builder-reports.js.map +1 -0
- package/publications/super-admin.d.ts +2 -0
- package/publications/super-admin.js +16 -0
- package/publications/super-admin.js.map +1 -0
- package/publications/user-groups.d.ts +1 -0
- package/publications/user-groups.js +16 -0
- package/publications/user-groups.js.map +1 -0
- package/publications/user-guides.d.ts +1 -0
- package/publications/user-guides.js +16 -0
- package/publications/user-guides.js.map +1 -0
- package/resolveio-server-app.d.ts +70 -0
- package/resolveio-server-app.js +801 -0
- package/resolveio-server-app.js.map +1 -0
- package/server-app.d.ts +228 -0
- package/server-app.js +3566 -0
- package/server-app.js.map +1 -0
- package/services/codex-client.d.ts +126 -0
- package/services/codex-client.js +1622 -0
- package/services/codex-client.js.map +1 -0
- package/services/openai-client.d.ts +46 -0
- package/services/openai-client.js +318 -0
- package/services/openai-client.js.map +1 -0
- package/types/error-report.d.ts +25 -0
- package/types/error-report.js +4 -0
- package/types/error-report.js.map +1 -0
- package/types/slow-query-report.d.ts +27 -0
- package/types/slow-query-report.js +6 -0
- package/types/slow-query-report.js.map +1 -0
- package/util/ai-qa-policy.d.ts +119 -0
- package/util/ai-qa-policy.js +650 -0
- package/util/ai-qa-policy.js.map +1 -0
- package/util/ai-runner-artifacts.d.ts +74 -0
- package/util/ai-runner-artifacts.js +531 -0
- package/util/ai-runner-artifacts.js.map +1 -0
- package/util/ai-runner-qa-auth.d.ts +5 -0
- package/util/ai-runner-qa-auth.js +338 -0
- package/util/ai-runner-qa-auth.js.map +1 -0
- package/util/ai-runner-qa-tools.d.ts +16 -0
- package/util/ai-runner-qa-tools.js +602 -0
- package/util/ai-runner-qa-tools.js.map +1 -0
- package/util/common.d.ts +31 -0
- package/util/common.js +683 -0
- package/util/common.js.map +1 -0
- package/util/customer-portal-password.d.ts +13 -0
- package/util/customer-portal-password.js +209 -0
- package/util/customer-portal-password.js.map +1 -0
- package/util/error-reporter.d.ts +52 -0
- package/util/error-reporter.js +326 -0
- package/util/error-reporter.js.map +1 -0
- package/util/error-tracking.d.ts +13 -0
- package/util/error-tracking.js +120 -0
- package/util/error-tracking.js.map +1 -0
- package/util/report-builder-unwinds.d.ts +15 -0
- package/util/report-builder-unwinds.js +156 -0
- package/util/report-builder-unwinds.js.map +1 -0
- package/util/schema-report-builder.d.ts +6 -0
- package/util/schema-report-builder.js +481 -0
- package/util/schema-report-builder.js.map +1 -0
- package/util/slow-query-reporter.d.ts +28 -0
- package/util/slow-query-reporter.js +226 -0
- package/util/slow-query-reporter.js.map +1 -0
- package/util/subscription-dependency-context.d.ts +34 -0
- package/util/subscription-dependency-context.js +1283 -0
- package/util/subscription-dependency-context.js.map +1 -0
- package/util/tokenizer.d.ts +5 -0
- package/util/tokenizer.js +41 -0
- package/util/tokenizer.js.map +1 -0
- package/workers/codex-runner.worker.d.ts +1 -0
- package/workers/codex-runner.worker.js +192 -0
- package/workers/codex-runner.worker.js.map +1 -0
- package/.nodemon.json +0 -5
- package/.vscode/settings.json +0 -21
- package/AGENTS.md +0 -189
- package/README.md +0 -22
- package/build_package.sh +0 -5
- package/compileDTS.pl +0 -64
- package/docs/ai-assistant-nightly-eval.md +0 -65
- package/docs/ai-assistant-preflight-checklist.md +0 -23
- package/docs/ai-assistant-report-builder-bridge-playbook.md +0 -115
- package/eslint-plugin-custom/index.js +0 -7
- package/eslint-plugin-custom/rules/no-filter-zero-index.js +0 -44
- package/eslint.config.js +0 -103
- package/gulpfile.js +0 -216
- package/methodAndPublicationListGenerator.py +0 -375
- package/mongodbensurers.js +0 -2
- package/mongostop.js +0 -3
- package/scripts/cleanup-bypassed-callmethod-logs.js +0 -616
- package/settings.development.json +0 -25
- package/settings.development.redacted.json +0 -25
- package/src/.env +0 -12
- package/src/ai/assistant-core-heuristics.ts +0 -379
- package/src/ai/resolveio-platform-intelligence-memory-corpus.ts +0 -185
- package/src/ai/resolveio-platform-intelligence-memory.ts +0 -325
- package/src/ai/resolveio-platform-intelligence.ts +0 -462
- package/src/client-server-app.ts +0 -12
- package/src/collections/ai-terminal-conversation.collection.ts +0 -91
- package/src/collections/ai-terminal-issue-report.collection.ts +0 -99
- package/src/collections/ai-terminal-message.collection.ts +0 -77
- package/src/collections/app-setting.collection.ts +0 -104
- package/src/collections/app-status.collection.ts +0 -58
- package/src/collections/communication-metric.collection.ts +0 -84
- package/src/collections/counter.collection.ts +0 -56
- package/src/collections/cron-job-history.collection.ts +0 -94
- package/src/collections/cron-job.collection.ts +0 -92
- package/src/collections/customer-notification.collection.ts +0 -131
- package/src/collections/customer-portal-password.collection.ts +0 -76
- package/src/collections/email-history.collection.ts +0 -127
- package/src/collections/email-verified.collection.ts +0 -62
- package/src/collections/file.collection.ts +0 -74
- package/src/collections/flag-update.collection.ts +0 -57
- package/src/collections/flag.collection.ts +0 -57
- package/src/collections/log-method-latency.collection.ts +0 -77
- package/src/collections/log-subscription.collection.ts +0 -80
- package/src/collections/log.collection.ts +0 -93
- package/src/collections/logged-in-users.collection.ts +0 -67
- package/src/collections/monitor-cpu.collection.ts +0 -65
- package/src/collections/monitor-function.collection.ts +0 -74
- package/src/collections/monitor-memory.collection.ts +0 -77
- package/src/collections/monitor-mongo.collection.ts +0 -71
- package/src/collections/notification.collection.ts +0 -57
- package/src/collections/openai-usage-ledger.collection.ts +0 -77
- package/src/collections/report-builder-dashboard-builder.collection.ts +0 -109
- package/src/collections/report-builder-library.collection.ts +0 -89
- package/src/collections/report-builder-report.collection.ts +0 -184
- package/src/collections/user-group.collection.ts +0 -89
- package/src/collections/user-guide.collection.ts +0 -57
- package/src/collections/user.collection.ts +0 -181
- package/src/cron/cron.ts +0 -117
- package/src/fixtures/cron-jobs.ts +0 -95
- package/src/fixtures/init.ts +0 -35
- package/src/http/auth.ts +0 -764
- package/src/http/health.ts +0 -7
- package/src/http/home.ts +0 -90
- package/src/http/slow-query-publication.ts +0 -49
- package/src/index.ts +0 -1
- package/src/managers/ai-assistant-codex-manager.manager.ts +0 -1131
- package/src/managers/communication-metric.manager.ts +0 -82
- package/src/managers/cron.manager.ts +0 -333
- package/src/managers/customer-notification-content.manager.ts +0 -236
- package/src/managers/diagnostic-manager-bootstrap.ts +0 -165
- package/src/managers/error-auto-fix.manager.ts +0 -2767
- package/src/managers/local-log.manager.ts +0 -113
- package/src/managers/method.manager.ts +0 -1827
- package/src/managers/mongo.manager.ts +0 -4575
- package/src/managers/monitor.manager.ts +0 -507
- package/src/managers/openai-usage-ledger.manager.ts +0 -116
- package/src/managers/slow-query-verifier.manager.ts +0 -3590
- package/src/managers/slow-query.manager.ts +0 -519
- package/src/managers/subscription.manager.ts +0 -3128
- package/src/managers/websocket.manager.ts +0 -746
- package/src/managers/worker-dispatcher.manager.ts +0 -1360
- package/src/managers/worker-server.manager.ts +0 -536
- package/src/methods/accounts.ts +0 -532
- package/src/methods/ai-terminal.ts +0 -23043
- package/src/methods/app-settings.ts +0 -114
- package/src/methods/aws.ts +0 -649
- package/src/methods/collections.ts +0 -641
- package/src/methods/counters.ts +0 -69
- package/src/methods/cron-jobs.ts +0 -2614
- package/src/methods/customer-notifications.ts +0 -458
- package/src/methods/diagnostics.ts +0 -616
- package/src/methods/flag-updates.ts +0 -7
- package/src/methods/flags.ts +0 -7
- package/src/methods/logs.ts +0 -657
- package/src/methods/mongo-explorer.ts +0 -1880
- package/src/methods/monitor.ts +0 -540
- package/src/methods/pdf.ts +0 -1236
- package/src/methods/publications.ts +0 -129
- package/src/methods/report-builder.ts +0 -3300
- package/src/methods/support.ts +0 -335
- package/src/models/ai-terminal-conversation.model.ts +0 -19
- package/src/models/ai-terminal-issue-report.model.ts +0 -21
- package/src/models/ai-terminal-message.model.ts +0 -24
- package/src/models/app-setting.model.ts +0 -17
- package/src/models/collection-document.model.ts +0 -24
- package/src/models/communication-metric.model.ts +0 -23
- package/src/models/cron-job-history.model.ts +0 -16
- package/src/models/cron-job.model.ts +0 -15
- package/src/models/customer-notification.model.ts +0 -28
- package/src/models/customer-portal-password.model.ts +0 -12
- package/src/models/dialog.model.ts +0 -25
- package/src/models/log-method-latency.model.ts +0 -11
- package/src/models/log.model.ts +0 -19
- package/src/models/method.model.ts +0 -25
- package/src/models/monitor-function.model.ts +0 -16
- package/src/models/monitor-memory.model.ts +0 -17
- package/src/models/monitor-mongo.model.ts +0 -15
- package/src/models/openai-usage-ledger.model.ts +0 -16
- package/src/models/pagination.model.ts +0 -35
- package/src/models/permission.model.ts +0 -14
- package/src/models/report-builder-dashboard-builder.model.ts +0 -29
- package/src/models/report-builder-library.model.ts +0 -20
- package/src/models/report-builder-report.model.ts +0 -136
- package/src/models/report-builder.model.ts +0 -68
- package/src/models/select-data-label.model.ts +0 -9
- package/src/models/server-message.model.ts +0 -31
- package/src/models/slow-query-report.model.ts +0 -23
- package/src/models/subscription.model.ts +0 -73
- package/src/models/support-ticket.model.ts +0 -104
- package/src/models/user-group.model.ts +0 -24
- package/src/models/user.model.ts +0 -96
- package/src/private/images/ResolveIO.png +0 -0
- package/src/publications/ai-terminal.ts +0 -73
- package/src/publications/app-settings.ts +0 -25
- package/src/publications/app-status.ts +0 -13
- package/src/publications/cron-jobs.ts +0 -40
- package/src/publications/customer-notifications.ts +0 -101
- package/src/publications/files.ts +0 -33
- package/src/publications/flags-update.ts +0 -19
- package/src/publications/flags.ts +0 -19
- package/src/publications/logs.ts +0 -163
- package/src/publications/notifications.ts +0 -13
- package/src/publications/report-builder-dashboard-builders.ts +0 -39
- package/src/publications/report-builder-libraries.ts +0 -41
- package/src/publications/report-builder-reports.ts +0 -47
- package/src/publications/super-admin.ts +0 -13
- package/src/publications/user-groups.ts +0 -12
- package/src/publications/user-guides.ts +0 -12
- package/src/resolveio-server-app.ts +0 -617
- package/src/server-app.ts +0 -3354
- package/src/services/codex-client.ts +0 -1223
- package/src/services/openai-client.ts +0 -265
- package/src/types/error-report.ts +0 -26
- package/src/types/js-tiktoken.d.ts +0 -11
- package/src/types/slow-query-report.ts +0 -28
- package/src/util/ai-qa-policy.ts +0 -812
- package/src/util/ai-runner-artifacts.ts +0 -430
- package/src/util/ai-runner-qa-auth.ts +0 -337
- package/src/util/ai-runner-qa-tools.ts +0 -610
- package/src/util/common.ts +0 -649
- package/src/util/customer-portal-password.ts +0 -183
- package/src/util/error-reporter.ts +0 -332
- package/src/util/error-tracking.ts +0 -79
- package/src/util/report-builder-unwinds.ts +0 -180
- package/src/util/schema-report-builder.ts +0 -448
- package/src/util/slow-query-reporter.ts +0 -216
- package/src/util/subscription-dependency-context.ts +0 -1096
- package/src/util/tokenizer.ts +0 -38
- package/src/workers/codex-runner.worker.ts +0 -142
- package/start_server.sh +0 -5
- package/tests/ai-assistant-corpus-build.ts +0 -484
- package/tests/ai-assistant-corpus-replay-e2e.ts +0 -774
- package/tests/ai-assistant-data-parity-e2e.ts +0 -1989
- package/tests/ai-assistant-eval-triage.ts +0 -831
- package/tests/ai-assistant-openai-e2e.ts +0 -1061
- package/tests/ai-assistant-openai-git-e2e.ts +0 -155
- package/tests/ai-assistant-preflight-matrix.ts +0 -215
- package/tests/ai-assistant-routing-eval.test.ts +0 -560
- package/tests/ai-assistant-snf-live-eval.ts +0 -975
- package/tests/ai-assistant-utils.test.ts +0 -2860
- package/tests/ai-runner-contract.test.ts +0 -215
- package/tests/error-reporter.test.ts +0 -145
- package/tests/method-publication-generator.test.ts +0 -46
- package/tests/report-builder-linking.test.ts +0 -79
- package/tests/resolveio-platform-intelligence.test.ts +0 -352
- package/tests/server-app-cron-owner.test.ts +0 -127
- package/tests/subscription-connect-race.test.ts +0 -158
- package/tests/subscription-dependency-context.test.ts +0 -324
- package/tests/subscription-manager-collection-tracking.test.ts +0 -86
- package/tests/subscription-manager-invalidation.test.ts +0 -86
- package/tsconfig.json +0 -34
- /package/{src/private → private}/email-templates/enrollment.html +0 -0
- /package/{src/private → private}/email-templates/forgot-password.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-modified.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket.html +0 -0
- /package/{src/public_api.ts → public_api.d.ts} +0 -0
package/src/util/ai-qa-policy.ts
DELETED
|
@@ -1,812 +0,0 @@
|
|
|
1
|
-
export type ResolveIOQaPolicyContext =
|
|
2
|
-
| 'support_ticket'
|
|
3
|
-
| 'aicoder_dashboard'
|
|
4
|
-
| 'ai_terminal'
|
|
5
|
-
| 'general';
|
|
6
|
-
|
|
7
|
-
export interface ResolveIOQaPolicyOptions {
|
|
8
|
-
context?: ResolveIOQaPolicyContext;
|
|
9
|
-
includeDevServerRules?: boolean;
|
|
10
|
-
qaRepairEnabled?: boolean;
|
|
11
|
-
qaEvidenceRequired?: boolean;
|
|
12
|
-
qaDistinctScreenshotRequired?: boolean;
|
|
13
|
-
qaFailFastCompile?: boolean;
|
|
14
|
-
qaLiveDataRequired?: boolean;
|
|
15
|
-
qaSelfRepairMaxWaves?: number;
|
|
16
|
-
currentRoute?: string;
|
|
17
|
-
currentContextMode?: string;
|
|
18
|
-
customInstructions?: string[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ResolveIORunnerBasicsOptions extends ResolveIOQaPolicyOptions {
|
|
22
|
-
includeQaPolicy?: boolean;
|
|
23
|
-
includeTokenDiscipline?: boolean;
|
|
24
|
-
includeDependencyBootstrap?: boolean;
|
|
25
|
-
includeRepairLoop?: boolean;
|
|
26
|
-
includeEvidenceContract?: boolean;
|
|
27
|
-
maxContextBullets?: number;
|
|
28
|
-
maxRepairWaves?: number;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ResolveIORunnerPromptInput extends ResolveIORunnerBasicsOptions {
|
|
32
|
-
objective?: string;
|
|
33
|
-
blockers?: string[];
|
|
34
|
-
relevantFiles?: string[];
|
|
35
|
-
evidence?: string[];
|
|
36
|
-
priorSummary?: string;
|
|
37
|
-
latestFailure?: string;
|
|
38
|
-
maxBlockers?: number;
|
|
39
|
-
maxFiles?: number;
|
|
40
|
-
maxEvidence?: number;
|
|
41
|
-
maxTextChars?: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface ResolveIORunnerContract {
|
|
45
|
-
context: ResolveIOQaPolicyContext;
|
|
46
|
-
sections: {
|
|
47
|
-
runnerBasics: string[];
|
|
48
|
-
tokenDiscipline: string[];
|
|
49
|
-
dependencyBootstrap: string[];
|
|
50
|
-
repairLoop: string[];
|
|
51
|
-
qaPolicy: string[];
|
|
52
|
-
evidenceContract: string[];
|
|
53
|
-
finalNotes: string[];
|
|
54
|
-
};
|
|
55
|
-
rules: string[];
|
|
56
|
-
promptLines: string[];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface ResolveIORunnerPromptBundle extends ResolveIORunnerContract {
|
|
60
|
-
objective: string;
|
|
61
|
-
contextLines: string[];
|
|
62
|
-
repairLines: string[];
|
|
63
|
-
fullPromptLines: string[];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ResolveIORunnerRepairPlan {
|
|
67
|
-
blockerClass: string;
|
|
68
|
-
sourceGate: string;
|
|
69
|
-
targetFiles: string[];
|
|
70
|
-
lineHints: string[];
|
|
71
|
-
failureEvidence: string[];
|
|
72
|
-
requiredProof: string[];
|
|
73
|
-
repairRecipe: string[];
|
|
74
|
-
selfGateCommands: string[];
|
|
75
|
-
passingCondition: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface ResolveIORunnerRepairTargetOverride {
|
|
79
|
-
preferredSuffixes?: string[];
|
|
80
|
-
fallbackFiles?: string[];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface ResolveIORunnerRepairPlanInput extends ResolveIORunnerBasicsOptions {
|
|
84
|
-
blockers?: string[];
|
|
85
|
-
changedFiles?: string[];
|
|
86
|
-
gateSource?: string;
|
|
87
|
-
targetFileOverrides?: Record<string, ResolveIORunnerRepairTargetOverride>;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface ResolveIORunnerRepairContinuationInput {
|
|
91
|
-
currentBlockers?: string[];
|
|
92
|
-
previousBlockers?: string[];
|
|
93
|
-
activeContractBlockers?: string[];
|
|
94
|
-
currentAttempt?: number;
|
|
95
|
-
maxAttempts?: number;
|
|
96
|
-
currentRepairWaveCount?: number;
|
|
97
|
-
maxRepairWaves?: number;
|
|
98
|
-
diffHash?: string;
|
|
99
|
-
evidenceHash?: string;
|
|
100
|
-
previousDiffHash?: string;
|
|
101
|
-
previousEvidenceHash?: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export type ResolveIORunnerRepairContinuationAction =
|
|
105
|
-
| 'continue_attempt'
|
|
106
|
-
| 'start_repair_wave'
|
|
107
|
-
| 'park_repeated_blocker'
|
|
108
|
-
| 'park_no_progress'
|
|
109
|
-
| 'park_repair_wave_budget';
|
|
110
|
-
|
|
111
|
-
export interface ResolveIORunnerRepairContinuationDecision {
|
|
112
|
-
action: ResolveIORunnerRepairContinuationAction;
|
|
113
|
-
repeatedBlockers: string[];
|
|
114
|
-
newBlockers: string[];
|
|
115
|
-
normalizedCurrentBlockers: string[];
|
|
116
|
-
nextAttempt: number;
|
|
117
|
-
nextRepairWaveCount: number;
|
|
118
|
-
reason: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function normalizeOptionalString(value: any): string {
|
|
122
|
-
return String(value || '').replace(/\s+/g, ' ').trim();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function normalizePositiveInteger(value: any, fallback: number, min: number, max: number): number {
|
|
126
|
-
const numeric = Number(value);
|
|
127
|
-
if (!Number.isFinite(numeric)) {
|
|
128
|
-
return fallback;
|
|
129
|
-
}
|
|
130
|
-
const rounded = Number(numeric.toFixed(0));
|
|
131
|
-
return Math.max(min, Math.min(max, rounded));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function normalizeTextLine(value: any, maxChars: number): string {
|
|
135
|
-
return normalizeOptionalString(value).slice(0, maxChars).trim();
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function normalizeTextList(values: any, limit: number, maxChars: number): string[] {
|
|
139
|
-
if (!Array.isArray(values)) {
|
|
140
|
-
return [];
|
|
141
|
-
}
|
|
142
|
-
const result: string[] = [];
|
|
143
|
-
for (const value of values) {
|
|
144
|
-
const normalized = normalizeTextLine(value, maxChars);
|
|
145
|
-
if (normalized && !result.includes(normalized)) {
|
|
146
|
-
result.push(normalized);
|
|
147
|
-
}
|
|
148
|
-
if (result.length >= limit) {
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return result;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export function normalizeResolveIOQaPolicyOptions(options: ResolveIOQaPolicyOptions = {}): Required<Omit<ResolveIOQaPolicyOptions, 'currentRoute' | 'currentContextMode' | 'customInstructions'>> & {
|
|
156
|
-
currentRoute: string;
|
|
157
|
-
currentContextMode: string;
|
|
158
|
-
customInstructions: string[];
|
|
159
|
-
} {
|
|
160
|
-
return {
|
|
161
|
-
context: options.context || 'general',
|
|
162
|
-
includeDevServerRules: options.includeDevServerRules === true,
|
|
163
|
-
qaRepairEnabled: options.qaRepairEnabled !== false,
|
|
164
|
-
qaEvidenceRequired: options.qaEvidenceRequired !== false,
|
|
165
|
-
qaDistinctScreenshotRequired: options.qaDistinctScreenshotRequired !== false,
|
|
166
|
-
qaFailFastCompile: options.qaFailFastCompile !== false,
|
|
167
|
-
qaLiveDataRequired: options.qaLiveDataRequired !== false,
|
|
168
|
-
qaSelfRepairMaxWaves: normalizePositiveInteger(options.qaSelfRepairMaxWaves, 3, 1, 6),
|
|
169
|
-
currentRoute: normalizeOptionalString(options.currentRoute),
|
|
170
|
-
currentContextMode: normalizeOptionalString(options.currentContextMode),
|
|
171
|
-
customInstructions: Array.isArray(options.customInstructions)
|
|
172
|
-
? options.customInstructions.map(normalizeOptionalString).filter(Boolean).slice(0, 12)
|
|
173
|
-
: []
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function buildResolveIOQaPolicyRules(options: ResolveIOQaPolicyOptions = {}): string[] {
|
|
178
|
-
const policy = normalizeResolveIOQaPolicyOptions(options);
|
|
179
|
-
const rules: string[] = [];
|
|
180
|
-
if (policy.includeDevServerRules) {
|
|
181
|
-
rules.push(
|
|
182
|
-
'When browser/localhost QA needs long-running commands like `npm run server`, `npm run client`, `npm run dev`, `ng serve`, `vite`, or `nodemon`, start them as managed background processes with log files and PIDs; do not leave foreground dev-server commands as the active shell tool.',
|
|
183
|
-
'Before localhost/browser QA, source `.resolveio-support-tools/env.sh` or `.resolveio-ai-runner-tools/env.sh` when present. It supplies shared EC2 browser cache settings, `PUPPETEER_EXECUTABLE_PATH`/`CHROME_BIN`, Mongo wrappers, and non-conflicting localhost QA ports/URLs.',
|
|
184
|
-
'For ResolveIO app login during browser QA, use the shared AI-runner auth bootstrap when staged: `node ./.resolveio-support-tools/qa-auth-bootstrap.js <project-root> /target-route`, `node ./.resolveio-ai-runner-tools/qa-auth-bootstrap.js <project-root> /target-route`, or the same command from an app root with `../`. It must use the exact localhost client origin, call `/login` then `/accessToken`, clear service workers/cache/IndexedDB/local storage, seed auth storage, and emit `qa-artifacts/auth-bootstrap-result.json` plus a screenshot.',
|
|
185
|
-
'When launching Puppeteer or Playwright on workers, pass `executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || process.env.CHROME_BIN` if either env var is set. Do not download a fresh browser before checking these env vars and `PUPPETEER_CACHE_DIR`.',
|
|
186
|
-
'Use the managed-server pattern for localhost QA: `command > .build-output/<name>.log 2>&1 & PID=$!; trap "kill $PID 2>/dev/null || true" EXIT; wait for the port with curl; run browser checks; then kill/wait the PID`. Prefer `npm run client` or `./start_client.sh`; those scripts honor `RESOLVEIO_SUPPORT_QA_CLIENT_PORT` and `PORT`. Never run `ng serve ... | tee ...` or another dev server as a foreground command.'
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
if (policy.qaFailFastCompile) {
|
|
190
|
-
rules.push('Before browser QA, run the fastest compile/type/startup checks that can prove the app can load. Fix compile/startup failures before launching browser QA.');
|
|
191
|
-
}
|
|
192
|
-
if (policy.qaRepairEnabled) {
|
|
193
|
-
rules.push(`If compile, startup, browser, or live-data QA fails, run a targeted repair wave for the exact failing route/action/data state, then rerun that same failed step before continuing. Limit self-repair to ${policy.qaSelfRepairMaxWaves} focused waves before returning the precise blocker.`);
|
|
194
|
-
}
|
|
195
|
-
if (policy.qaLiveDataRequired) {
|
|
196
|
-
rules.push('For bug fixes and data/publication changes, test against available live app data or a faithful seeded record; do not rely only on static inspection when the user reported a runtime workflow problem.');
|
|
197
|
-
rules.push('For import/export/form-submit/data workflows, QA must drive the actual customer action with representative data: capture the relevant starting state, the dialog/form/file selection or action state, and the submitted/resulting state with a row/count/value assertion that proves the bug or feature works.');
|
|
198
|
-
rules.push('A navigation-only screenshot of an empty page, shell, table header, or unchanged screen is not sufficient evidence for data workflow fixes. If the page has no records, seed or choose a faithful test record and identify the record or fixture used.');
|
|
199
|
-
}
|
|
200
|
-
rules.push('Use desktop screenshots at a wide/full-screen viewport by default: 1920x1080 or wider. Do not use narrow/tablet/mobile screenshots unless the approved ticket is specifically mobile/responsive.');
|
|
201
|
-
rules.push('For desktop QA, verify the top navigation is in its normal desktop state and not wrapped, collapsed, open, or covering the workflow. For mobile-specific QA, explicitly use a mobile viewport and close the mobile menu unless the menu behavior itself is being proven.');
|
|
202
|
-
if (policy.qaDistinctScreenshotRequired) {
|
|
203
|
-
rules.push('Capture one screenshot or trace for each distinct changed customer-facing feature, screen, workflow state, or data result. Do not repeat equivalent screenshots for multiple records unless record-specific behavior changed.');
|
|
204
|
-
}
|
|
205
|
-
rules.push('Every screenshot artifact must include a short customer-facing caption explaining what the screenshot proves. Captions should describe the workflow state, such as Before, Ready to import, Submitted result, or Mobile menu closed.');
|
|
206
|
-
if (policy.qaEvidenceRequired) {
|
|
207
|
-
rules.push('Final notes must list the exact QA command, route, account/data used, screenshot/trace/log paths, and result for each changed behavior; if browser QA is not applicable, say why and provide the compile/data proof used instead.');
|
|
208
|
-
}
|
|
209
|
-
if (policy.currentRoute) {
|
|
210
|
-
rules.push(`Current app context route from the AI terminal is ${policy.currentRoute}${policy.currentContextMode ? ` (${policy.currentContextMode})` : ''}; start QA there when the request refers to this page or current screen.`);
|
|
211
|
-
}
|
|
212
|
-
rules.push(...policy.customInstructions);
|
|
213
|
-
return rules;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export function buildResolveIORunnerBasicsRules(options: ResolveIORunnerBasicsOptions = {}): string[] {
|
|
217
|
-
return buildResolveIORunnerContract(options).rules;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export function buildResolveIORunnerContract(options: ResolveIORunnerBasicsOptions = {}): ResolveIORunnerContract {
|
|
221
|
-
const maxContextBullets = normalizePositiveInteger(options.maxContextBullets, 8, 3, 20);
|
|
222
|
-
const maxRepairWaves = normalizePositiveInteger(
|
|
223
|
-
options.maxRepairWaves ?? options.qaSelfRepairMaxWaves,
|
|
224
|
-
3,
|
|
225
|
-
1,
|
|
226
|
-
6
|
|
227
|
-
);
|
|
228
|
-
const context = options.context || 'general';
|
|
229
|
-
const runnerBasics = [
|
|
230
|
-
'Use repo-local patterns first: read the closest existing implementation, matching tests, model/schema, method/publication, and UI route before editing.',
|
|
231
|
-
'Make the smallest complete change that satisfies the request; avoid broad refactors, config churn, dependency changes, and generated-file edits unless the workflow explicitly requires regeneration.',
|
|
232
|
-
'Before returning, state what changed, how it was verified, remaining blockers, and exact artifact paths in final notes.'
|
|
233
|
-
];
|
|
234
|
-
const tokenDiscipline = options.includeTokenDiscipline !== false
|
|
235
|
-
? [
|
|
236
|
-
`Keep context lean: summarize prior history into at most ${maxContextBullets} bullets, retrieve specific files on demand, and do not paste full logs, lockfiles, generated files, or stale ticket/email chains unless they are the current blocker evidence.`,
|
|
237
|
-
'Prefer targeted search/read commands over loading broad directories. If a command returns noisy output, summarize the useful lines and continue with narrower reads.',
|
|
238
|
-
'On retries, carry only the active blocker contract, changed-file list, relevant diff/evidence summary, and latest failing command output. Do not restart with a clean-slate mega prompt.',
|
|
239
|
-
'Stop autonomous retries when the same normalized blocker repeats without meaningful diff or evidence improvement; park with a precise blocker instead of burning tokens.'
|
|
240
|
-
]
|
|
241
|
-
: [];
|
|
242
|
-
const dependencyBootstrap = options.includeDependencyBootstrap !== false
|
|
243
|
-
? [
|
|
244
|
-
'Reuse existing dependency caches and hydrated node_modules when available. Prefer npm install --force with the configured npm cache; do not use npm ci unless the workflow explicitly requires it.',
|
|
245
|
-
'Before reinstalling or downloading browsers, check the existing workspace cache, shared node_modules, PUPPETEER_EXECUTABLE_PATH, CHROME_BIN, PUPPETEER_CACHE_DIR, and project-provided bootstrap scripts.'
|
|
246
|
-
]
|
|
247
|
-
: [];
|
|
248
|
-
const repairLoop = options.includeRepairLoop !== false
|
|
249
|
-
? [
|
|
250
|
-
`Use targeted repair waves: compile/startup blocker, browser route/action blocker, data/publication blocker, and review blocker each get a focused repair, then rerun the exact failed step. Limit this to ${maxRepairWaves} focused waves before returning a precise blocker.`,
|
|
251
|
-
'Repair all instances of a detected blocker class in the touched scope, not only the first occurrence.'
|
|
252
|
-
]
|
|
253
|
-
: [];
|
|
254
|
-
const qaPolicy = options.includeQaPolicy !== false
|
|
255
|
-
? buildResolveIOQaPolicyRules({
|
|
256
|
-
...options,
|
|
257
|
-
qaSelfRepairMaxWaves: maxRepairWaves
|
|
258
|
-
})
|
|
259
|
-
: [];
|
|
260
|
-
const evidenceContract = options.includeEvidenceContract !== false
|
|
261
|
-
? [
|
|
262
|
-
'Evidence must be customer/workflow oriented: routes, buttons, pages, data states, screenshots/traces, command results, and assertions. Do not expose internal file names, backend paths, stack traces, or implementation chatter in customer-facing text.',
|
|
263
|
-
'For UI-facing changes, capture one screenshot or trace per distinct changed feature/workflow; for data-only changes, provide live-data or seeded-data assertion proof.',
|
|
264
|
-
'For import, upload, export, form submit, calculation, publication, or persistence fixes, proof must show the before/action/after workflow state and a concrete row/count/value assertion. Empty shell screenshots do not count as proof.',
|
|
265
|
-
'Desktop proof screenshots must use a wide/full-screen viewport, normally 1920x1080 or wider, with navigation closed/unwrapped unless the ticket is specifically about mobile or menu behavior.',
|
|
266
|
-
'Each screenshot must have a customer-facing caption that says what the image proves; these captions are used in validation emails.'
|
|
267
|
-
]
|
|
268
|
-
: [];
|
|
269
|
-
const finalNotes = [
|
|
270
|
-
'Final notes must include: changed behavior, touched functional areas, exact commands run, exact QA route/data state, screenshot/trace/log paths, and remaining blockers if any.',
|
|
271
|
-
'If work is parked, final notes must name the blocker class, last failing command/artifact, why another autonomous attempt would repeat, and the smallest manual action needed.'
|
|
272
|
-
];
|
|
273
|
-
const sections = {
|
|
274
|
-
runnerBasics,
|
|
275
|
-
tokenDiscipline,
|
|
276
|
-
dependencyBootstrap,
|
|
277
|
-
repairLoop,
|
|
278
|
-
qaPolicy,
|
|
279
|
-
evidenceContract,
|
|
280
|
-
finalNotes
|
|
281
|
-
};
|
|
282
|
-
const rules = [
|
|
283
|
-
...runnerBasics,
|
|
284
|
-
...tokenDiscipline,
|
|
285
|
-
...dependencyBootstrap,
|
|
286
|
-
...repairLoop,
|
|
287
|
-
...qaPolicy,
|
|
288
|
-
...evidenceContract,
|
|
289
|
-
...finalNotes
|
|
290
|
-
];
|
|
291
|
-
const promptLines = [
|
|
292
|
-
`ResolveIO shared runner contract (${context}):`,
|
|
293
|
-
...rules.map((rule) => `- ${rule}`)
|
|
294
|
-
];
|
|
295
|
-
return {
|
|
296
|
-
context,
|
|
297
|
-
sections,
|
|
298
|
-
rules,
|
|
299
|
-
promptLines
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
export function buildResolveIORunnerPromptLines(options: ResolveIORunnerBasicsOptions = {}): string[] {
|
|
304
|
-
return buildResolveIORunnerContract(options).promptLines;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export function buildResolveIORunnerPromptBundle(input: ResolveIORunnerPromptInput = {}): ResolveIORunnerPromptBundle {
|
|
308
|
-
const contract = buildResolveIORunnerContract(input);
|
|
309
|
-
const maxTextChars = normalizePositiveInteger(input.maxTextChars, 900, 160, 2400);
|
|
310
|
-
const objective = normalizeTextLine(input.objective, maxTextChars)
|
|
311
|
-
|| 'Complete the requested ResolveIO runner task with minimal, verified changes.';
|
|
312
|
-
const priorSummary = normalizeTextLine(input.priorSummary, maxTextChars);
|
|
313
|
-
const latestFailure = normalizeTextLine(input.latestFailure, maxTextChars);
|
|
314
|
-
const blockers = normalizeTextList(input.blockers, normalizePositiveInteger(input.maxBlockers, 5, 1, 12), maxTextChars);
|
|
315
|
-
const relevantFiles = normalizeTextList(input.relevantFiles, normalizePositiveInteger(input.maxFiles, 12, 1, 30), 260);
|
|
316
|
-
const evidence = normalizeTextList(input.evidence, normalizePositiveInteger(input.maxEvidence, 8, 1, 20), maxTextChars);
|
|
317
|
-
const contextLines = [
|
|
318
|
-
`Objective: ${objective}`,
|
|
319
|
-
...(priorSummary ? [`Prior summary: ${priorSummary}`] : []),
|
|
320
|
-
...(latestFailure ? [`Latest failure: ${latestFailure}`] : []),
|
|
321
|
-
...(blockers.length ? ['Active blockers:', ...blockers.map((line) => `- ${line}`)] : []),
|
|
322
|
-
...(relevantFiles.length ? ['Relevant files:', ...relevantFiles.map((line) => `- ${line}`)] : []),
|
|
323
|
-
...(evidence.length ? ['Known evidence:', ...evidence.map((line) => `- ${line}`)] : [])
|
|
324
|
-
];
|
|
325
|
-
const repairLines = blockers.length
|
|
326
|
-
? [
|
|
327
|
-
'Mandatory repair contract:',
|
|
328
|
-
'- Address each active blocker before unrelated work.',
|
|
329
|
-
'- For each blocker, mark resolved, proven false, or blocked.',
|
|
330
|
-
'- Attach code, data, command, browser, screenshot, or trace proof for each blocker.',
|
|
331
|
-
'- If a blocker repeats with no meaningful diff/evidence change, park instead of starting another broad attempt.'
|
|
332
|
-
]
|
|
333
|
-
: [];
|
|
334
|
-
const fullPromptLines = [
|
|
335
|
-
...contract.promptLines,
|
|
336
|
-
'',
|
|
337
|
-
'Runner task context:',
|
|
338
|
-
...contextLines,
|
|
339
|
-
...(repairLines.length ? ['', ...repairLines] : [])
|
|
340
|
-
];
|
|
341
|
-
return {
|
|
342
|
-
...contract,
|
|
343
|
-
objective,
|
|
344
|
-
contextLines,
|
|
345
|
-
repairLines,
|
|
346
|
-
fullPromptLines
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export function buildResolveIORunnerRepairPromptLines(input: ResolveIORunnerPromptInput = {}): string[] {
|
|
351
|
-
return buildResolveIORunnerPromptBundle(input).repairLines;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
export function normalizeResolveIORunnerBlocker(entry: string): string {
|
|
355
|
-
return String(entry || '')
|
|
356
|
-
.toLowerCase()
|
|
357
|
-
.replace(/:[0-9]+(?=\b|[);,.\s])/g, ':#')
|
|
358
|
-
.replace(/\bline\s+[0-9]+\b/g, 'line #')
|
|
359
|
-
.replace(/\blines?\s+[0-9]+\s*[-–]\s*[0-9]+\b/g, 'lines #')
|
|
360
|
-
.replace(/\battempt\s+[0-9]+\b/g, 'attempt #')
|
|
361
|
-
.replace(/\s+/g, ' ')
|
|
362
|
-
.trim();
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
function uniqueNormalizedResolveIORunnerBlockers(values: any): string[] {
|
|
366
|
-
if (!Array.isArray(values)) {
|
|
367
|
-
return [];
|
|
368
|
-
}
|
|
369
|
-
return Array.from(new Set(
|
|
370
|
-
values
|
|
371
|
-
.map((entry) => normalizeResolveIORunnerBlocker(String(entry || '')))
|
|
372
|
-
.filter(Boolean)
|
|
373
|
-
));
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
export function findRepeatedResolveIORunnerBlockers(previousBlockers: string[] = [], currentBlockers: string[] = []): string[] {
|
|
377
|
-
const previous = new Set(uniqueNormalizedResolveIORunnerBlockers(previousBlockers));
|
|
378
|
-
if (!previous.size) {
|
|
379
|
-
return [];
|
|
380
|
-
}
|
|
381
|
-
return Array.from(new Set(
|
|
382
|
-
(currentBlockers || [])
|
|
383
|
-
.map((entry) => String(entry || '').trim())
|
|
384
|
-
.filter((entry) => previous.has(normalizeResolveIORunnerBlocker(entry)))
|
|
385
|
-
));
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
export function decideResolveIORunnerRepairContinuation(
|
|
389
|
-
input: ResolveIORunnerRepairContinuationInput = {}
|
|
390
|
-
): ResolveIORunnerRepairContinuationDecision {
|
|
391
|
-
const currentBlockers = (input.currentBlockers || [])
|
|
392
|
-
.map((entry) => String(entry || '').trim())
|
|
393
|
-
.filter(Boolean);
|
|
394
|
-
const normalizedCurrentBlockers = uniqueNormalizedResolveIORunnerBlockers(currentBlockers);
|
|
395
|
-
const previousBlockers = uniqueNormalizedResolveIORunnerBlockers(input.previousBlockers || []);
|
|
396
|
-
const activeContractBlockers = uniqueNormalizedResolveIORunnerBlockers(input.activeContractBlockers || []);
|
|
397
|
-
const priorBlockers = new Set([...previousBlockers, ...activeContractBlockers]);
|
|
398
|
-
const repeatedBlockers = findRepeatedResolveIORunnerBlockers(Array.from(priorBlockers), currentBlockers);
|
|
399
|
-
const repeated = new Set(repeatedBlockers.map((entry) => normalizeResolveIORunnerBlocker(entry)));
|
|
400
|
-
const newBlockers = currentBlockers.filter((entry) => !repeated.has(normalizeResolveIORunnerBlocker(entry)));
|
|
401
|
-
const currentAttempt = normalizePositiveInteger(input.currentAttempt, 1, 1, 100);
|
|
402
|
-
const maxAttempts = normalizePositiveInteger(input.maxAttempts, 3, 1, 100);
|
|
403
|
-
const currentRepairWaveCount = normalizePositiveInteger(input.currentRepairWaveCount, 0, 0, 100);
|
|
404
|
-
const maxRepairWaves = normalizePositiveInteger(input.maxRepairWaves, 3, 0, 100);
|
|
405
|
-
const diffHash = normalizeOptionalString(input.diffHash);
|
|
406
|
-
const evidenceHash = normalizeOptionalString(input.evidenceHash);
|
|
407
|
-
const previousDiffHash = normalizeOptionalString(input.previousDiffHash);
|
|
408
|
-
const previousEvidenceHash = normalizeOptionalString(input.previousEvidenceHash);
|
|
409
|
-
const noProgress = !!previousDiffHash
|
|
410
|
-
&& !!previousEvidenceHash
|
|
411
|
-
&& previousDiffHash === diffHash
|
|
412
|
-
&& previousEvidenceHash === evidenceHash;
|
|
413
|
-
const nextAttempt = currentAttempt + 1;
|
|
414
|
-
const nextRepairWaveCount = currentRepairWaveCount + 1;
|
|
415
|
-
if (noProgress) {
|
|
416
|
-
return {
|
|
417
|
-
action: 'park_no_progress',
|
|
418
|
-
repeatedBlockers,
|
|
419
|
-
newBlockers,
|
|
420
|
-
normalizedCurrentBlockers,
|
|
421
|
-
nextAttempt,
|
|
422
|
-
nextRepairWaveCount,
|
|
423
|
-
reason: 'Targeted repair made no meaningful diff or evidence progress.'
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
if (repeatedBlockers.length) {
|
|
427
|
-
return {
|
|
428
|
-
action: 'park_repeated_blocker',
|
|
429
|
-
repeatedBlockers,
|
|
430
|
-
newBlockers,
|
|
431
|
-
normalizedCurrentBlockers,
|
|
432
|
-
nextAttempt,
|
|
433
|
-
nextRepairWaveCount,
|
|
434
|
-
reason: 'The same normalized blocker repeated after a targeted repair.'
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
const shouldStartNewWave = currentBlockers.length > 0
|
|
438
|
-
&& (
|
|
439
|
-
activeContractBlockers.length > 0
|
|
440
|
-
|| currentAttempt >= maxAttempts
|
|
441
|
-
);
|
|
442
|
-
if (shouldStartNewWave) {
|
|
443
|
-
if (currentRepairWaveCount >= maxRepairWaves) {
|
|
444
|
-
return {
|
|
445
|
-
action: 'park_repair_wave_budget',
|
|
446
|
-
repeatedBlockers,
|
|
447
|
-
newBlockers,
|
|
448
|
-
normalizedCurrentBlockers,
|
|
449
|
-
nextAttempt,
|
|
450
|
-
nextRepairWaveCount,
|
|
451
|
-
reason: `Repair wave budget exhausted (${currentRepairWaveCount}/${maxRepairWaves}).`
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
return {
|
|
455
|
-
action: 'start_repair_wave',
|
|
456
|
-
repeatedBlockers,
|
|
457
|
-
newBlockers,
|
|
458
|
-
normalizedCurrentBlockers,
|
|
459
|
-
nextAttempt: 2,
|
|
460
|
-
nextRepairWaveCount,
|
|
461
|
-
reason: 'A prior blocker was cleared and a new blocker appeared; start a focused repair wave instead of consuming the final attempt.'
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
return {
|
|
465
|
-
action: 'continue_attempt',
|
|
466
|
-
repeatedBlockers,
|
|
467
|
-
newBlockers,
|
|
468
|
-
normalizedCurrentBlockers,
|
|
469
|
-
nextAttempt,
|
|
470
|
-
nextRepairWaveCount: currentRepairWaveCount,
|
|
471
|
-
reason: 'Continue with the next targeted attempt.'
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
export function classifyResolveIORunnerBlocker(blocker: string): string {
|
|
476
|
-
const text = String(blocker || '');
|
|
477
|
-
if (/database call inside loop|findOne.*inside loop|query inside loop/i.test(text)) {
|
|
478
|
-
return 'db_call_inside_loop';
|
|
479
|
-
}
|
|
480
|
-
if (/inventory transaction parity|inventory transactions? are correct|inventory transaction creation\/reversal|inventory drift|reverse(?:s| old).*inventory|custom chemical lines?/i.test(text)) {
|
|
481
|
-
return 'inventory_transaction_parity';
|
|
482
|
-
}
|
|
483
|
-
if (/company\/global default line-item surcharge|customer surcharge override|surcharge override.*default|global\/company surcharge|fallback\/override|first active surcharge/i.test(text)) {
|
|
484
|
-
return 'surcharge_default_precedence';
|
|
485
|
-
}
|
|
486
|
-
if (/\bTS\d{4}\b[\s\S]{0,220}\bExpected\s+0\s+arguments?\b[\s\S]{0,160}\bgot\s+1\b/i.test(text)
|
|
487
|
-
&& /\b(publication|publications\.ts|subscribe|user_specific|ForUser|yardsForUser|customerNotifications|notificationCenter)\b/i.test(text)) {
|
|
488
|
-
return 'user_specific_publication_argument_mismatch';
|
|
489
|
-
}
|
|
490
|
-
if (/\b(publication signature mismatch|generated publication signature|publication wrapper)\b[\s\S]{0,220}\b(?:yardsForUser|[A-Za-z0-9_]*ForUser)\b[\s\S]{0,160}\bcompile errors?\b/i.test(text)
|
|
491
|
-
|| /\b(?:yardsForUser|[A-Za-z0-9_]*ForUser)\b[\s\S]{0,180}\bcompile errors?\b[\s\S]{0,180}\b(publication|publications\.ts|signature|wrapper)\b/i.test(text)) {
|
|
492
|
-
return 'user_specific_publication_argument_mismatch';
|
|
493
|
-
}
|
|
494
|
-
if (/\b(user_specific|user-specific)\b[\s\S]{0,220}\b(Expected\s+0\s+arguments?|got\s+1|passes?\s+1\s+argument|publication wrapper)\b/i.test(text)) {
|
|
495
|
-
return 'user_specific_publication_argument_mismatch';
|
|
496
|
-
}
|
|
497
|
-
if (/focused verification evidence|Behavior-level test\/QA evidence|browser QA|screenshot|trace artifacts?|Billing Dashboard.*create\/edit|server-side evidence|Validation evidence/i.test(text)) {
|
|
498
|
-
return 'support_qa_evidence';
|
|
499
|
-
}
|
|
500
|
-
if (/Approved scope requirement is not covered|approved .* scope lacks/i.test(text)) {
|
|
501
|
-
return 'approved_scope_missing';
|
|
502
|
-
}
|
|
503
|
-
if (/UI-facing ticket needs|browser\/localhost QA|local\/browser QA/i.test(text)) {
|
|
504
|
-
return 'ui_qa_missing';
|
|
505
|
-
}
|
|
506
|
-
if (/Report\/export ticket needs|report rows|export behavior/i.test(text)) {
|
|
507
|
-
return 'report_export_missing';
|
|
508
|
-
}
|
|
509
|
-
if (/Generated .* changed without a matching/i.test(text)) {
|
|
510
|
-
return 'generated_file_mismatch';
|
|
511
|
-
}
|
|
512
|
-
if (/No repository files changed|no verifiable PR fix/i.test(text)) {
|
|
513
|
-
return 'no_repo_diff';
|
|
514
|
-
}
|
|
515
|
-
if (/QA compile preflight|ng serve failed|Angular ng serve failed|Completion build verification failed|build failed|TypeScript check failed|TypeScript compile|lint failed|TS\d{4}|Cannot find module/i.test(text)) {
|
|
516
|
-
return 'completion_build_failed';
|
|
517
|
-
}
|
|
518
|
-
return 'reviewer_blocker';
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
export function extractResolveIORunnerRepairLineHints(blocker: string): string[] {
|
|
522
|
-
const hints: string[] = [];
|
|
523
|
-
const lineMatch = String(blocker || '').match(/(?:line\s+|:)([0-9]+)\b/i);
|
|
524
|
-
if (lineMatch) {
|
|
525
|
-
hints.push(`line ${lineMatch[1]}`);
|
|
526
|
-
}
|
|
527
|
-
const loopMatch = String(blocker || '').match(/loop starts near line\s+([0-9]+)/i);
|
|
528
|
-
if (loopMatch) {
|
|
529
|
-
hints.push(`loop starts near line ${loopMatch[1]}`);
|
|
530
|
-
}
|
|
531
|
-
return Array.from(new Set(hints));
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
export function extractResolveIORunnerRepairTargetFiles(blocker: string, changedFiles: string[] = []): string[] {
|
|
535
|
-
const files = new Set<string>();
|
|
536
|
-
const text = String(blocker || '');
|
|
537
|
-
const pathPattern = /(?:^|\s)([A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+\.(?:ts|tsx|js|jsx|html|scss|css|json|md))/g;
|
|
538
|
-
let match: RegExpExecArray | null;
|
|
539
|
-
while ((match = pathPattern.exec(text))) {
|
|
540
|
-
files.add(match[1].replace(/\\/g, '/'));
|
|
541
|
-
}
|
|
542
|
-
for (const filePath of changedFiles || []) {
|
|
543
|
-
const normalized = String(filePath || '').trim().replace(/\\/g, '/');
|
|
544
|
-
if (normalized && (text.includes(normalized) || text.includes(normalized.replace(/^[^/]+\//, '')))) {
|
|
545
|
-
files.add(normalized);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
return Array.from(files).slice(0, 8);
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
export function selectResolveIORunnerRepairTargetFiles(
|
|
552
|
-
changedFiles: string[] = [],
|
|
553
|
-
preferredSuffixes: string[] = [],
|
|
554
|
-
fallbackFiles: string[] = []
|
|
555
|
-
): string[] {
|
|
556
|
-
const suffixes = (preferredSuffixes || [])
|
|
557
|
-
.map((entry) => String(entry || '').trim().replace(/\\/g, '/').replace(/^\/+/, ''))
|
|
558
|
-
.filter(Boolean);
|
|
559
|
-
const matched = new Set<string>();
|
|
560
|
-
for (const filePath of changedFiles || []) {
|
|
561
|
-
const normalized = String(filePath || '').trim().replace(/\\/g, '/');
|
|
562
|
-
if (normalized && suffixes.some((suffix) => normalized === suffix || normalized.endsWith(`/${suffix}`))) {
|
|
563
|
-
matched.add(normalized);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
return (matched.size
|
|
567
|
-
? Array.from(matched)
|
|
568
|
-
: fallbackFiles.map((entry) => String(entry || '').trim().replace(/\\/g, '/')).filter(Boolean)
|
|
569
|
-
).slice(0, 12);
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
export function sanitizeResolveIORunnerRepairPlans(value: any): ResolveIORunnerRepairPlan[] {
|
|
573
|
-
return Array.isArray(value)
|
|
574
|
-
? value.map((entry: any) => ({
|
|
575
|
-
blockerClass: String(entry?.blockerClass || '').trim(),
|
|
576
|
-
sourceGate: String(entry?.sourceGate || '').trim(),
|
|
577
|
-
targetFiles: Array.isArray(entry?.targetFiles) ? entry.targetFiles.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],
|
|
578
|
-
lineHints: Array.isArray(entry?.lineHints) ? entry.lineHints.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],
|
|
579
|
-
failureEvidence: Array.isArray(entry?.failureEvidence) ? entry.failureEvidence.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],
|
|
580
|
-
requiredProof: Array.isArray(entry?.requiredProof) ? entry.requiredProof.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],
|
|
581
|
-
repairRecipe: Array.isArray(entry?.repairRecipe) ? entry.repairRecipe.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],
|
|
582
|
-
selfGateCommands: Array.isArray(entry?.selfGateCommands) ? entry.selfGateCommands.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],
|
|
583
|
-
passingCondition: String(entry?.passingCondition || '').trim()
|
|
584
|
-
})).filter((entry: ResolveIORunnerRepairPlan) => entry.blockerClass || entry.failureEvidence.length)
|
|
585
|
-
: [];
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
function getResolveIORunnerRepairTargetOverride(
|
|
589
|
-
options: ResolveIORunnerRepairPlanInput,
|
|
590
|
-
blockerClass: string
|
|
591
|
-
): ResolveIORunnerRepairTargetOverride | null {
|
|
592
|
-
const override = options.targetFileOverrides?.[blockerClass];
|
|
593
|
-
if (!override) {
|
|
594
|
-
return null;
|
|
595
|
-
}
|
|
596
|
-
return {
|
|
597
|
-
preferredSuffixes: Array.isArray(override.preferredSuffixes) ? override.preferredSuffixes : [],
|
|
598
|
-
fallbackFiles: Array.isArray(override.fallbackFiles) ? override.fallbackFiles : []
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
function applyResolveIORunnerRepairTargetOverride(
|
|
603
|
-
plan: ResolveIORunnerRepairPlan,
|
|
604
|
-
options: ResolveIORunnerRepairPlanInput,
|
|
605
|
-
blockerClass: string
|
|
606
|
-
): ResolveIORunnerRepairPlan {
|
|
607
|
-
const override = getResolveIORunnerRepairTargetOverride(options, blockerClass);
|
|
608
|
-
if (!override || plan.targetFiles.length) {
|
|
609
|
-
return plan;
|
|
610
|
-
}
|
|
611
|
-
return {
|
|
612
|
-
...plan,
|
|
613
|
-
targetFiles: selectResolveIORunnerRepairTargetFiles(
|
|
614
|
-
options.changedFiles || [],
|
|
615
|
-
override.preferredSuffixes || [],
|
|
616
|
-
override.fallbackFiles || []
|
|
617
|
-
)
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
export function buildResolveIORunnerRepairPlans(input: ResolveIORunnerRepairPlanInput = {}): ResolveIORunnerRepairPlan[] {
|
|
622
|
-
const changedFiles = Array.isArray(input.changedFiles) ? input.changedFiles : [];
|
|
623
|
-
const sourceGate = String(input.gateSource || 'pre_review_or_reviewer').trim() || 'pre_review_or_reviewer';
|
|
624
|
-
const qaRules = buildResolveIORunnerBasicsRules({
|
|
625
|
-
...input,
|
|
626
|
-
context: input.context || 'general',
|
|
627
|
-
includeDevServerRules: input.includeDevServerRules === true,
|
|
628
|
-
maxContextBullets: input.maxContextBullets || 8
|
|
629
|
-
});
|
|
630
|
-
return Array.from(new Set((input.blockers || []).map((entry) => String(entry || '').trim()).filter(Boolean))).map((blocker) => {
|
|
631
|
-
const blockerClass = classifyResolveIORunnerBlocker(blocker);
|
|
632
|
-
const base: ResolveIORunnerRepairPlan = {
|
|
633
|
-
blockerClass,
|
|
634
|
-
sourceGate,
|
|
635
|
-
targetFiles: extractResolveIORunnerRepairTargetFiles(blocker, changedFiles),
|
|
636
|
-
lineHints: extractResolveIORunnerRepairLineHints(blocker),
|
|
637
|
-
failureEvidence: [blocker].filter(Boolean).slice(0, 8),
|
|
638
|
-
requiredProof: [],
|
|
639
|
-
repairRecipe: [],
|
|
640
|
-
selfGateCommands: [],
|
|
641
|
-
passingCondition: ''
|
|
642
|
-
};
|
|
643
|
-
if (blockerClass === 'db_call_inside_loop') {
|
|
644
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
645
|
-
...base,
|
|
646
|
-
requiredProof: [
|
|
647
|
-
'Show the database lookup is batched before the loop, or prove the flagged call is not a database collection call.',
|
|
648
|
-
'Cite the exact file/function and before-vs-after loop/query shape in Repair Execution Notes.',
|
|
649
|
-
'Confirm the changed diff no longer has any per-item database collection call in any loop body in the touched/target server files.'
|
|
650
|
-
],
|
|
651
|
-
repairRecipe: [
|
|
652
|
-
'Inspect every loop in the touched/target server files and identify all database collection calls inside those loops.',
|
|
653
|
-
'Move collection reads before loops using batched `$in` queries, map results by id/key, then use the map inside loops.',
|
|
654
|
-
'Move writes out of loops using batched `bulkWrite`/multi-update operations prepared inside the loop and executed after the loop.',
|
|
655
|
-
'If the call is a local array/helper and not a database call, prove that with the declaration/import path and leave the code unchanged.',
|
|
656
|
-
'Keep the behavior identical except for eliminating every per-item database call.'
|
|
657
|
-
],
|
|
658
|
-
selfGateCommands: [
|
|
659
|
-
'git diff HEAD -- <target file>',
|
|
660
|
-
'rg -n "for .*\\{|\\.forEach|for \\(" <target file>',
|
|
661
|
-
'rg -n "\\.(find|findOne|findOneAsync|count|countDocuments|update|updateOne|updateMany|insert|insertOne|bulkWrite|remove|deleteOne|deleteMany)\\(" <target file>'
|
|
662
|
-
],
|
|
663
|
-
passingCondition: 'No loop in the touched/target server files has a database collection call in its body, or final notes prove each flagged call is not a database call.'
|
|
664
|
-
}, input, blockerClass);
|
|
665
|
-
}
|
|
666
|
-
if (blockerClass === 'report_export_missing') {
|
|
667
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
668
|
-
...base,
|
|
669
|
-
requiredProof: ['Prove report rows, filters, totals/grouping, and export behavior, or cite ticket evidence that export is out of scope.'],
|
|
670
|
-
repairRecipe: ['Exercise the report/export path and record evidence for each report dimension requested by the ticket.'],
|
|
671
|
-
selfGateCommands: ['Run the report/export verification command or browser flow for the ticket.'],
|
|
672
|
-
passingCondition: 'Final notes prove rows, filters, totals/grouping, and export behavior or a ticket-backed out-of-scope decision.'
|
|
673
|
-
}, input, blockerClass);
|
|
674
|
-
}
|
|
675
|
-
if (blockerClass === 'inventory_transaction_parity') {
|
|
676
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
677
|
-
...base,
|
|
678
|
-
requiredProof: [
|
|
679
|
-
'Prove non-Manual Delivery and Truck Treat custom chemical lines create inventory relief transactions on invoice create.',
|
|
680
|
-
'Prove invoice edit reverses old custom chemical effects and applies the new custom chemical effects.',
|
|
681
|
-
'Prove invoice remove/delete reverses the same non-Manual custom chemical inventory effects.'
|
|
682
|
-
],
|
|
683
|
-
repairRecipe: [
|
|
684
|
-
'Start in server/src/methods/invoices.ts and trace Manual inventory behavior before changing the non-Manual path.',
|
|
685
|
-
'Reuse the existing inventory transaction helper shape instead of creating a parallel inventory writer.',
|
|
686
|
-
'Handle all custom chemical lines in one sweep: create, edit, and remove for Delivery and Truck Treat invoices.',
|
|
687
|
-
'Do not stop after fixing only create; the reviewer blocker includes edit and remove reversal.'
|
|
688
|
-
],
|
|
689
|
-
selfGateCommands: [
|
|
690
|
-
'git diff HEAD -- server/src/methods/invoices.ts server/src/methods/inventory-transactions.ts',
|
|
691
|
-
'rg -n "is_custom_line_item|addInventoryTransaction|removeInvoice|editInvoice|custom chemical" server/src/methods/invoices.ts',
|
|
692
|
-
'Run or add a focused server/data assertion covering create, edit, and remove inventory transactions for non-Manual custom chemical lines.'
|
|
693
|
-
],
|
|
694
|
-
passingCondition: 'Create, edit, and remove paths for non-Manual custom chemical invoice lines all have inventory transaction proof.'
|
|
695
|
-
}, input, blockerClass);
|
|
696
|
-
}
|
|
697
|
-
if (blockerClass === 'surcharge_default_precedence') {
|
|
698
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
699
|
-
...base,
|
|
700
|
-
requiredProof: [
|
|
701
|
-
'Show the persisted company/global default surcharge owner, not just the first active surcharge item.',
|
|
702
|
-
'Show precedence is customer override when active, then company/global default when active, then empty/none when inactive or unset.',
|
|
703
|
-
'Show at least one override customer and one default customer path in verification evidence.'
|
|
704
|
-
],
|
|
705
|
-
repairRecipe: [
|
|
706
|
-
'Find the surcharge default selector and replace any first-active-item fallback with an explicit persisted default setting.',
|
|
707
|
-
'Keep customer override storage separate from the company/global default setting.',
|
|
708
|
-
'Reject inactive surcharge items during both override and default fallback.',
|
|
709
|
-
'Cover unset and inactive settings with safe empty/none behavior.'
|
|
710
|
-
],
|
|
711
|
-
selfGateCommands: [
|
|
712
|
-
'git diff HEAD -- angular/app/manage/item angular/app/widgets/dialog/dialog.adjust-customer.content.ts server/src/collections server/src/models',
|
|
713
|
-
'rg -n "line_item_surcharge|surcharge|id_line_item_surcharge_override|default" angular/app server/src',
|
|
714
|
-
'Run or add a focused fallback/override assertion for active override, active company default, inactive override/default, and unset default.'
|
|
715
|
-
],
|
|
716
|
-
passingCondition: 'Customer override -> company/global default -> none precedence is persisted and verified.'
|
|
717
|
-
}, input, blockerClass);
|
|
718
|
-
}
|
|
719
|
-
if (blockerClass === 'support_qa_evidence') {
|
|
720
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
721
|
-
...base,
|
|
722
|
-
requiredProof: [
|
|
723
|
-
'Include browser route and screenshot/trace artifact paths for each distinct changed customer-facing feature or workflow state.',
|
|
724
|
-
'Do not duplicate screenshots across multiple customers unless the customer-specific override/fallback behavior is the feature being proven.',
|
|
725
|
-
'Include data/assertion evidence for requested persistence, calculations, and side effects.',
|
|
726
|
-
'For import/export/form-submit/data workflow fixes, include before/action/after screenshots or trace steps plus the exact row/count/value assertion proving the submitted data changed as expected.',
|
|
727
|
-
'Reject empty page/table/header screenshots as insufficient unless the approved requirement is explicitly an empty-state UI.',
|
|
728
|
-
'Use a 1920x1080-or-wider desktop viewport for screenshots unless the ticket explicitly requests mobile/responsive behavior; desktop nav must be closed and not wrapped over the workflow.',
|
|
729
|
-
'Provide a customer-facing caption for each screenshot that explains the workflow state and proof shown.',
|
|
730
|
-
'If browser QA cannot start, include the exact startup blocker and the compile/preflight command output.'
|
|
731
|
-
],
|
|
732
|
-
repairRecipe: [
|
|
733
|
-
...qaRules,
|
|
734
|
-
'Upload or preserve screenshots/trace paths so the PR and support ticket can reference them.'
|
|
735
|
-
],
|
|
736
|
-
selfGateCommands: [
|
|
737
|
-
'Run the support QA compile/startup preflight.',
|
|
738
|
-
'Run the ticket-specific browser QA click-through and capture screenshots/trace artifacts.',
|
|
739
|
-
'Record artifact paths and data assertions in final notes.'
|
|
740
|
-
],
|
|
741
|
-
passingCondition: 'Final notes include one QA screenshot/trace path per distinct changed feature plus data assertions for the approved scope.'
|
|
742
|
-
}, input, blockerClass);
|
|
743
|
-
}
|
|
744
|
-
if (blockerClass === 'approved_scope_missing') {
|
|
745
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
746
|
-
...base,
|
|
747
|
-
requiredProof: ['Add one Self-Review Checklist bullet for the exact missing approved requirement with code/data/browser proof.'],
|
|
748
|
-
repairRecipe: ['Verify the missing approved requirement, then implement or document done/not applicable/blocked with proof.'],
|
|
749
|
-
selfGateCommands: ['Review final notes for exact approved requirement text and proof artifact.'],
|
|
750
|
-
passingCondition: 'Every missing approved requirement is explicitly mapped to done/not applicable/blocked with proof.'
|
|
751
|
-
}, input, blockerClass);
|
|
752
|
-
}
|
|
753
|
-
if (blockerClass === 'ui_qa_missing') {
|
|
754
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
755
|
-
...base,
|
|
756
|
-
requiredProof: ['Provide browser route plus screenshot/trace/video path, or a precise LOCALHOST_QA_PLAYBOOK startup/access blocker.'],
|
|
757
|
-
repairRecipe: ['Run local/browser QA for the failing UI route after the fix, or document the exact startup/access blocker.'],
|
|
758
|
-
selfGateCommands: ['source .resolveio-support-tools/env.sh if present', 'Run the ticket-specific localhost/browser QA command or capture blocker.'],
|
|
759
|
-
passingCondition: 'Final notes contain browser QA artifact evidence or a concrete local startup/access blocker.'
|
|
760
|
-
}, input, blockerClass);
|
|
761
|
-
}
|
|
762
|
-
if (blockerClass === 'generated_file_mismatch') {
|
|
763
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
764
|
-
...base,
|
|
765
|
-
requiredProof: ['Show generated client file changes correspond to matching server method/publication source changes.'],
|
|
766
|
-
repairRecipe: ['Either update the server owner and regenerate the companion file, or revert the orphan generated file change.'],
|
|
767
|
-
selfGateCommands: ['git diff HEAD -- angular/app/methods.ts angular/app/publications.ts server/src/methods server/src/publications'],
|
|
768
|
-
passingCondition: 'No generated client file is changed without its source server owner change.'
|
|
769
|
-
}, input, blockerClass);
|
|
770
|
-
}
|
|
771
|
-
if (blockerClass === 'user_specific_publication_argument_mismatch') {
|
|
772
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
773
|
-
...base,
|
|
774
|
-
requiredProof: [
|
|
775
|
-
'List every failing call site and show each one was fixed, not just the first TypeScript error.',
|
|
776
|
-
'Show whether each call needs the current logged-in user or an explicit other user/driver id.',
|
|
777
|
-
'Show generated angular/app/publications.ts came from server/src/publications source and was not hand-edited as the behavioral fix.'
|
|
778
|
-
],
|
|
779
|
-
repairRecipe: [
|
|
780
|
-
'user_specific publications inject the logged-in socket user as the first server parameter; generated client wrappers should remove only that injected parameter.',
|
|
781
|
-
'Before changing call sites, inspect the source publication signature. If a client can pass a target user/driver, make the source explicit as function(id_current_user: string, id_user?: string) and regenerate.',
|
|
782
|
-
'Only remove a client argument when the publication truly uses the injected current user only; otherwise preserve explicit target-user/driver calls such as yardsForUser(id_driver).',
|
|
783
|
-
'Do not hand-edit generated angular/app/publications.ts to accept the injected id_user again; fix source publications/call sites, then regenerate.',
|
|
784
|
-
'Search the whole app for the failing wrapper name and repair all argument-passing calls in the same pass.'
|
|
785
|
-
],
|
|
786
|
-
selfGateCommands: [
|
|
787
|
-
'rg -n "\\b[A-Za-z0-9_]*ForUser\\s*\\([^)]+" angular/app server/src',
|
|
788
|
-
'rg -n "\\byardsForUser\\s*\\([^)]+" angular/app server/src',
|
|
789
|
-
'Run the method/publication generator if server publication source changed.',
|
|
790
|
-
'Rerun the exact TypeScript/Angular compile command that failed.'
|
|
791
|
-
],
|
|
792
|
-
passingCondition: 'Generated user_specific wrappers strip only the injected current-user parameter, explicit target-user arguments still compile where required, and the exact compile command exits 0.'
|
|
793
|
-
}, input, blockerClass);
|
|
794
|
-
}
|
|
795
|
-
if (blockerClass === 'completion_build_failed') {
|
|
796
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
797
|
-
...base,
|
|
798
|
-
requiredProof: ['Include the failing command, root cause, fix, and passing rerun output.'],
|
|
799
|
-
repairRecipe: ['Fix the compile/test failure directly, then rerun the exact failing command.'],
|
|
800
|
-
selfGateCommands: ['Rerun the exact completion/build command shown in the blocker.'],
|
|
801
|
-
passingCondition: 'The exact previously failing build/test command passes or is blocked with concrete environment evidence.'
|
|
802
|
-
}, input, blockerClass);
|
|
803
|
-
}
|
|
804
|
-
return applyResolveIORunnerRepairTargetOverride({
|
|
805
|
-
...base,
|
|
806
|
-
requiredProof: ['Resolve, prove false, or block this reviewer/gate blocker with concrete code/data/browser proof.'],
|
|
807
|
-
repairRecipe: ['Inspect the cited file/evidence, make the smallest supported fix, and cite before-vs-after proof.'],
|
|
808
|
-
selfGateCommands: ['git diff HEAD --stat', 'Run the ticket-specific verification for this blocker.'],
|
|
809
|
-
passingCondition: 'The blocker text no longer applies and final notes include concrete proof.'
|
|
810
|
-
}, input, blockerClass);
|
|
811
|
-
});
|
|
812
|
-
}
|