@resolveio/server-lib 22.3.142 → 22.3.144
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-run.collection.d.ts +3 -0
- package/collections/ai-run.collection.js +170 -0
- package/collections/ai-run.collection.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 +134 -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 +951 -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/ai-run-evidence.manager.d.ts +36 -0
- package/managers/ai-run-evidence.manager.js +377 -0
- package/managers/ai-run-evidence.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 +84 -0
- package/managers/method.manager.js +1964 -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 +16 -0
- package/managers/openai-usage-ledger.manager.js +93 -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 +337 -0
- package/methods/ai-terminal.js +23166 -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-run.model.d.ts +19 -0
- package/models/ai-run.model.js +4 -0
- package/models/ai-run.model.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 +32 -0
- package/{src/models/email-history.model.ts → models/email-history.model.js} +4 -36
- 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 +127 -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 +128 -0
- package/services/codex-client.js +1629 -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 +124 -0
- package/util/ai-qa-policy.js +736 -0
- package/util/ai-qa-policy.js.map +1 -0
- package/util/ai-run-evidence-adapters.d.ts +33 -0
- package/util/ai-run-evidence-adapters.js +831 -0
- package/util/ai-run-evidence-adapters.js.map +1 -0
- package/util/ai-run-evidence-dashboard.d.ts +67 -0
- package/util/ai-run-evidence-dashboard.js +309 -0
- package/util/ai-run-evidence-dashboard.js.map +1 -0
- package/util/ai-run-evidence-eval.d.ts +86 -0
- package/util/ai-run-evidence-eval.js +854 -0
- package/util/ai-run-evidence-eval.js.map +1 -0
- package/util/ai-run-evidence.d.ts +212 -0
- package/util/ai-run-evidence.js +649 -0
- package/util/ai-run-evidence.js.map +1 -0
- package/util/ai-runner-artifacts.d.ts +82 -0
- package/util/ai-runner-artifacts.js +713 -0
- package/util/ai-runner-artifacts.js.map +1 -0
- package/util/ai-runner-manager-autopilot.d.ts +92 -0
- package/util/ai-runner-manager-autopilot.js +281 -0
- package/util/ai-runner-manager-autopilot.js.map +1 -0
- package/util/ai-runner-manager-policy.d.ts +282 -0
- package/util/ai-runner-manager-policy.js +997 -0
- package/util/ai-runner-manager-policy.js.map +1 -0
- package/util/ai-runner-qa-auth.d.ts +5 -0
- package/util/ai-runner-qa-auth.js +822 -0
- package/util/ai-runner-qa-auth.js.map +1 -0
- package/util/ai-runner-qa-tools.d.ts +26 -0
- package/util/ai-runner-qa-tools.js +3029 -0
- package/util/ai-runner-qa-tools.js.map +1 -0
- package/util/aicoder-runner-v6.d.ts +214 -0
- package/util/aicoder-runner-v6.js +507 -0
- package/util/aicoder-runner-v6.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/openai-usage-cost.d.ts +6 -0
- package/util/openai-usage-cost.js +103 -0
- package/util/openai-usage-cost.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/runner-process-janitor.d.ts +27 -0
- package/util/runner-process-janitor.js +208 -0
- package/util/runner-process-janitor.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/support-runner-v5.d.ts +415 -0
- package/util/support-runner-v5.js +1445 -0
- package/util/support-runner-v5.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 -195
- 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-run.collection.ts +0 -117
- 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 -134
- 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 -818
- 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/ai-run-evidence.manager.ts +0 -264
- 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 -1857
- 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 -57
- 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 -23497
- 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-run.model.ts +0 -27
- 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 -1231
- 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 -925
- package/src/util/ai-run-evidence-adapters.ts +0 -677
- package/src/util/ai-run-evidence-dashboard.ts +0 -271
- package/src/util/ai-run-evidence-eval.ts +0 -885
- package/src/util/ai-run-evidence.ts +0 -964
- package/src/util/ai-runner-artifacts.ts +0 -586
- package/src/util/ai-runner-manager-autopilot.ts +0 -380
- package/src/util/ai-runner-manager-policy.ts +0 -1740
- package/src/util/ai-runner-qa-auth.ts +0 -821
- package/src/util/ai-runner-qa-tools.ts +0 -3045
- package/src/util/aicoder-runner-v6.ts +0 -875
- 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/openai-usage-cost.ts +0 -114
- package/src/util/report-builder-unwinds.ts +0 -180
- package/src/util/runner-process-janitor.ts +0 -219
- 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/support-runner-v5.ts +0 -2065
- 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 -2968
- package/tests/ai-manager-autopilot-snapshot.test.ts +0 -172
- package/tests/ai-manager-recovery-checkpoint.test.ts +0 -323
- package/tests/ai-run-eval.test.ts +0 -88
- package/tests/ai-run-evidence.test.ts +0 -305
- package/tests/ai-runner-contract.test.ts +0 -488
- package/tests/aicoder-runner-v6.test.ts +0 -268
- 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/tests/support-runner-v5.test.ts +0 -417
- 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
|
@@ -0,0 +1,997 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __values = (this && this.__values) || function(o) {
|
|
14
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
15
|
+
if (m) return m.call(o);
|
|
16
|
+
if (o && typeof o.length === "number") return {
|
|
17
|
+
next: function () {
|
|
18
|
+
if (o && i >= o.length) o = void 0;
|
|
19
|
+
return { value: o && o[i++], done: !o };
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
23
|
+
};
|
|
24
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
+
if (!m) return o;
|
|
27
|
+
var i = m.call(o), r, ar = [], e;
|
|
28
|
+
try {
|
|
29
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
+
}
|
|
31
|
+
catch (error) { e = { error: error }; }
|
|
32
|
+
finally {
|
|
33
|
+
try {
|
|
34
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
+
}
|
|
36
|
+
finally { if (e) throw e.error; }
|
|
37
|
+
}
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.normalizeResolveIOAIManagerFailureClass = normalizeResolveIOAIManagerFailureClass;
|
|
51
|
+
exports.fingerprintResolveIOAIManagerBlocker = fingerprintResolveIOAIManagerBlocker;
|
|
52
|
+
exports.hashResolveIOAIManagerEvidence = hashResolveIOAIManagerEvidence;
|
|
53
|
+
exports.buildResolveIOAIManagerRecoveryCheckpoint = buildResolveIOAIManagerRecoveryCheckpoint;
|
|
54
|
+
exports.buildResolveIOAIManagerRecoveryEvidenceProbe = buildResolveIOAIManagerRecoveryEvidenceProbe;
|
|
55
|
+
exports.buildResolveIOAIManagerRecoveryActionPacket = buildResolveIOAIManagerRecoveryActionPacket;
|
|
56
|
+
exports.decideResolveIOAIManagerRecoveryActionDispatch = decideResolveIOAIManagerRecoveryActionDispatch;
|
|
57
|
+
exports.appendResolveIOAIManagerRecoveryActionDispatch = appendResolveIOAIManagerRecoveryActionDispatch;
|
|
58
|
+
exports.buildResolveIOAIManagerRecoveryExecutionDirective = buildResolveIOAIManagerRecoveryExecutionDirective;
|
|
59
|
+
exports.decideResolveIOAIManagerRecoveryGate = decideResolveIOAIManagerRecoveryGate;
|
|
60
|
+
exports.buildResolveIOAIManagerRecoveryPlan = buildResolveIOAIManagerRecoveryPlan;
|
|
61
|
+
exports.decideResolveIOAIManagerPolicy = decideResolveIOAIManagerPolicy;
|
|
62
|
+
function cleanText(value, max) {
|
|
63
|
+
if (max === void 0) { max = 2000; }
|
|
64
|
+
return String(value || '').replace(/\s+/g, ' ').trim().slice(0, max);
|
|
65
|
+
}
|
|
66
|
+
function cleanList(values, limit, max) {
|
|
67
|
+
var e_1, _a;
|
|
68
|
+
if (limit === void 0) { limit = 40; }
|
|
69
|
+
if (max === void 0) { max = 500; }
|
|
70
|
+
if (!Array.isArray(values)) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
var result = [];
|
|
74
|
+
try {
|
|
75
|
+
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
|
|
76
|
+
var value = values_1_1.value;
|
|
77
|
+
var normalized = cleanText(value, max);
|
|
78
|
+
if (normalized && !result.includes(normalized)) {
|
|
79
|
+
result.push(normalized);
|
|
80
|
+
}
|
|
81
|
+
if (result.length >= limit) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
87
|
+
finally {
|
|
88
|
+
try {
|
|
89
|
+
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
|
|
90
|
+
}
|
|
91
|
+
finally { if (e_1) throw e_1.error; }
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
function isoNow(value) {
|
|
96
|
+
if (value instanceof Date) {
|
|
97
|
+
return value.toISOString();
|
|
98
|
+
}
|
|
99
|
+
var parsed = value ? new Date(value) : new Date();
|
|
100
|
+
if (Number.isFinite(parsed.getTime())) {
|
|
101
|
+
return parsed.toISOString();
|
|
102
|
+
}
|
|
103
|
+
return new Date().toISOString();
|
|
104
|
+
}
|
|
105
|
+
function stableHash(prefix, value) {
|
|
106
|
+
var normalized = typeof value === 'string'
|
|
107
|
+
? cleanText(value, 12000)
|
|
108
|
+
: JSON.stringify(value || {});
|
|
109
|
+
var hash = 0;
|
|
110
|
+
for (var index = 0; index < normalized.length; index += 1) {
|
|
111
|
+
hash = ((hash << 5) - hash + normalized.charCodeAt(index)) | 0;
|
|
112
|
+
}
|
|
113
|
+
return "".concat(prefix, "-").concat(Math.abs(hash).toString(36) || '0');
|
|
114
|
+
}
|
|
115
|
+
function normalizeResolveIOAIManagerFailureClass(value) {
|
|
116
|
+
var normalized = cleanText(value, 80)
|
|
117
|
+
.toLowerCase()
|
|
118
|
+
.replace(/[\s-]+/g, '_');
|
|
119
|
+
if (!normalized) {
|
|
120
|
+
return 'unknown';
|
|
121
|
+
}
|
|
122
|
+
if (/^(qa_infra|infrastructure|harness|puppeteer|chrome|mongo|port|startup)$/.test(normalized)) {
|
|
123
|
+
return 'infra';
|
|
124
|
+
}
|
|
125
|
+
if (/^(build|compile|typescript|tsc|angular_build|ng_build)$/.test(normalized)) {
|
|
126
|
+
return 'compile';
|
|
127
|
+
}
|
|
128
|
+
if (/^(false_pass|route_only|missing_business_proof)$/.test(normalized)) {
|
|
129
|
+
return 'business';
|
|
130
|
+
}
|
|
131
|
+
return normalized.slice(0, 80);
|
|
132
|
+
}
|
|
133
|
+
function fingerprintResolveIOAIManagerBlocker(value) {
|
|
134
|
+
var normalized = cleanText(value, 4000)
|
|
135
|
+
.toLowerCase()
|
|
136
|
+
.replace(/[a-f0-9]{16,}/g, '<id>')
|
|
137
|
+
.replace(/\b\d{2,}\b/g, '<n>')
|
|
138
|
+
.replace(/\bline\s+<n>\b/g, 'line <n>')
|
|
139
|
+
.replace(/https?:\/\/\S+/g, '<url>')
|
|
140
|
+
.replace(/\s+/g, ' ')
|
|
141
|
+
.trim();
|
|
142
|
+
return stableHash('mgr-blocker', normalized);
|
|
143
|
+
}
|
|
144
|
+
function resolveResolveIOAIManagerBlockerFingerprint(record, fallback) {
|
|
145
|
+
var blockerText = cleanText((record === null || record === void 0 ? void 0 : record.blocker) || (record === null || record === void 0 ? void 0 : record.summary), 4000);
|
|
146
|
+
if (blockerText) {
|
|
147
|
+
return fingerprintResolveIOAIManagerBlocker(blockerText);
|
|
148
|
+
}
|
|
149
|
+
var explicit = cleanText(record === null || record === void 0 ? void 0 : record.blockerFingerprint, 120);
|
|
150
|
+
if (explicit) {
|
|
151
|
+
return explicit;
|
|
152
|
+
}
|
|
153
|
+
return fingerprintResolveIOAIManagerBlocker(fallback || '');
|
|
154
|
+
}
|
|
155
|
+
function hashResolveIOAIManagerEvidence(record) {
|
|
156
|
+
if (!record) {
|
|
157
|
+
return stableHash('mgr-evidence', '');
|
|
158
|
+
}
|
|
159
|
+
var explicit = cleanText(record.evidenceHash, 120);
|
|
160
|
+
if (explicit) {
|
|
161
|
+
return explicit;
|
|
162
|
+
}
|
|
163
|
+
return stableHash('mgr-evidence', {
|
|
164
|
+
failureClass: normalizeResolveIOAIManagerFailureClass(record.failureClass),
|
|
165
|
+
blocker: cleanText(record.blocker || record.summary, 2000),
|
|
166
|
+
changedFiles: cleanList(record.changedFiles, 80, 500).sort(),
|
|
167
|
+
artifactPaths: cleanList(record.artifactPaths, 80, 500).sort()
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function buildResolveIOAIManagerRecoveryCheckpoint(input) {
|
|
171
|
+
var plan = input.plan;
|
|
172
|
+
var current = input.current || {};
|
|
173
|
+
var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, plan.objective);
|
|
174
|
+
var evidenceHash = hashResolveIOAIManagerEvidence(current);
|
|
175
|
+
var changedFiles = cleanList(current.changedFiles, 80, 500);
|
|
176
|
+
var artifactPaths = cleanList(current.artifactPaths, 80, 500);
|
|
177
|
+
var previous = input.previousCheckpoint;
|
|
178
|
+
var sameCheckpointBase = previous
|
|
179
|
+
&& previous.recoveryClass === plan.recoveryClass
|
|
180
|
+
&& previous.lane === plan.lane
|
|
181
|
+
&& previous.stepType === plan.stepType
|
|
182
|
+
&& previous.blockerFingerprint === blockerFingerprint
|
|
183
|
+
&& previous.evidenceHash === evidenceHash;
|
|
184
|
+
var attempts = sameCheckpointBase ? Math.max(0, Number(previous.attempts || 0)) + 1 : 1;
|
|
185
|
+
var status = plan.recoveryClass === 'manual_handoff'
|
|
186
|
+
? 'manual_handoff'
|
|
187
|
+
: plan.recoveryClass === 'blocked_until_new_evidence'
|
|
188
|
+
? 'parked'
|
|
189
|
+
: plan.recoveryClass === 'advance_after_proof'
|
|
190
|
+
? 'complete'
|
|
191
|
+
: 'active';
|
|
192
|
+
var now = isoNow(input.now);
|
|
193
|
+
var checkpointId = stableHash('mgr-recovery', {
|
|
194
|
+
recoveryClass: plan.recoveryClass,
|
|
195
|
+
lane: plan.lane,
|
|
196
|
+
stepType: plan.stepType,
|
|
197
|
+
allowedAction: plan.allowedAction,
|
|
198
|
+
blockerFingerprint: blockerFingerprint,
|
|
199
|
+
evidenceHash: evidenceHash
|
|
200
|
+
});
|
|
201
|
+
return {
|
|
202
|
+
checkpointId: checkpointId,
|
|
203
|
+
recoveryClass: plan.recoveryClass,
|
|
204
|
+
status: status,
|
|
205
|
+
lane: plan.lane,
|
|
206
|
+
stepType: plan.stepType,
|
|
207
|
+
allowedAction: plan.allowedAction,
|
|
208
|
+
productRepairAllowed: plan.productRepairAllowed,
|
|
209
|
+
expensiveModelAllowed: plan.expensiveModelAllowed,
|
|
210
|
+
attempts: attempts,
|
|
211
|
+
maxAttemptsBeforePark: plan.maxAttemptsBeforePark,
|
|
212
|
+
blockerFingerprint: blockerFingerprint,
|
|
213
|
+
evidenceHash: evidenceHash,
|
|
214
|
+
changedFiles: changedFiles,
|
|
215
|
+
artifactPaths: artifactPaths,
|
|
216
|
+
requiredEvidence: cleanList(plan.requiredEvidence, 40, 500),
|
|
217
|
+
loopResetEvidence: cleanList(plan.loopResetEvidence, 40, 500),
|
|
218
|
+
forbiddenActions: cleanList(plan.forbiddenActions, 40, 500),
|
|
219
|
+
objective: cleanText(plan.objective, 1000),
|
|
220
|
+
nextActionLabel: cleanText(plan.nextActionLabel, 160),
|
|
221
|
+
createdAt: sameCheckpointBase && (previous === null || previous === void 0 ? void 0 : previous.createdAt) ? previous.createdAt : now,
|
|
222
|
+
updatedAt: now
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function makeRecoveryEvidenceProbeStep(id, kind, label, objective, artifactExpectation, successSignal, options) {
|
|
226
|
+
if (options === void 0) { options = {}; }
|
|
227
|
+
return __assign(__assign({ id: id, kind: kind, label: label, objective: cleanText(objective, 1000), required: options.required !== false }, (options.commandHint ? { commandHint: cleanText(options.commandHint, 500) } : {})), { artifactExpectation: cleanText(artifactExpectation, 500), successSignal: cleanText(successSignal, 500) });
|
|
228
|
+
}
|
|
229
|
+
function recoveryEvidenceProbeStepsFor(checkpoint) {
|
|
230
|
+
var base = [
|
|
231
|
+
makeRecoveryEvidenceProbeStep('snapshot_current_blocker', 'rerun_same_gate', 'Snapshot Current Blocker', 'Capture the current blocker, failure class, evidence hash, changed files, and artifact paths before any new repair.', 'runner-evidence/current-blocker.json', 'Snapshot includes the same checkpointId, blockerFingerprint, and evidenceHashBefore.')
|
|
232
|
+
];
|
|
233
|
+
if (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {
|
|
234
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
235
|
+
makeRecoveryEvidenceProbeStep('collect_read_only_root_cause_evidence', 'read_only_diagnosis', 'Collect Read-Only Root-Cause Evidence', checkpoint.recoveryClass === 'diagnosis_revision'
|
|
236
|
+
? 'Collect new evidence that proves the current owner_files or failing_path is wrong before broadening scope.'
|
|
237
|
+
: 'Reproduce or classify the issue and record the exact customer complaint, expected result, observed result, route/module, and account context.', 'runner-evidence/diagnosis-readonly.md', 'Evidence supports one falsifiable accepted hypothesis and at least one rejected alternative.'),
|
|
238
|
+
makeRecoveryEvidenceProbeStep('validate_diagnosis_gate', 'read_only_diagnosis', 'Validate Diagnosis Gate', 'Validate issue_case, accepted_hypothesis, rejected_alternatives, failing_path, owner_files, and before/action/after proof_plan.', 'runner-evidence/diagnosis-gate.json', 'Diagnosis gate validates before product-code repair is allowed.')
|
|
239
|
+
], false);
|
|
240
|
+
}
|
|
241
|
+
if (checkpoint.recoveryClass === 'infra_repair') {
|
|
242
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
243
|
+
makeRecoveryEvidenceProbeStep('run_infra_preflight', 'infra_preflight', 'Run Infra Preflight', 'Check Puppeteer/Chrome, ports, Mongo/settings, cache state, startup commands, and server/client process health.', 'runner-evidence/infra-preflight.log', 'The same infra gate either passes or returns a new infra blocker hash.', { commandHint: 'runner preflight: puppeteer/chrome/mongo/ports/startup' })
|
|
244
|
+
], false);
|
|
245
|
+
}
|
|
246
|
+
if (checkpoint.recoveryClass === 'compile_repair') {
|
|
247
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
248
|
+
makeRecoveryEvidenceProbeStep('rerun_compile_gate', 'compile_check', 'Rerun Compile Gate', 'Rerun the same deterministic compile/build command and capture the first actionable error.', 'runner-evidence/compile.log', 'Compile passes or the first failing error changes.', { commandHint: 'same finite build/compile command from the failed gate' })
|
|
249
|
+
], false);
|
|
250
|
+
}
|
|
251
|
+
if (checkpoint.recoveryClass === 'journey_contract_repair') {
|
|
252
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
253
|
+
makeRecoveryEvidenceProbeStep('validate_journey_contract', 'journey_validation', 'Validate Journey Contract', 'Validate docs/APP_JOURNEY_CONTRACT.md has first/next/last workflow, route/action/method mapping, seeded data story, completion states, and QA assertions.', 'runner-evidence/journey-contract-validation.json', 'Journey contract validates before build tasks continue.'),
|
|
254
|
+
makeRecoveryEvidenceProbeStep('verify_hub_workflow_mapping', 'journey_validation', 'Verify Hub Workflow Mapping', 'Confirm the hub CTA and screen sequence implement the journey contract instead of link-only navigation.', 'runner-evidence/hub-workflow-map.json', 'Primary hub action maps to a real route/action/method/calculation and next state.')
|
|
255
|
+
], false);
|
|
256
|
+
}
|
|
257
|
+
if (checkpoint.recoveryClass === 'business_proof_repair' || checkpoint.recoveryClass === 'product_code_repair') {
|
|
258
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
259
|
+
makeRecoveryEvidenceProbeStep('rerun_business_assertion', 'business_assertion', 'Rerun Business Assertion', 'Run the exact issue/app promise proof and capture before/action/after DOM/data evidence.', 'runner-evidence/business-assertion.json', 'Business assertion passes, or the observed failure changes with a new artifact path.'),
|
|
260
|
+
makeRecoveryEvidenceProbeStep('check_diff_scope', 'diff_scope_check', 'Check Diff Scope', 'Compare changed files against the current diagnosis/journey owner scope before another code repair.', 'runner-evidence/diff-scope.json', 'Changed files are in scope, or diagnosis/journey scope is revised with evidence.')
|
|
261
|
+
], false);
|
|
262
|
+
}
|
|
263
|
+
if (checkpoint.recoveryClass === 'release_repair') {
|
|
264
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
265
|
+
makeRecoveryEvidenceProbeStep('collect_release_status', 'release_status', 'Collect Release Status', 'Collect publish/deploy/build-instance/domain/CloudFront status and the last actionable deploy error.', 'runner-evidence/release-status.json', 'Release gate passes or returns a new release blocker hash without product-code repair.')
|
|
266
|
+
], false);
|
|
267
|
+
}
|
|
268
|
+
if (checkpoint.recoveryClass === 'manual_handoff') {
|
|
269
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
270
|
+
makeRecoveryEvidenceProbeStep('operator_review_checkpoint', 'operator_review', 'Operator Review Checkpoint', 'Expose budget, blocker, evidence hash, and the minimum policy/scope change needed before another expensive loop.', 'runner-evidence/operator-review.json', 'Operator approves a new scope/policy or provides new external evidence.')
|
|
271
|
+
], false);
|
|
272
|
+
}
|
|
273
|
+
return __spreadArray(__spreadArray([], __read(base), false), [
|
|
274
|
+
makeRecoveryEvidenceProbeStep('rerun_same_deterministic_gate', 'rerun_same_gate', 'Rerun Same Deterministic Gate', 'Rerun the exact failed check and capture new logs/artifacts without changing product code first.', 'runner-evidence/retry-gate.log', 'Gate passes, or evidenceHash/blockerFingerprint/artifactPaths change.')
|
|
275
|
+
], false);
|
|
276
|
+
}
|
|
277
|
+
function buildResolveIOAIManagerRecoveryEvidenceProbe(input) {
|
|
278
|
+
var checkpoint = input.checkpoint;
|
|
279
|
+
var now = isoNow(input.now);
|
|
280
|
+
var steps = recoveryEvidenceProbeStepsFor(checkpoint);
|
|
281
|
+
var requiredArtifacts = Array.from(new Set(steps
|
|
282
|
+
.filter(function (step) { return step.required; })
|
|
283
|
+
.map(function (step) { return step.artifactExpectation; })
|
|
284
|
+
.filter(Boolean)));
|
|
285
|
+
return {
|
|
286
|
+
probeId: stableHash('mgr-probe', {
|
|
287
|
+
checkpointId: checkpoint.checkpointId,
|
|
288
|
+
recoveryClass: checkpoint.recoveryClass,
|
|
289
|
+
evidenceHash: checkpoint.evidenceHash,
|
|
290
|
+
blockerFingerprint: checkpoint.blockerFingerprint
|
|
291
|
+
}),
|
|
292
|
+
checkpointId: checkpoint.checkpointId,
|
|
293
|
+
recoveryClass: checkpoint.recoveryClass,
|
|
294
|
+
lane: checkpoint.lane,
|
|
295
|
+
stepType: checkpoint.stepType,
|
|
296
|
+
objective: checkpoint.status === 'parked'
|
|
297
|
+
? 'Collect new evidence before any additional expensive model/code repair.'
|
|
298
|
+
: cleanText(checkpoint.objective, 1000),
|
|
299
|
+
evidenceOnly: checkpoint.status === 'parked'
|
|
300
|
+
|| checkpoint.recoveryClass === 'diagnosis_only'
|
|
301
|
+
|| checkpoint.recoveryClass === 'diagnosis_revision'
|
|
302
|
+
|| checkpoint.recoveryClass === 'infra_repair'
|
|
303
|
+
|| checkpoint.recoveryClass === 'compile_repair'
|
|
304
|
+
|| checkpoint.recoveryClass === 'release_repair',
|
|
305
|
+
productRepairAllowed: checkpoint.productRepairAllowed && checkpoint.status !== 'parked',
|
|
306
|
+
expensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked',
|
|
307
|
+
evidenceHashBefore: checkpoint.evidenceHash,
|
|
308
|
+
blockerFingerprint: checkpoint.blockerFingerprint,
|
|
309
|
+
steps: steps,
|
|
310
|
+
requiredArtifacts: requiredArtifacts,
|
|
311
|
+
acceptanceEvidence: Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], __read(checkpoint.requiredEvidence), false), __read(checkpoint.loopResetEvidence), false), __read(steps.map(function (step) { return step.successSignal; })), false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30),
|
|
312
|
+
stopConditions: Array.from(new Set(__spreadArray(__spreadArray([], __read(checkpoint.forbiddenActions), false), [
|
|
313
|
+
'no new evidence hash',
|
|
314
|
+
'no new artifact path',
|
|
315
|
+
'product-code repair requested while evidenceOnly is true'
|
|
316
|
+
], false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30),
|
|
317
|
+
loopResetEvidence: checkpoint.loopResetEvidence,
|
|
318
|
+
createdAt: now
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
function recoveryAutomationModeFor(checkpoint) {
|
|
322
|
+
if (checkpoint.status === 'manual_handoff' || checkpoint.recoveryClass === 'manual_handoff') {
|
|
323
|
+
return 'manual_review';
|
|
324
|
+
}
|
|
325
|
+
if (checkpoint.status === 'complete' || checkpoint.recoveryClass === 'advance_after_proof') {
|
|
326
|
+
return 'advance';
|
|
327
|
+
}
|
|
328
|
+
if (checkpoint.status === 'parked' || checkpoint.recoveryClass === 'blocked_until_new_evidence') {
|
|
329
|
+
return 'collect_evidence';
|
|
330
|
+
}
|
|
331
|
+
if (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {
|
|
332
|
+
return 'read_only_diagnosis';
|
|
333
|
+
}
|
|
334
|
+
if (checkpoint.recoveryClass === 'infra_repair') {
|
|
335
|
+
return 'repair_infra';
|
|
336
|
+
}
|
|
337
|
+
if (checkpoint.recoveryClass === 'compile_repair') {
|
|
338
|
+
return 'repair_compile';
|
|
339
|
+
}
|
|
340
|
+
if (checkpoint.recoveryClass === 'journey_contract_repair') {
|
|
341
|
+
return 'repair_journey_contract';
|
|
342
|
+
}
|
|
343
|
+
if (checkpoint.recoveryClass === 'business_proof_repair') {
|
|
344
|
+
return 'repair_business_assertion';
|
|
345
|
+
}
|
|
346
|
+
if (checkpoint.recoveryClass === 'release_repair') {
|
|
347
|
+
return 'repair_release';
|
|
348
|
+
}
|
|
349
|
+
if (checkpoint.recoveryClass === 'product_code_repair') {
|
|
350
|
+
return 'targeted_product_repair';
|
|
351
|
+
}
|
|
352
|
+
return 'continue_gate';
|
|
353
|
+
}
|
|
354
|
+
function recoveryActionLabelFor(mode, checkpoint) {
|
|
355
|
+
var explicit = cleanText(checkpoint.nextActionLabel, 120);
|
|
356
|
+
if (explicit && mode !== 'collect_evidence') {
|
|
357
|
+
return explicit;
|
|
358
|
+
}
|
|
359
|
+
var labels = {
|
|
360
|
+
advance: 'Advance To Next Gate',
|
|
361
|
+
collect_evidence: 'Collect New Evidence',
|
|
362
|
+
read_only_diagnosis: 'Run Diagnosis Evidence Pass',
|
|
363
|
+
repair_infra: 'Repair Infra Gate',
|
|
364
|
+
repair_compile: 'Repair Compile Gate',
|
|
365
|
+
repair_journey_contract: 'Repair Journey Contract',
|
|
366
|
+
repair_business_assertion: 'Repair Business Proof',
|
|
367
|
+
repair_release: 'Repair Release Gate',
|
|
368
|
+
targeted_product_repair: 'Run Targeted Repair',
|
|
369
|
+
manual_review: 'Manual Review',
|
|
370
|
+
continue_gate: 'Continue Current Gate'
|
|
371
|
+
};
|
|
372
|
+
return labels[mode];
|
|
373
|
+
}
|
|
374
|
+
function recoveryActionAutoRunnable(mode, probe) {
|
|
375
|
+
if (mode === 'manual_review') {
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
if (mode === 'advance' || mode === 'continue_gate') {
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
if (mode === 'targeted_product_repair' || mode === 'read_only_diagnosis' || mode === 'repair_journey_contract' || mode === 'repair_business_assertion') {
|
|
382
|
+
return true;
|
|
383
|
+
}
|
|
384
|
+
return probe.steps.some(function (step) { return step.commandHint || step.kind === 'rerun_same_gate' || step.kind === 'release_status' || step.kind === 'diff_scope_check'; });
|
|
385
|
+
}
|
|
386
|
+
function buildResolveIOAIManagerRecoveryActionPacket(input) {
|
|
387
|
+
var checkpoint = input.checkpoint;
|
|
388
|
+
var probe = input.probe || buildResolveIOAIManagerRecoveryEvidenceProbe({
|
|
389
|
+
checkpoint: checkpoint,
|
|
390
|
+
current: input.current,
|
|
391
|
+
now: input.now
|
|
392
|
+
});
|
|
393
|
+
var mode = recoveryAutomationModeFor(checkpoint);
|
|
394
|
+
var primaryStep = probe.steps.find(function (step) { return step.required && step.id !== 'snapshot_current_blocker'; })
|
|
395
|
+
|| probe.steps.find(function (step) { return step.required; })
|
|
396
|
+
|| probe.steps[0];
|
|
397
|
+
var evidenceOnly = probe.evidenceOnly || mode === 'collect_evidence' || mode === 'repair_infra' || mode === 'repair_compile' || mode === 'repair_release';
|
|
398
|
+
var requireNewEvidence = mode === 'collect_evidence'
|
|
399
|
+
|| checkpoint.status === 'parked'
|
|
400
|
+
|| checkpoint.attempts >= checkpoint.maxAttemptsBeforePark;
|
|
401
|
+
var stopWhen = Array.from(new Set(__spreadArray(__spreadArray([], __read(probe.stopConditions), false), __read((requireNewEvidence ? ['same blocker fingerprint and same evidence hash after probe'] : [])), false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30);
|
|
402
|
+
var resetLoopWhen = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], __read(checkpoint.loopResetEvidence), false), __read(probe.loopResetEvidence), false), __read((requireNewEvidence ? ['changed evidence hash', 'new artifact path'] : [])), false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30);
|
|
403
|
+
var nextCommands = probe.steps
|
|
404
|
+
.map(function (step) { return cleanText(step.commandHint || "".concat(step.kind, ":").concat(step.id), 500); })
|
|
405
|
+
.filter(Boolean)
|
|
406
|
+
.slice(0, 12);
|
|
407
|
+
var now = isoNow(input.now);
|
|
408
|
+
return __assign(__assign({ actionId: stableHash('mgr-action', {
|
|
409
|
+
checkpointId: checkpoint.checkpointId,
|
|
410
|
+
probeId: probe.probeId,
|
|
411
|
+
mode: mode,
|
|
412
|
+
evidenceHash: checkpoint.evidenceHash,
|
|
413
|
+
blockerFingerprint: checkpoint.blockerFingerprint
|
|
414
|
+
}), checkpointId: checkpoint.checkpointId, probeId: probe.probeId, recoveryClass: checkpoint.recoveryClass, mode: mode, label: recoveryActionLabelFor(mode, checkpoint), lane: checkpoint.lane, stepType: checkpoint.stepType, primaryStepKind: (primaryStep === null || primaryStep === void 0 ? void 0 : primaryStep.kind) || 'none', objective: mode === 'collect_evidence'
|
|
415
|
+
? probe.objective
|
|
416
|
+
: cleanText(checkpoint.objective || probe.objective, 1000), evidenceOnly: evidenceOnly, autoRunnable: recoveryActionAutoRunnable(mode, probe), productRepairAllowed: checkpoint.productRepairAllowed && !evidenceOnly && checkpoint.status !== 'parked', expensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked', canResetLoopAfterEvidence: resetLoopWhen.length > 0, maxAttemptsBeforePark: checkpoint.maxAttemptsBeforePark, requiredArtifacts: probe.requiredArtifacts.slice(0, 20), nextCommands: nextCommands, successCriteria: probe.acceptanceEvidence.slice(0, 20), retryPolicy: {
|
|
417
|
+
allowImmediateRetry: checkpoint.status !== 'parked' && mode !== 'manual_review',
|
|
418
|
+
requireNewEvidence: requireNewEvidence,
|
|
419
|
+
resetLoopWhen: resetLoopWhen,
|
|
420
|
+
stopWhen: stopWhen
|
|
421
|
+
} }, (mode === 'collect_evidence' ? { blockedReason: 'Manager parked this loop until the recovery action records new evidence.' } : {})), { createdAt: now });
|
|
422
|
+
}
|
|
423
|
+
function dispatchActionForMode(mode) {
|
|
424
|
+
var map = {
|
|
425
|
+
advance: 'advance',
|
|
426
|
+
collect_evidence: 'run_evidence_probe',
|
|
427
|
+
read_only_diagnosis: 'run_read_only_diagnosis',
|
|
428
|
+
repair_infra: 'run_infra_repair',
|
|
429
|
+
repair_compile: 'run_compile_repair',
|
|
430
|
+
repair_journey_contract: 'run_journey_contract_repair',
|
|
431
|
+
repair_business_assertion: 'run_business_assertion_repair',
|
|
432
|
+
repair_release: 'run_release_repair',
|
|
433
|
+
targeted_product_repair: 'run_targeted_product_repair',
|
|
434
|
+
manual_review: 'park_manual',
|
|
435
|
+
continue_gate: 'continue_gate'
|
|
436
|
+
};
|
|
437
|
+
return map[mode] || 'park_manual';
|
|
438
|
+
}
|
|
439
|
+
function buildRecoveryDispatchRecord(action, dispatchAction, status, reason, current, now) {
|
|
440
|
+
var evidenceHash = (current === null || current === void 0 ? void 0 : current.evidenceHash) || action.checkpointId || action.actionId;
|
|
441
|
+
var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);
|
|
442
|
+
var artifactPaths = cleanList(current === null || current === void 0 ? void 0 : current.artifactPaths, 20, 500);
|
|
443
|
+
var createdAt = isoNow(now);
|
|
444
|
+
return __assign(__assign(__assign({ dispatchId: stableHash('mgr-dispatch', {
|
|
445
|
+
actionId: action.actionId,
|
|
446
|
+
dispatchAction: dispatchAction,
|
|
447
|
+
evidenceHash: evidenceHash,
|
|
448
|
+
blockerFingerprint: blockerFingerprint,
|
|
449
|
+
status: status
|
|
450
|
+
}), actionId: action.actionId, checkpointId: action.checkpointId, probeId: action.probeId, mode: action.mode, dispatchAction: dispatchAction, status: status, evidenceHash: evidenceHash, blockerFingerprint: blockerFingerprint, productRepairAllowed: action.productRepairAllowed && dispatchAction === 'run_targeted_product_repair', expensiveModelAllowed: action.expensiveModelAllowed && dispatchAction !== 'run_evidence_probe', reason: reason, artifactPaths: artifactPaths }, (status === 'started' ? { startedAt: createdAt } : {})), (status === 'completed' ? { completedAt: createdAt } : {})), { createdAt: createdAt });
|
|
451
|
+
}
|
|
452
|
+
function decideResolveIOAIManagerRecoveryActionDispatch(input) {
|
|
453
|
+
var action = input.action;
|
|
454
|
+
var history = Array.isArray(input.history) ? input.history.filter(Boolean).slice(-50) : [];
|
|
455
|
+
var current = input.current || {};
|
|
456
|
+
if (!action) {
|
|
457
|
+
return {
|
|
458
|
+
dispatchAction: 'park_manual',
|
|
459
|
+
allowed: false,
|
|
460
|
+
reason: 'recovery_dispatch_missing_action',
|
|
461
|
+
status: 'parked',
|
|
462
|
+
canRunProductRepair: false,
|
|
463
|
+
canRunExpensiveModel: false,
|
|
464
|
+
shouldRecordDispatch: false,
|
|
465
|
+
requiresNewEvidence: true,
|
|
466
|
+
newEvidence: false
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
var dispatchAction = dispatchActionForMode(action.mode);
|
|
470
|
+
var evidenceHash = current.evidenceHash || action.checkpointId || action.actionId;
|
|
471
|
+
var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);
|
|
472
|
+
var sameActionHistory = history.filter(function (entry) { return entry.actionId === action.actionId; });
|
|
473
|
+
var sameEvidenceHistory = sameActionHistory.filter(function (entry) { return entry.evidenceHash === evidenceHash
|
|
474
|
+
&& entry.blockerFingerprint === blockerFingerprint; });
|
|
475
|
+
var activeDispatch = sameEvidenceHistory.find(function (entry) { return entry.status === 'queued' || entry.status === 'started'; });
|
|
476
|
+
var completedDispatch = sameEvidenceHistory.find(function (entry) { return entry.status === 'completed' || entry.status === 'failed'; });
|
|
477
|
+
var newEvidence = sameActionHistory.length > 0 && sameEvidenceHistory.length === 0;
|
|
478
|
+
var requiresNewEvidence = action.retryPolicy.requireNewEvidence === true;
|
|
479
|
+
var manualOnly = action.mode === 'manual_review' || !action.autoRunnable;
|
|
480
|
+
var productDispatch = dispatchAction === 'run_targeted_product_repair';
|
|
481
|
+
var expensiveDispatch = !['run_evidence_probe', 'advance', 'continue_gate', 'park_manual'].includes(dispatchAction);
|
|
482
|
+
if (manualOnly && input.operatorApproved !== true) {
|
|
483
|
+
var record_1 = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_requires_manual_review', current, input.now);
|
|
484
|
+
return {
|
|
485
|
+
dispatchAction: 'park_manual',
|
|
486
|
+
allowed: false,
|
|
487
|
+
reason: record_1.reason,
|
|
488
|
+
status: 'parked',
|
|
489
|
+
canRunProductRepair: false,
|
|
490
|
+
canRunExpensiveModel: false,
|
|
491
|
+
shouldRecordDispatch: true,
|
|
492
|
+
requiresNewEvidence: requiresNewEvidence,
|
|
493
|
+
newEvidence: newEvidence,
|
|
494
|
+
dispatchRecord: record_1
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
if (productDispatch && action.productRepairAllowed !== true) {
|
|
498
|
+
var record_2 = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_product_repair_not_allowed', current, input.now);
|
|
499
|
+
return {
|
|
500
|
+
dispatchAction: 'park_manual',
|
|
501
|
+
allowed: false,
|
|
502
|
+
reason: record_2.reason,
|
|
503
|
+
status: 'parked',
|
|
504
|
+
canRunProductRepair: false,
|
|
505
|
+
canRunExpensiveModel: false,
|
|
506
|
+
shouldRecordDispatch: true,
|
|
507
|
+
requiresNewEvidence: true,
|
|
508
|
+
newEvidence: newEvidence,
|
|
509
|
+
dispatchRecord: record_2
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
if (activeDispatch) {
|
|
513
|
+
return {
|
|
514
|
+
dispatchAction: 'park_manual',
|
|
515
|
+
allowed: false,
|
|
516
|
+
reason: 'recovery_dispatch_already_running_for_same_evidence',
|
|
517
|
+
status: 'parked',
|
|
518
|
+
canRunProductRepair: false,
|
|
519
|
+
canRunExpensiveModel: false,
|
|
520
|
+
shouldRecordDispatch: false,
|
|
521
|
+
requiresNewEvidence: true,
|
|
522
|
+
newEvidence: false
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
if (completedDispatch && requiresNewEvidence && !newEvidence) {
|
|
526
|
+
var record_3 = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_same_evidence_already_attempted', current, input.now);
|
|
527
|
+
return {
|
|
528
|
+
dispatchAction: 'park_manual',
|
|
529
|
+
allowed: false,
|
|
530
|
+
reason: record_3.reason,
|
|
531
|
+
status: 'parked',
|
|
532
|
+
canRunProductRepair: false,
|
|
533
|
+
canRunExpensiveModel: false,
|
|
534
|
+
shouldRecordDispatch: true,
|
|
535
|
+
requiresNewEvidence: true,
|
|
536
|
+
newEvidence: false,
|
|
537
|
+
dispatchRecord: record_3
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
var status = dispatchAction === 'advance' || dispatchAction === 'continue_gate'
|
|
541
|
+
? 'completed'
|
|
542
|
+
: 'started';
|
|
543
|
+
var record = buildRecoveryDispatchRecord(action, dispatchAction, status, 'recovery_dispatch_allowed', current, input.now);
|
|
544
|
+
return {
|
|
545
|
+
dispatchAction: dispatchAction,
|
|
546
|
+
allowed: true,
|
|
547
|
+
reason: 'recovery_dispatch_allowed',
|
|
548
|
+
status: status,
|
|
549
|
+
canRunProductRepair: productDispatch && action.productRepairAllowed === true,
|
|
550
|
+
canRunExpensiveModel: expensiveDispatch && action.expensiveModelAllowed === true,
|
|
551
|
+
shouldRecordDispatch: true,
|
|
552
|
+
requiresNewEvidence: requiresNewEvidence,
|
|
553
|
+
newEvidence: newEvidence,
|
|
554
|
+
dispatchRecord: record
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
function appendResolveIOAIManagerRecoveryActionDispatch(history, record, limit) {
|
|
558
|
+
if (limit === void 0) { limit = 50; }
|
|
559
|
+
var existing = Array.isArray(history) ? history.filter(Boolean) : [];
|
|
560
|
+
if (!record) {
|
|
561
|
+
return existing.slice(-limit);
|
|
562
|
+
}
|
|
563
|
+
var deduped = existing.filter(function (entry) { return entry.dispatchId !== record.dispatchId; });
|
|
564
|
+
return __spreadArray(__spreadArray([], __read(deduped), false), [record], false).slice(-limit);
|
|
565
|
+
}
|
|
566
|
+
function recoveryExecutionPhaseForDispatch(dispatchAction) {
|
|
567
|
+
var map = {
|
|
568
|
+
run_evidence_probe: 'evidence',
|
|
569
|
+
run_read_only_diagnosis: 'diagnosis',
|
|
570
|
+
run_infra_repair: 'infra',
|
|
571
|
+
run_compile_repair: 'compile',
|
|
572
|
+
run_journey_contract_repair: 'journey',
|
|
573
|
+
run_business_assertion_repair: 'business_proof',
|
|
574
|
+
run_release_repair: 'release',
|
|
575
|
+
run_targeted_product_repair: 'product_repair',
|
|
576
|
+
advance: 'advance',
|
|
577
|
+
continue_gate: 'advance',
|
|
578
|
+
park_manual: 'manual'
|
|
579
|
+
};
|
|
580
|
+
return map[dispatchAction] || 'manual';
|
|
581
|
+
}
|
|
582
|
+
function recoveryDirectiveReason(action, decision, current) {
|
|
583
|
+
var blocker = cleanText((current === null || current === void 0 ? void 0 : current.blocker) || (current === null || current === void 0 ? void 0 : current.summary) || '', 260);
|
|
584
|
+
var label = cleanText(action === null || action === void 0 ? void 0 : action.label, 120) || decision.dispatchAction;
|
|
585
|
+
var objective = cleanText(action === null || action === void 0 ? void 0 : action.objective, 260);
|
|
586
|
+
return [
|
|
587
|
+
"MANAGER_RECOVERY:".concat(decision.dispatchAction),
|
|
588
|
+
"label=".concat(label),
|
|
589
|
+
decision.reason ? "reason=".concat(decision.reason) : '',
|
|
590
|
+
blocker ? "blocker=".concat(blocker) : '',
|
|
591
|
+
objective ? "objective=".concat(objective) : ''
|
|
592
|
+
].filter(Boolean).join(' | ');
|
|
593
|
+
}
|
|
594
|
+
function buildResolveIOAIManagerRecoveryExecutionDirective(input) {
|
|
595
|
+
var _a, _b, _c, _d;
|
|
596
|
+
var action = input.action;
|
|
597
|
+
var dispatchDecision = input.dispatchDecision || decideResolveIOAIManagerRecoveryActionDispatch({
|
|
598
|
+
action: action,
|
|
599
|
+
current: input.current,
|
|
600
|
+
now: input.now
|
|
601
|
+
});
|
|
602
|
+
var dispatchAction = dispatchDecision.dispatchAction;
|
|
603
|
+
var now = isoNow(input.now);
|
|
604
|
+
var phase = recoveryExecutionPhaseForDispatch(dispatchAction);
|
|
605
|
+
var lane = cleanText((action === null || action === void 0 ? void 0 : action.lane) || ((_a = input.current) === null || _a === void 0 ? void 0 : _a.lane) || '', 120);
|
|
606
|
+
var stepType = cleanText((action === null || action === void 0 ? void 0 : action.stepType) || ((_b = input.current) === null || _b === void 0 ? void 0 : _b.stepType) || '', 120);
|
|
607
|
+
var rerunReason = recoveryDirectiveReason(action, dispatchDecision, input.current);
|
|
608
|
+
var surface = cleanText(input.surface || 'runner', 120);
|
|
609
|
+
return __assign(__assign({ directiveId: stableHash('mgr-directive', {
|
|
610
|
+
surface: surface,
|
|
611
|
+
actionId: (action === null || action === void 0 ? void 0 : action.actionId) || '',
|
|
612
|
+
dispatchAction: dispatchAction,
|
|
613
|
+
reason: dispatchDecision.reason,
|
|
614
|
+
evidenceHash: ((_c = dispatchDecision.dispatchRecord) === null || _c === void 0 ? void 0 : _c.evidenceHash) || ((_d = input.current) === null || _d === void 0 ? void 0 : _d.evidenceHash) || ''
|
|
615
|
+
}), surface: surface, dispatchAction: dispatchAction, phase: phase, allowed: dispatchDecision.allowed, status: dispatchDecision.status, reason: dispatchDecision.reason, lane: lane, stepType: stepType, nextActionLabel: cleanText(action === null || action === void 0 ? void 0 : action.label, 160) || dispatchAction, rerunReason: rerunReason, evidenceOnly: (action === null || action === void 0 ? void 0 : action.evidenceOnly) !== false || dispatchAction === 'run_evidence_probe', autoRunnable: (action === null || action === void 0 ? void 0 : action.autoRunnable) === true, productRepairAllowed: (action === null || action === void 0 ? void 0 : action.productRepairAllowed) === true, expensiveModelAllowed: (action === null || action === void 0 ? void 0 : action.expensiveModelAllowed) === true, canRunProductRepair: dispatchDecision.canRunProductRepair, canRunExpensiveModel: dispatchDecision.canRunExpensiveModel, canResetLoopAfterEvidence: (action === null || action === void 0 ? void 0 : action.canResetLoopAfterEvidence) === true, requiresNewEvidence: dispatchDecision.requiresNewEvidence, newEvidence: dispatchDecision.newEvidence, maxAttemptsBeforePark: Math.max(1, Number((action === null || action === void 0 ? void 0 : action.maxAttemptsBeforePark) || 1) || 1), requiredArtifacts: cleanList(action === null || action === void 0 ? void 0 : action.requiredArtifacts, 20, 500), nextCommands: cleanList(action === null || action === void 0 ? void 0 : action.nextCommands, 20, 500), successCriteria: cleanList(action === null || action === void 0 ? void 0 : action.successCriteria, 20, 500), forbiddenActions: (action === null || action === void 0 ? void 0 : action.productRepairAllowed) === true
|
|
616
|
+
? []
|
|
617
|
+
: ['Do not run product-code repair from this directive unless canRunProductRepair is true.'] }, (dispatchDecision.dispatchRecord ? { dispatchRecord: dispatchDecision.dispatchRecord } : {})), { createdAt: now });
|
|
618
|
+
}
|
|
619
|
+
function listHasNewEntry(current, previous) {
|
|
620
|
+
var existing = new Set(previous.map(function (entry) { return cleanText(entry, 500); }).filter(Boolean));
|
|
621
|
+
return current.some(function (entry) {
|
|
622
|
+
var normalized = cleanText(entry, 500);
|
|
623
|
+
return !!normalized && !existing.has(normalized);
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
function proposedActionIsProductRepair(value) {
|
|
627
|
+
var normalized = cleanText(value, 120);
|
|
628
|
+
return /product|code|repair|build|business|journey|workflow/i.test(normalized)
|
|
629
|
+
&& !/infra|compile|diagnosis|manual|evidence|release|publish/i.test(normalized);
|
|
630
|
+
}
|
|
631
|
+
function decideResolveIOAIManagerRecoveryGate(input) {
|
|
632
|
+
var checkpoint = input.checkpoint;
|
|
633
|
+
var hasCurrent = !!input.current;
|
|
634
|
+
var current = input.current || {};
|
|
635
|
+
var blockerFingerprint = hasCurrent
|
|
636
|
+
? resolveResolveIOAIManagerBlockerFingerprint(current, checkpoint.objective)
|
|
637
|
+
: checkpoint.blockerFingerprint;
|
|
638
|
+
var evidenceHash = hasCurrent ? hashResolveIOAIManagerEvidence(current) : checkpoint.evidenceHash;
|
|
639
|
+
var changedFiles = hasCurrent ? cleanList(current.changedFiles, 80, 500) : checkpoint.changedFiles;
|
|
640
|
+
var artifactPaths = hasCurrent ? cleanList(current.artifactPaths, 80, 500) : checkpoint.artifactPaths;
|
|
641
|
+
var evidenceChanged = evidenceHash !== checkpoint.evidenceHash
|
|
642
|
+
|| blockerFingerprint !== checkpoint.blockerFingerprint
|
|
643
|
+
|| listHasNewEntry(changedFiles, checkpoint.changedFiles)
|
|
644
|
+
|| listHasNewEntry(artifactPaths, checkpoint.artifactPaths);
|
|
645
|
+
var proposedAction = cleanText(input.proposedAction || checkpoint.allowedAction, 120);
|
|
646
|
+
var productRepairRequested = proposedActionIsProductRepair(proposedAction);
|
|
647
|
+
var missingEvidence = checkpoint.requiredEvidence.filter(function (required) {
|
|
648
|
+
var normalized = cleanText(required, 120).toLowerCase();
|
|
649
|
+
if (!normalized) {
|
|
650
|
+
return false;
|
|
651
|
+
}
|
|
652
|
+
if (/artifact|log|proof|gate|evidence/.test(normalized)) {
|
|
653
|
+
return !artifactPaths.length && !current.evidenceHash;
|
|
654
|
+
}
|
|
655
|
+
if (/diff|changed files|owner|scope|file/.test(normalized)) {
|
|
656
|
+
return !changedFiles.length;
|
|
657
|
+
}
|
|
658
|
+
return false;
|
|
659
|
+
});
|
|
660
|
+
var makeDecision = function (action, reason, overrides) {
|
|
661
|
+
if (overrides === void 0) { overrides = {}; }
|
|
662
|
+
return (__assign({ action: action, reason: reason, canRunProductRepair: checkpoint.productRepairAllowed, canRunExpensiveModel: checkpoint.expensiveModelAllowed, shouldResetLoopBudget: false, shouldIncrementAttempt: action === 'allow', newEvidence: evidenceChanged, blockerFingerprint: blockerFingerprint, evidenceHash: evidenceHash, missingEvidence: missingEvidence, checkpoint: __assign(__assign({}, checkpoint), { updatedAt: isoNow(input.now) }) }, overrides));
|
|
663
|
+
};
|
|
664
|
+
if (checkpoint.status === 'complete') {
|
|
665
|
+
return makeDecision('complete', 'recovery_gate_checkpoint_already_complete', {
|
|
666
|
+
canRunProductRepair: false,
|
|
667
|
+
canRunExpensiveModel: false,
|
|
668
|
+
shouldIncrementAttempt: false
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
if (checkpoint.status === 'manual_handoff' && input.operatorApproved !== true) {
|
|
672
|
+
return makeDecision('manual_handoff', 'recovery_gate_manual_handoff_requires_operator_approval', {
|
|
673
|
+
canRunProductRepair: false,
|
|
674
|
+
canRunExpensiveModel: false,
|
|
675
|
+
shouldIncrementAttempt: false
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
if (productRepairRequested && !checkpoint.productRepairAllowed) {
|
|
679
|
+
return makeDecision('reject_action', 'recovery_gate_product_repair_not_allowed_for_checkpoint', {
|
|
680
|
+
canRunProductRepair: false,
|
|
681
|
+
canRunExpensiveModel: false,
|
|
682
|
+
shouldIncrementAttempt: false
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
if (checkpoint.status === 'parked' && !evidenceChanged) {
|
|
686
|
+
return makeDecision('collect_new_evidence', 'recovery_gate_parked_until_new_evidence', {
|
|
687
|
+
canRunProductRepair: false,
|
|
688
|
+
canRunExpensiveModel: false,
|
|
689
|
+
shouldIncrementAttempt: false
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
if (checkpoint.attempts >= checkpoint.maxAttemptsBeforePark && !evidenceChanged) {
|
|
693
|
+
return makeDecision('collect_new_evidence', 'recovery_gate_attempt_limit_requires_new_evidence', {
|
|
694
|
+
canRunProductRepair: false,
|
|
695
|
+
canRunExpensiveModel: false,
|
|
696
|
+
shouldIncrementAttempt: false
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
if (evidenceChanged) {
|
|
700
|
+
var currentFailureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);
|
|
701
|
+
var currentCanRunProductRepair = checkpoint.productRepairAllowed
|
|
702
|
+
|| !/^(infra|compile|diagnosis|release)$/i.test(currentFailureClass);
|
|
703
|
+
return makeDecision('allow', 'recovery_gate_new_evidence_unblocks_retry', {
|
|
704
|
+
canRunProductRepair: currentCanRunProductRepair,
|
|
705
|
+
canRunExpensiveModel: checkpoint.expensiveModelAllowed || currentCanRunProductRepair,
|
|
706
|
+
shouldResetLoopBudget: true
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
return makeDecision('allow', 'recovery_gate_action_allowed');
|
|
710
|
+
}
|
|
711
|
+
function failureKey(record) {
|
|
712
|
+
if (!record) {
|
|
713
|
+
return '';
|
|
714
|
+
}
|
|
715
|
+
var failureClass = normalizeResolveIOAIManagerFailureClass(record.failureClass);
|
|
716
|
+
var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(record);
|
|
717
|
+
return "".concat(cleanText(record.lane, 80), ":").concat(cleanText(record.stepType, 80), ":").concat(failureClass, ":").concat(blockerFingerprint);
|
|
718
|
+
}
|
|
719
|
+
function failureEvidenceKey(record) {
|
|
720
|
+
return "".concat(failureKey(record), ":").concat(hashResolveIOAIManagerEvidence(record));
|
|
721
|
+
}
|
|
722
|
+
function isPassingOutcome(record) {
|
|
723
|
+
return /^(pass|accepted|ready_to_publish|published|ready_for_merge|complete|completed)$/i.test(cleanText(record === null || record === void 0 ? void 0 : record.outcome, 80));
|
|
724
|
+
}
|
|
725
|
+
function isManualOutcome(record) {
|
|
726
|
+
return /^(manual_handoff|park_manual|stopped)$/i.test(cleanText(record === null || record === void 0 ? void 0 : record.outcome, 80));
|
|
727
|
+
}
|
|
728
|
+
function buildResolveIOAIManagerRecoveryPlan(input) {
|
|
729
|
+
if (input === void 0) { input = {}; }
|
|
730
|
+
var action = cleanText(input.action, 80) || 'continue';
|
|
731
|
+
var reason = cleanText(input.reason, 240);
|
|
732
|
+
var failureClass = normalizeResolveIOAIManagerFailureClass(input.failureClass);
|
|
733
|
+
var lane = cleanText(input.lane, 80) || 'supervisor';
|
|
734
|
+
var stepType = cleanText(input.stepType, 80) || 'unknown';
|
|
735
|
+
var blocker = cleanText(input.blocker, 700);
|
|
736
|
+
var changedFiles = cleanList(input.changedFiles, 12, 240);
|
|
737
|
+
var artifactPaths = cleanList(input.artifactPaths, 12, 240);
|
|
738
|
+
var maxAttemptsBeforePark = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);
|
|
739
|
+
var commonNotes = [
|
|
740
|
+
reason ? "policy_reason=".concat(reason) : '',
|
|
741
|
+
blocker ? "blocker=".concat(blocker) : '',
|
|
742
|
+
changedFiles.length ? "changed_files=".concat(changedFiles.join(', ')) : '',
|
|
743
|
+
artifactPaths.length ? "artifacts=".concat(artifactPaths.join(', ')) : ''
|
|
744
|
+
].filter(Boolean);
|
|
745
|
+
var base = {
|
|
746
|
+
lane: lane,
|
|
747
|
+
stepType: stepType,
|
|
748
|
+
maxAttemptsBeforePark: maxAttemptsBeforePark,
|
|
749
|
+
notes: commonNotes
|
|
750
|
+
};
|
|
751
|
+
var makePlan = function (recoveryClass, nextActionLabel, objective, allowedAction, productRepairAllowed, expensiveModelAllowed, finiteSteps, requiredEvidence, loopResetEvidence, forbiddenActions) { return (__assign(__assign({}, base), { recoveryClass: recoveryClass, nextActionLabel: nextActionLabel, objective: objective, allowedAction: allowedAction, productRepairAllowed: productRepairAllowed, expensiveModelAllowed: expensiveModelAllowed, finiteSteps: finiteSteps, requiredEvidence: requiredEvidence, loopResetEvidence: loopResetEvidence, forbiddenActions: forbiddenActions })); };
|
|
752
|
+
if (action === 'reset_loop_budget') {
|
|
753
|
+
return makePlan('advance_after_proof', 'Advance After Proof', 'Checkpoint the passing evidence and move to the next required gate.', 'advance_to_next_gate', false, false, [
|
|
754
|
+
'Record the passing artifact, changed files, and gate result.',
|
|
755
|
+
'Reset the loop counter because a real gate passed.',
|
|
756
|
+
'Select the next unmet deterministic gate instead of repeating the previous repair.'
|
|
757
|
+
], ['passing gate record', 'artifact or log proving the passed check'], ['new passing gate result', 'new business proof artifact'], ['rerun the same repair after a pass', 'mark accepted without the required downstream gate']);
|
|
758
|
+
}
|
|
759
|
+
if (action === 'manual_handoff') {
|
|
760
|
+
return makePlan('manual_handoff', 'Manual Review', 'Stop autonomous repair and expose the blocker, evidence, and last safe state.', 'manual_review_only', false, false, [
|
|
761
|
+
'Freeze further product-code edits.',
|
|
762
|
+
'Show the blocker fingerprint, evidence hash, and prior attempts.',
|
|
763
|
+
'Require a human edit to classification, scope, or retry policy before another model/code loop.'
|
|
764
|
+
], ['blocker fingerprint', 'evidence hash', 'attempt history'], ['manual policy change', 'new external evidence'], ['start another automatic model repair', 'hide the failed evidence']);
|
|
765
|
+
}
|
|
766
|
+
if (action === 'budget_stop') {
|
|
767
|
+
return makePlan('manual_handoff', 'Budget Stop Review', 'Stop autonomous model/code loops until a cheaper scoped next action is selected.', 'budget_review_only', false, false, [
|
|
768
|
+
'Freeze further model repair loops.',
|
|
769
|
+
'Show the prompt/token/runtime budget that tripped the guard.',
|
|
770
|
+
'Select a cheaper deterministic gate, infra repair, diagnosis revision, or manual scope edit before resuming.'
|
|
771
|
+
], ['budget guard reason', 'latest prompt estimate', 'last blocker/evidence hash'], ['manual scope reduction', 'new deterministic evidence', 'approved budget policy change'], ['start another broad model prompt', 'reset budget without new evidence', 'hide cost context']);
|
|
772
|
+
}
|
|
773
|
+
if (failureClass === 'diagnosis' || stepType === 'diagnosis_gate') {
|
|
774
|
+
return makePlan('diagnosis_only', 'Run Diagnosis Gate', 'Produce a falsifiable root-cause diagnosis before any repair.', 'read_only_diagnosis', false, true, [
|
|
775
|
+
'Reproduce or explicitly classify the customer issue.',
|
|
776
|
+
'Accept one falsifiable hypothesis and record rejected alternatives.',
|
|
777
|
+
'Identify the frontend/backend/shared failing path.',
|
|
778
|
+
'Select a small owner_files set.',
|
|
779
|
+
'Define exact before/action/after business proof.'
|
|
780
|
+
], ['issue_case', 'accepted_hypothesis', 'rejected_alternatives', 'failing_path', 'owner_files', 'proof_plan'], ['new reproduction artifact', 'new query/log/code evidence', 'validated diagnosis gate'], ['edit product code', 'run broad repo repair', 'accept route-load evidence as success']);
|
|
781
|
+
}
|
|
782
|
+
if (failureClass === 'owner_scope' || failureClass === 'out_of_scope' || /out.?of.?scope|owner_files/i.test(reason)) {
|
|
783
|
+
return makePlan('diagnosis_revision', 'Revise Diagnosis Scope', 'Revise owner_files only when new evidence proves the current scope is wrong.', 'diagnosis_revision_only', false, true, [
|
|
784
|
+
'Compare changed files against the diagnosis owner_files.',
|
|
785
|
+
'Collect evidence proving why the new file is in the failing path.',
|
|
786
|
+
'Update accepted_hypothesis, failing_path, owner_files, and proof_plan together.',
|
|
787
|
+
'Resume repair only after the revised gate validates.'
|
|
788
|
+
], ['out-of-scope file list', 'new failing-path evidence', 'revalidated diagnosis gate'], ['revised owner_files with evidence', 'new business proof requirement'], ['keep broad edits without diagnosis', 'add convenience refactors', 'continue repair outside owner_files']);
|
|
789
|
+
}
|
|
790
|
+
if (action === 'retry_infra') {
|
|
791
|
+
var isCompile = failureClass === 'compile';
|
|
792
|
+
return makePlan(isCompile ? 'compile_repair' : 'infra_repair', isCompile ? 'Repair Compile Gate' : 'Repair Infra Gate', isCompile
|
|
793
|
+
? 'Fix the deterministic compile/build blocker before spending another product repair loop.'
|
|
794
|
+
: 'Fix the deterministic harness/browser/server/Mongo blocker before product repair.', isCompile ? 'compile_repair_only' : 'infra_repair_only', false, false, isCompile
|
|
795
|
+
? [
|
|
796
|
+
'Read the exact compile/build log and identify the first actionable error.',
|
|
797
|
+
'Fix missing dependency, stale artifact, command, cache, or type wiring required by the compile gate.',
|
|
798
|
+
'Rerun the same finite compile command.',
|
|
799
|
+
'Return the compile log artifact and status.'
|
|
800
|
+
]
|
|
801
|
+
: [
|
|
802
|
+
'Run preflight for Puppeteer, Chrome executable, ports, Mongo/settings, and startup command.',
|
|
803
|
+
'Repair only the failing harness/environment item.',
|
|
804
|
+
'Rerun the same infra check.',
|
|
805
|
+
'Return the infra log and pass/fail status.'
|
|
806
|
+
], isCompile
|
|
807
|
+
? ['compile command', 'compile log artifact', 'first failing error fixed or still failing']
|
|
808
|
+
: ['preflight command', 'infra log artifact', 'specific repaired environment item'], ['same check now passes', 'new infra/compile blocker hash'], ['run product-code model repair', 'count this as product failure', 'accept route/business success without the compile/infra gate']);
|
|
809
|
+
}
|
|
810
|
+
if (action === 'park_repeated_failure' || action === 'park_ping_pong') {
|
|
811
|
+
return makePlan('blocked_until_new_evidence', action === 'park_ping_pong' ? 'Park Ping-Pong Loop' : 'Park Repeated Failure', 'Stop the current loop until new evidence changes the diagnosis, route, or repair target.', 'collect_new_evidence_only', false, false, [
|
|
812
|
+
'Do not rerun the same prompt or same repair.',
|
|
813
|
+
'Show the repeated blocker and evidence hash.',
|
|
814
|
+
'Collect a new artifact: failing DOM state, stack trace, network response, Mongo delta, compile log, or revised diagnosis.',
|
|
815
|
+
'Reset the loop only after the new evidence hash changes.'
|
|
816
|
+
], ['same failure count', 'blocker fingerprint', 'evidence hash'], ['changed evidence hash', 'new artifact path', 'revised diagnosis or journey contract'], ['alternate between two failed patches', 'increase loop budget without evidence', 'hide the park reason']);
|
|
817
|
+
}
|
|
818
|
+
if (failureClass === 'journey') {
|
|
819
|
+
return makePlan('journey_contract_repair', 'Repair Journey Contract', 'Fix the first/next/last workflow contract before app code work continues.', 'journey_contract_repair', false, true, [
|
|
820
|
+
'Open docs/APP_JOURNEY_CONTRACT.md.',
|
|
821
|
+
'Define first_screen, north_star_workflow, screen_sequence, data_story, completion_states, and qa_assertions.',
|
|
822
|
+
'Ensure each CTA maps to an action, route, method, calculation, or state transition.',
|
|
823
|
+
'Validate that sample data can drive the promised workflow.'
|
|
824
|
+
], ['validated journey_contract JSON', 'CTA-to-action mapping', 'workflow QA assertions'], ['journey validation passes', 'new workflow QA rows generated'], ['build empty routes', 'add link-only dashboard actions', 'defer workflow design to wow pass']);
|
|
825
|
+
}
|
|
826
|
+
if (failureClass === 'release') {
|
|
827
|
+
return makePlan('release_repair', 'Repair Release Gate', 'Repair deploy/publish/sample-data release evidence without rewriting working app flow.', 'release_repair_only', false, false, [
|
|
828
|
+
'Read the deploy/publish/sample-data log.',
|
|
829
|
+
'Identify whether the blocker is domain, asset, seed data, route, permission, or CDN.',
|
|
830
|
+
'Repair the release artifact/config/seed issue.',
|
|
831
|
+
'Rerun only the failed release gate.'
|
|
832
|
+
], ['deploy or publish log', 'sample-data status', 'failed release gate rerun'], ['release gate passes', 'new release blocker hash'], ['change core workflow after business QA passed', 'mark accepted from scorecard only', 'rerun full builder loop']);
|
|
833
|
+
}
|
|
834
|
+
if (failureClass === 'business' || failureClass === 'qa_evidence' || failureClass === 'route') {
|
|
835
|
+
return makePlan('business_proof_repair', 'Repair Business Proof', 'Fix the exact failing workflow assertion and prove before/action/after behavior.', 'business_repair', true, true, [
|
|
836
|
+
'Open the failing QA row or proof_plan.',
|
|
837
|
+
'Trace the UI action to method/publication/query/calculation.',
|
|
838
|
+
'Patch the smallest owner or workflow files.',
|
|
839
|
+
'Rerun only the failed business assertion.',
|
|
840
|
+
'Record DOM/data/Mongo/artifact proof.'
|
|
841
|
+
], ['failing assertion', 'action trace', 'business proof artifact'], ['business assertion passes', 'new failed assertion with new evidence'], ['treat route load as success', 'rerun unrelated QA rows first', 'accept scorecard-only evidence']);
|
|
842
|
+
}
|
|
843
|
+
if (input.productRepairFailure !== false || failureClass === 'product_code') {
|
|
844
|
+
return makePlan('product_code_repair', 'Run Targeted Product Repair', 'Repair the current product-code blocker with the smallest scoped edit and immediate proof.', 'targeted_product_repair', true, true, [
|
|
845
|
+
'Inspect the current blocker, artifacts, changed files, and owner/workflow scope.',
|
|
846
|
+
'Form one small repair hypothesis.',
|
|
847
|
+
'Patch only files justified by the active diagnosis or journey contract.',
|
|
848
|
+
'Rerun the smallest failed gate.',
|
|
849
|
+
'Record new evidence before any additional loop.'
|
|
850
|
+
], ['owner/workflow scope', 'repair diff', 'failed gate rerun artifact'], ['new evidence hash', 'same gate passes'], ['broad repo search-and-edit', 'rerun the same prompt without inspecting artifacts', 'change unrelated UI polish']);
|
|
851
|
+
}
|
|
852
|
+
return makePlan('continue', 'Continue Current Gate', 'Continue the current lane because no blocking loop or infra condition was detected.', 'continue', false, false, [
|
|
853
|
+
'Use the active lane memory.',
|
|
854
|
+
'Run the next finite gate.',
|
|
855
|
+
'Record artifacts and evidence hash.'
|
|
856
|
+
], ['active lane memory', 'finite gate artifact'], ['new gate result', 'new artifact path'], ['spawn duplicate runners', 'advance without evidence']);
|
|
857
|
+
}
|
|
858
|
+
function collectOpenTail(records) {
|
|
859
|
+
var tail = [];
|
|
860
|
+
for (var index = records.length - 1; index >= 0; index -= 1) {
|
|
861
|
+
var record = records[index];
|
|
862
|
+
if (isPassingOutcome(record)) {
|
|
863
|
+
break;
|
|
864
|
+
}
|
|
865
|
+
tail.unshift(record);
|
|
866
|
+
}
|
|
867
|
+
return tail;
|
|
868
|
+
}
|
|
869
|
+
function countSameFailure(records, current) {
|
|
870
|
+
var currentKey = failureEvidenceKey(current);
|
|
871
|
+
var count = 0;
|
|
872
|
+
for (var index = records.length - 1; index >= 0; index -= 1) {
|
|
873
|
+
var record = records[index];
|
|
874
|
+
if (isPassingOutcome(record)) {
|
|
875
|
+
break;
|
|
876
|
+
}
|
|
877
|
+
if (failureEvidenceKey(record) !== currentKey) {
|
|
878
|
+
break;
|
|
879
|
+
}
|
|
880
|
+
count += 1;
|
|
881
|
+
}
|
|
882
|
+
return count;
|
|
883
|
+
}
|
|
884
|
+
function countPingPong(records, current) {
|
|
885
|
+
var tail = collectOpenTail(records).filter(function (record) {
|
|
886
|
+
return cleanText(record.lane, 80) === cleanText(current.lane, 80)
|
|
887
|
+
&& cleanText(record.stepType, 80) === cleanText(current.stepType, 80);
|
|
888
|
+
});
|
|
889
|
+
if (tail.length < 4) {
|
|
890
|
+
return 0;
|
|
891
|
+
}
|
|
892
|
+
var keys = tail.map(failureKey).filter(Boolean);
|
|
893
|
+
var last = keys.slice(-6);
|
|
894
|
+
if (last.length < 4) {
|
|
895
|
+
return 0;
|
|
896
|
+
}
|
|
897
|
+
var distinct = Array.from(new Set(last));
|
|
898
|
+
if (distinct.length !== 2) {
|
|
899
|
+
return 0;
|
|
900
|
+
}
|
|
901
|
+
for (var index = 2; index < last.length; index += 1) {
|
|
902
|
+
if (last[index] !== last[index - 2]) {
|
|
903
|
+
return 0;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return last.length - 1;
|
|
907
|
+
}
|
|
908
|
+
function decideResolveIOAIManagerPolicy(input) {
|
|
909
|
+
var history = Array.isArray(input.history) ? input.history : [];
|
|
910
|
+
var current = input.current || history[history.length - 1] || {};
|
|
911
|
+
var failureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);
|
|
912
|
+
var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current);
|
|
913
|
+
var evidenceHash = hashResolveIOAIManagerEvidence(current);
|
|
914
|
+
var previous = history.length > 1 ? history[history.length - 2] : undefined;
|
|
915
|
+
var previousSameFailure = previous && failureKey(previous) === failureKey(current);
|
|
916
|
+
var previousEvidenceHash = previousSameFailure ? hashResolveIOAIManagerEvidence(previous) : '';
|
|
917
|
+
var newEvidence = !!previousSameFailure && !!previousEvidenceHash && previousEvidenceHash !== evidenceHash;
|
|
918
|
+
var sameFailureCount = countSameFailure(history, current);
|
|
919
|
+
var pingPongCount = countPingPong(history, current);
|
|
920
|
+
var maxSameFailureRepeats = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);
|
|
921
|
+
var maxPingPongTransitions = Math.max(3, Number(input.maxPingPongTransitions || 3) || 3);
|
|
922
|
+
var infraClasses = new Set((input.infraFailureClasses || ['infra', 'compile']).map(normalizeResolveIOAIManagerFailureClass));
|
|
923
|
+
var ignoredClasses = new Set((input.ignoredFailureClasses || []).map(normalizeResolveIOAIManagerFailureClass));
|
|
924
|
+
var base = {
|
|
925
|
+
failureClass: failureClass,
|
|
926
|
+
blockerFingerprint: blockerFingerprint,
|
|
927
|
+
evidenceHash: evidenceHash,
|
|
928
|
+
sameFailureCount: sameFailureCount,
|
|
929
|
+
pingPongCount: pingPongCount,
|
|
930
|
+
newEvidence: newEvidence,
|
|
931
|
+
loopBudgetShouldReset: false,
|
|
932
|
+
productRepairFailure: !infraClasses.has(failureClass) && !ignoredClasses.has(failureClass)
|
|
933
|
+
};
|
|
934
|
+
var withPlan = function (action, reason, overrides) {
|
|
935
|
+
if (overrides === void 0) { overrides = {}; }
|
|
936
|
+
var merged = __assign(__assign({}, base), overrides);
|
|
937
|
+
var recoveryPlan = buildResolveIOAIManagerRecoveryPlan({
|
|
938
|
+
action: action,
|
|
939
|
+
reason: reason,
|
|
940
|
+
failureClass: merged.failureClass,
|
|
941
|
+
lane: current.lane,
|
|
942
|
+
stepType: current.stepType,
|
|
943
|
+
blocker: current.blocker || current.summary,
|
|
944
|
+
sameFailureCount: merged.sameFailureCount,
|
|
945
|
+
pingPongCount: merged.pingPongCount,
|
|
946
|
+
newEvidence: merged.newEvidence,
|
|
947
|
+
productRepairFailure: merged.productRepairFailure,
|
|
948
|
+
changedFiles: current.changedFiles,
|
|
949
|
+
artifactPaths: current.artifactPaths,
|
|
950
|
+
maxSameFailureRepeats: maxSameFailureRepeats
|
|
951
|
+
});
|
|
952
|
+
var recoveryCheckpoint = buildResolveIOAIManagerRecoveryCheckpoint({
|
|
953
|
+
plan: recoveryPlan,
|
|
954
|
+
current: current
|
|
955
|
+
});
|
|
956
|
+
var recoveryEvidenceProbe = buildResolveIOAIManagerRecoveryEvidenceProbe({
|
|
957
|
+
checkpoint: recoveryCheckpoint,
|
|
958
|
+
current: current
|
|
959
|
+
});
|
|
960
|
+
return __assign(__assign({}, merged), { action: action, reason: reason, recoveryPlan: recoveryPlan, recoveryCheckpoint: recoveryCheckpoint, recoveryEvidenceProbe: recoveryEvidenceProbe, recoveryAction: buildResolveIOAIManagerRecoveryActionPacket({
|
|
961
|
+
plan: recoveryPlan,
|
|
962
|
+
checkpoint: recoveryCheckpoint,
|
|
963
|
+
probe: recoveryEvidenceProbe,
|
|
964
|
+
current: current
|
|
965
|
+
}) });
|
|
966
|
+
};
|
|
967
|
+
if (isPassingOutcome(current)) {
|
|
968
|
+
return withPlan('reset_loop_budget', 'manager_policy_progress_passed', {
|
|
969
|
+
loopBudgetShouldReset: true,
|
|
970
|
+
productRepairFailure: false
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
if (isManualOutcome(current)) {
|
|
974
|
+
return withPlan('manual_handoff', 'manager_policy_manual_or_stopped');
|
|
975
|
+
}
|
|
976
|
+
if (pingPongCount >= maxPingPongTransitions) {
|
|
977
|
+
return withPlan('park_ping_pong', 'manager_policy_ping_pong_failure_loop');
|
|
978
|
+
}
|
|
979
|
+
if (sameFailureCount >= maxSameFailureRepeats && !newEvidence) {
|
|
980
|
+
return withPlan('park_repeated_failure', 'manager_policy_same_failure_without_new_evidence');
|
|
981
|
+
}
|
|
982
|
+
if (infraClasses.has(failureClass)) {
|
|
983
|
+
return withPlan('retry_infra', 'manager_policy_infra_failure_routes_to_infra_repair', {
|
|
984
|
+
productRepairFailure: false
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
if (newEvidence || !previousSameFailure) {
|
|
988
|
+
return withPlan('continue', newEvidence
|
|
989
|
+
? 'manager_policy_new_evidence_resets_loop_budget'
|
|
990
|
+
: 'manager_policy_new_failure_or_lane', {
|
|
991
|
+
loopBudgetShouldReset: true
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
return withPlan('continue', 'manager_policy_retry_below_repeat_limit');
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
//# sourceMappingURL=ai-runner-manager-policy.js.map
|