@resolveio/server-lib 22.3.197 → 22.3.199
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 +188 -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 +30 -0
- package/managers/openai-usage-ledger.manager.js +142 -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 +338 -0
- package/methods/ai-terminal.js +23454 -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 +30 -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 +109 -0
- package/util/ai-run-evidence-adapters.js +4410 -0
- package/util/ai-run-evidence-adapters.js.map +1 -0
- package/util/ai-run-evidence-dashboard.d.ts +88 -0
- package/util/ai-run-evidence-dashboard.js +343 -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 +1018 -0
- package/util/ai-run-evidence-eval.js.map +1 -0
- package/util/ai-run-evidence.d.ts +244 -0
- package/util/ai-run-evidence.js +852 -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 +210 -0
- package/util/ai-runner-manager-autopilot.js +642 -0
- package/util/ai-runner-manager-autopilot.js.map +1 -0
- package/util/ai-runner-manager-policy.d.ts +787 -0
- package/util/ai-runner-manager-policy.js +3342 -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 +424 -0
- package/util/aicoder-runner-v6.js +2325 -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 +1055 -0
- package/util/support-runner-v5.js +4808 -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 -131
- 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 -112
- 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 -23825
- 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 -56
- 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 -4642
- package/src/util/ai-run-evidence-dashboard.ts +0 -323
- package/src/util/ai-run-evidence-eval.ts +0 -1057
- package/src/util/ai-run-evidence.ts +0 -1185
- package/src/util/ai-runner-artifacts.ts +0 -586
- package/src/util/ai-runner-manager-autopilot.ts +0 -961
- package/src/util/ai-runner-manager-policy.ts +0 -4806
- 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 -2979
- 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 -6573
- 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 -3057
- package/tests/ai-manager-autopilot-snapshot.test.ts +0 -193
- package/tests/ai-manager-recovery-checkpoint.test.ts +0 -1287
- package/tests/ai-run-eval.test.ts +0 -132
- package/tests/ai-run-evidence.test.ts +0 -2129
- package/tests/ai-runner-contract.test.ts +0 -488
- package/tests/aicoder-runner-v6.test.ts +0 -751
- 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 -1473
- 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
|
@@ -1,2129 +0,0 @@
|
|
|
1
|
-
import * as assert from 'node:assert/strict';
|
|
2
|
-
import {
|
|
3
|
-
buildAIRun,
|
|
4
|
-
buildAIRunCost,
|
|
5
|
-
buildAIQaRun,
|
|
6
|
-
classifyAIRunOutcome,
|
|
7
|
-
normalizeOpenAIUsageRowsForCosting,
|
|
8
|
-
redactAIRunTrainingExample
|
|
9
|
-
} from '../src/util/ai-run-evidence';
|
|
10
|
-
import {
|
|
11
|
-
buildAICoderAIRunFromEvidence,
|
|
12
|
-
buildAssistantAIRunFromEvidence,
|
|
13
|
-
buildSupportAIRunFromEvidence
|
|
14
|
-
} from '../src/util/ai-run-evidence-adapters';
|
|
15
|
-
import {
|
|
16
|
-
classifyAIRunFailureClass,
|
|
17
|
-
decideAIRunRetry
|
|
18
|
-
} from '../src/util/ai-run-evidence-eval';
|
|
19
|
-
import { estimateOpenAIUsageCost } from '../src/util/openai-usage-cost';
|
|
20
|
-
|
|
21
|
-
const routeOnlyQa = buildAIQaRun({
|
|
22
|
-
infraChecks: [
|
|
23
|
-
{ name: 'puppeteer_require', status: 'pass' },
|
|
24
|
-
{ name: 'chrome_executable', status: 'pass' }
|
|
25
|
-
],
|
|
26
|
-
compile: { status: 'pass', artifactPath: '.build-output/build-client.log' },
|
|
27
|
-
routeProbes: [{
|
|
28
|
-
route: '/billing/dashboard',
|
|
29
|
-
status: 'pass',
|
|
30
|
-
screenshot: 'qa-artifacts/route-ready.jpg',
|
|
31
|
-
caption: 'Route loaded.'
|
|
32
|
-
}]
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
assert.equal(routeOnlyQa.outcome, 'route_only_pass');
|
|
36
|
-
assert.equal(routeOnlyQa.gateResults.some((gate) => gate.key === 'qa_business_assertion' && gate.status === 'blocked'), true);
|
|
37
|
-
assert.equal(classifyAIRunOutcome({ qa: routeOnlyQa }).outcome, 'qa_incomplete');
|
|
38
|
-
assert.equal(classifyAIRunOutcome({ qa: routeOnlyQa, scorecardPassed: true }).outcome, 'false_pass');
|
|
39
|
-
|
|
40
|
-
const infraFailedQa = buildAIQaRun({
|
|
41
|
-
infraChecks: [
|
|
42
|
-
{ name: 'puppeteer_require', status: 'blocked', message: 'Unable to require puppeteer.' }
|
|
43
|
-
]
|
|
44
|
-
});
|
|
45
|
-
assert.equal(infraFailedQa.outcome, 'infra_failed');
|
|
46
|
-
assert.equal(classifyAIRunOutcome({ qa: infraFailedQa }).outcome, 'qa_infra_failed');
|
|
47
|
-
|
|
48
|
-
const compileFailedQa = buildAIQaRun({
|
|
49
|
-
infraChecks: [{ name: 'chrome_executable', status: 'pass' }],
|
|
50
|
-
compile: { status: 'stale', staleEvidence: true, artifactPath: '.build-output/build-client.log' }
|
|
51
|
-
});
|
|
52
|
-
assert.equal(compileFailedQa.outcome, 'compile_failed');
|
|
53
|
-
assert.equal(classifyAIRunOutcome({ qa: compileFailedQa }).outcome, 'build_failed');
|
|
54
|
-
|
|
55
|
-
const businessPassedQa = buildAIQaRun({
|
|
56
|
-
infraChecks: [{ name: 'chrome_launch', status: 'pass' }],
|
|
57
|
-
compile: { status: 'pass' },
|
|
58
|
-
routeProbes: [{ route: '/report', status: 'pass' }],
|
|
59
|
-
businessAssertions: [{
|
|
60
|
-
assertion: 'Report exports include seeded rows.',
|
|
61
|
-
status: 'pass',
|
|
62
|
-
dataProof: '3 seeded rows rendered and exported.',
|
|
63
|
-
artifactPaths: ['qa-artifacts/report-proof.json']
|
|
64
|
-
}]
|
|
65
|
-
});
|
|
66
|
-
assert.equal(businessPassedQa.outcome, 'business_assertion_passed');
|
|
67
|
-
assert.equal(classifyAIRunOutcome({
|
|
68
|
-
qa: businessPassedQa,
|
|
69
|
-
status: 'Passed',
|
|
70
|
-
phase: 'COMPLETE',
|
|
71
|
-
scorecardPassed: true,
|
|
72
|
-
deployStatus: 'pass',
|
|
73
|
-
publishStatus: 'published',
|
|
74
|
-
sampleDataStatus: 'pass'
|
|
75
|
-
}).outcome, 'accepted');
|
|
76
|
-
|
|
77
|
-
const releaseBlocked = classifyAIRunOutcome({
|
|
78
|
-
qa: businessPassedQa,
|
|
79
|
-
scorecardPassed: true,
|
|
80
|
-
deployStatus: 'Backend health smoke failed',
|
|
81
|
-
publishStatus: 'No such remote origin',
|
|
82
|
-
sampleDataStatus: 'empty collections detected'
|
|
83
|
-
});
|
|
84
|
-
assert.equal(releaseBlocked.outcome, 'release_blocked');
|
|
85
|
-
assert.ok(releaseBlocked.gates.some((gate) => gate.key === 'release' && gate.status === 'fail'));
|
|
86
|
-
|
|
87
|
-
const builtRun = buildAIRun({
|
|
88
|
-
source: 'aicoder_app',
|
|
89
|
-
sourceIds: { appId: 'app-1', jobId: 'job-1' },
|
|
90
|
-
title: 'Layflat Pressure Optimizer',
|
|
91
|
-
status: 'Passed',
|
|
92
|
-
phase: 'COMPLETE',
|
|
93
|
-
events: [],
|
|
94
|
-
qa: businessPassedQa,
|
|
95
|
-
scorecardPassed: true,
|
|
96
|
-
deployStatus: 'pass',
|
|
97
|
-
publishStatus: 'published',
|
|
98
|
-
sampleDataStatus: 'pass'
|
|
99
|
-
});
|
|
100
|
-
assert.equal(builtRun.outcome, 'accepted');
|
|
101
|
-
assert.equal(builtRun.sourceIds.appId, 'app-1');
|
|
102
|
-
|
|
103
|
-
const cost = buildAIRunCost([
|
|
104
|
-
{ model: 'gpt-5.3-codex', category: 'review', input_tokens: 1000, cached_input_tokens: 100, output_tokens: 250, cost_estimate: 1.23456789 },
|
|
105
|
-
{ model: 'gpt-5.4-mini', category: 'qa', inputTokens: 200, outputTokens: 50, estimatedUsd: 0.12 },
|
|
106
|
-
{
|
|
107
|
-
model: 'gpt-5.3-codex',
|
|
108
|
-
category: 'manual-monitoring',
|
|
109
|
-
usage_source: 'manual_codex',
|
|
110
|
-
usage_surface: 'aicoder',
|
|
111
|
-
cost_basis: 'manual_estimate',
|
|
112
|
-
is_manual: true,
|
|
113
|
-
is_untracked: true,
|
|
114
|
-
untracked_reason: 'Sidecar Codex session watched the Layflat builder.',
|
|
115
|
-
input_tokens: 3000,
|
|
116
|
-
output_tokens: 700,
|
|
117
|
-
cost_estimate: 7.5
|
|
118
|
-
}
|
|
119
|
-
]);
|
|
120
|
-
assert.equal(cost.inputTokens, 4200);
|
|
121
|
-
assert.equal(cost.cachedInputTokens, 100);
|
|
122
|
-
assert.equal(cost.outputTokens, 1000);
|
|
123
|
-
assert.equal(cost.categories.review.count, 1);
|
|
124
|
-
assert.deepEqual(cost.models, ['gpt-5.3-codex', 'gpt-5.4-mini']);
|
|
125
|
-
assert.equal(cost.sources?.manual_codex.estimatedUsd, 7.5);
|
|
126
|
-
assert.equal(cost.sources?.manual_codex.manualCount, 1);
|
|
127
|
-
assert.equal(cost.sources?.manual_codex.untrackedCount, 1);
|
|
128
|
-
assert.equal(cost.surfaces?.aicoder.estimatedUsd, 7.5);
|
|
129
|
-
assert.equal(cost.manualEstimatedUsd, 7.5);
|
|
130
|
-
assert.equal(cost.untrackedEstimatedUsd, 7.5);
|
|
131
|
-
assert.equal(cost.untrackedWarnings?.includes('Sidecar Codex session watched the Layflat builder.'), true);
|
|
132
|
-
|
|
133
|
-
const costOnlyManual = buildAIRunCost([
|
|
134
|
-
{
|
|
135
|
-
model: 'codex-manual',
|
|
136
|
-
category: 'manual-codex',
|
|
137
|
-
usage_source: 'manual_codex',
|
|
138
|
-
usage_surface: 'support',
|
|
139
|
-
cost_basis: 'manual_estimate',
|
|
140
|
-
is_manual: true,
|
|
141
|
-
is_untracked: true,
|
|
142
|
-
untracked_reason: 'Codex sidecar monitored support runner 004421.',
|
|
143
|
-
input_tokens: 0,
|
|
144
|
-
output_tokens: 0,
|
|
145
|
-
total_tokens: 0,
|
|
146
|
-
cost_estimate: 23.75
|
|
147
|
-
}
|
|
148
|
-
]);
|
|
149
|
-
assert.equal(costOnlyManual.totalTokens, 0);
|
|
150
|
-
assert.equal(costOnlyManual.estimatedUsd, 23.75);
|
|
151
|
-
assert.equal(costOnlyManual.manualEstimatedUsd, 23.75);
|
|
152
|
-
assert.equal(costOnlyManual.untrackedEstimatedUsd, 23.75);
|
|
153
|
-
assert.equal(costOnlyManual.sources?.manual_codex.count, 1);
|
|
154
|
-
assert.equal(costOnlyManual.surfaces?.support.estimatedUsd, 23.75);
|
|
155
|
-
|
|
156
|
-
const normalizedUsageRows = normalizeOpenAIUsageRowsForCosting([
|
|
157
|
-
{
|
|
158
|
-
model: 'gpt-5.5',
|
|
159
|
-
category: 'ai-dashboard-codex:master:file-body',
|
|
160
|
-
id_conversation: 'thread-1',
|
|
161
|
-
timestamp: '2026-06-13T10:00:00.000Z',
|
|
162
|
-
input_tokens: 1000,
|
|
163
|
-
cached_input_tokens: 800,
|
|
164
|
-
output_tokens: 100,
|
|
165
|
-
total_tokens: 1100,
|
|
166
|
-
cost_estimate: 1
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
model: 'gpt-5.5',
|
|
170
|
-
category: 'ai-dashboard-codex:master:file-body',
|
|
171
|
-
id_conversation: 'thread-1',
|
|
172
|
-
timestamp: '2026-06-13T10:01:00.000Z',
|
|
173
|
-
input_tokens: 1500,
|
|
174
|
-
cached_input_tokens: 1000,
|
|
175
|
-
output_tokens: 140,
|
|
176
|
-
total_tokens: 1640,
|
|
177
|
-
cost_estimate: 1.4
|
|
178
|
-
}
|
|
179
|
-
]);
|
|
180
|
-
assert.equal(normalizedUsageRows[1].input_tokens, 500);
|
|
181
|
-
assert.equal(normalizedUsageRows[1].cached_input_tokens, 200);
|
|
182
|
-
assert.equal(normalizedUsageRows[1].output_tokens, 40);
|
|
183
|
-
assert.equal(normalizedUsageRows[1].cost_estimate, 0.4);
|
|
184
|
-
|
|
185
|
-
const cumulativeCost = buildAIRunCost([
|
|
186
|
-
{
|
|
187
|
-
model: 'gpt-5.5',
|
|
188
|
-
category: 'ai-dashboard-codex:master:file-body',
|
|
189
|
-
id_conversation: 'thread-1',
|
|
190
|
-
timestamp: '2026-06-13T10:00:00.000Z',
|
|
191
|
-
input_tokens: 1000,
|
|
192
|
-
cached_input_tokens: 800,
|
|
193
|
-
output_tokens: 100,
|
|
194
|
-
total_tokens: 1100,
|
|
195
|
-
cost_estimate: 1
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
model: 'gpt-5.5',
|
|
199
|
-
category: 'ai-dashboard-codex:master:file-body',
|
|
200
|
-
id_conversation: 'thread-1',
|
|
201
|
-
timestamp: '2026-06-13T10:01:00.000Z',
|
|
202
|
-
input_tokens: 1500,
|
|
203
|
-
cached_input_tokens: 1000,
|
|
204
|
-
output_tokens: 140,
|
|
205
|
-
total_tokens: 1640,
|
|
206
|
-
cost_estimate: 1.4
|
|
207
|
-
}
|
|
208
|
-
]);
|
|
209
|
-
assert.equal(cumulativeCost.inputTokens, 1500);
|
|
210
|
-
assert.equal(cumulativeCost.cachedInputTokens, 1000);
|
|
211
|
-
assert.equal(cumulativeCost.outputTokens, 140);
|
|
212
|
-
assert.equal(cumulativeCost.estimatedUsd, 1.4);
|
|
213
|
-
assert.equal(estimateOpenAIUsageCost('gpt-5.4-2026-03-10', 1000, 100, 500), 0.002875);
|
|
214
|
-
assert.equal(estimateOpenAIUsageCost('gpt-5.3-codex', 1000, 100, 500), 0.00575);
|
|
215
|
-
assert.equal(estimateOpenAIUsageCost('gpt-5.4-codex', 1000, 100, 500), 0.002875);
|
|
216
|
-
assert.equal(estimateOpenAIUsageCost('codex-mini-latest', 1000, 100, 500), 0.000863);
|
|
217
|
-
|
|
218
|
-
const redacted = redactAIRunTrainingExample({
|
|
219
|
-
runId: 'run-1',
|
|
220
|
-
source: 'ai_assistant',
|
|
221
|
-
inputSummary: 'Mongo URL mongodb://user:password@host/db and email test@example.com',
|
|
222
|
-
actionSummary: 'Used key sk-12345678901234567890',
|
|
223
|
-
outcome: 'rejected',
|
|
224
|
-
evidence: ['ghp_12345678901234567890 appears here']
|
|
225
|
-
});
|
|
226
|
-
assert.match(redacted.inputSummary, /\[redacted-mongo-url\]/);
|
|
227
|
-
assert.match(redacted.inputSummary, /\[redacted-email\]/);
|
|
228
|
-
assert.match(redacted.actionSummary, /\[redacted-secret\]/);
|
|
229
|
-
assert.match(redacted.evidence[0], /\[redacted-secret\]/);
|
|
230
|
-
|
|
231
|
-
const supportRootCauseEntryContract = {
|
|
232
|
-
contract_id: 'support-root-cause-entry-test',
|
|
233
|
-
version: 'support_root_cause_entry_v1',
|
|
234
|
-
status: 'required',
|
|
235
|
-
required_output: {
|
|
236
|
-
object_key: 'support_diagnosis_gate',
|
|
237
|
-
status: 'passed',
|
|
238
|
-
required_fields: [
|
|
239
|
-
'issue_case',
|
|
240
|
-
'issue_class',
|
|
241
|
-
'accepted_hypothesis',
|
|
242
|
-
'rejected_alternatives',
|
|
243
|
-
'failing_path',
|
|
244
|
-
'owner_files',
|
|
245
|
-
'proof_plan',
|
|
246
|
-
'evidence'
|
|
247
|
-
]
|
|
248
|
-
},
|
|
249
|
-
owner_file_policy: {
|
|
250
|
-
max_files: 8,
|
|
251
|
-
exact_files_only: true,
|
|
252
|
-
edits_outside_owner_files_require_revised_diagnosis: true
|
|
253
|
-
},
|
|
254
|
-
business_proof_policy: {
|
|
255
|
-
requires_aiqa_business_assertion: true,
|
|
256
|
-
requires_before_action_after: true,
|
|
257
|
-
route_load_screenshot_scorecard_model_claim_not_acceptance: true,
|
|
258
|
-
required_artifacts: ['runner-evidence/diagnosis-gate.json', 'qa-artifacts/aiqa-business-assertion.json']
|
|
259
|
-
},
|
|
260
|
-
failure_policy: {
|
|
261
|
-
repeated_failure_without_new_evidence_parks_run: true,
|
|
262
|
-
infra_compile_puppeteer_startup_failures_route_to_infra_repair: true,
|
|
263
|
-
similar_tickets_and_commits_are_advisory_only: true
|
|
264
|
-
},
|
|
265
|
-
issue_class_probes: [
|
|
266
|
-
'no_op_submit',
|
|
267
|
-
'missing_wrong_data',
|
|
268
|
-
'filter_query_mismatch',
|
|
269
|
-
'invoice_pdf_export',
|
|
270
|
-
'upload_import',
|
|
271
|
-
'route_auth_hydration',
|
|
272
|
-
'slow_query_performance'
|
|
273
|
-
].map((issueClass) => ({
|
|
274
|
-
issue_class: issueClass,
|
|
275
|
-
required_paths: ['frontend_event', 'backend_method'],
|
|
276
|
-
required_evidence: ['before/action/after business state'],
|
|
277
|
-
false_pass_blockers: ['route loaded only']
|
|
278
|
-
}))
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const supportRun = buildSupportAIRunFromEvidence({
|
|
282
|
-
ticket: { _id: 'ticket-004421', ticketNumber: '004421', title: 'QA route only false pass' },
|
|
283
|
-
job: {
|
|
284
|
-
_id: 'support-job-1',
|
|
285
|
-
status: 'Running',
|
|
286
|
-
phase: 'QA',
|
|
287
|
-
supportRootCauseEntryContract,
|
|
288
|
-
supportV5DiagnosisGate: {
|
|
289
|
-
issue_case: {
|
|
290
|
-
customer_complaint: 'Support ticket list shows tickets from the wrong customer after applying a customer filter.',
|
|
291
|
-
expected_result: 'Only tickets for Customer B should appear when Customer B is selected.',
|
|
292
|
-
observed_result: 'A Customer A ticket remains visible while filtered to Customer B.',
|
|
293
|
-
route_module: '/support tickets list',
|
|
294
|
-
account_customer_context: 'Support admin reviewing ticket 004421 for Customer B.',
|
|
295
|
-
reproduction_status: 'reproduced'
|
|
296
|
-
},
|
|
297
|
-
issue_class: 'filter_query_mismatch',
|
|
298
|
-
status: 'passed',
|
|
299
|
-
accepted_hypothesis: {
|
|
300
|
-
statement: 'The ticket list query ignores the customer filter.',
|
|
301
|
-
falsifiable_test: 'Apply the Customer B filter and compare the returned rows with the persisted customer id for each ticket.',
|
|
302
|
-
evidence: ['QA artifact shows Customer A ticket visible while Customer B filter is active.']
|
|
303
|
-
},
|
|
304
|
-
rejected_alternatives: [
|
|
305
|
-
'Frontend select state was not the root cause because the network payload includes the selected Customer B filter.',
|
|
306
|
-
'Authentication was not the root cause because the affected support admin can load the ticket list route.'
|
|
307
|
-
],
|
|
308
|
-
failing_path: {
|
|
309
|
-
frontend: 'Support ticket customer filter submits selected customer id.',
|
|
310
|
-
backend: 'server/src/publications/support-tickets.ts ticket list publication',
|
|
311
|
-
data_query: 'Mongo ticket query does not constrain by selected customer id.',
|
|
312
|
-
description: 'Filter input reaches the backend, but the publication query returns rows outside the selected customer.'
|
|
313
|
-
},
|
|
314
|
-
owner_files: ['server/src/publications/support-tickets.ts'],
|
|
315
|
-
proof_plan: {
|
|
316
|
-
before: 'Customer A ticket appears while filtered to Customer B.',
|
|
317
|
-
action: 'Apply the Customer B filter and reload the ticket list.',
|
|
318
|
-
after: 'Only Customer B tickets are listed.',
|
|
319
|
-
business_assertion: 'The wrong-customer ticket is absent after filtering.',
|
|
320
|
-
data_assertion: 'Every returned ticket row has customerId equal to Customer B.',
|
|
321
|
-
artifact_expectation: 'QA stores before/action/after row snapshots and the filtered publication payload.',
|
|
322
|
-
business_proof_contract: {
|
|
323
|
-
issue_class: 'filter_query_mismatch',
|
|
324
|
-
setup_state: 'Seed or select one Customer A ticket and one Customer B ticket.',
|
|
325
|
-
action_under_test: 'Apply the Customer B filter on the support ticket list.',
|
|
326
|
-
expected_business_state_change: 'Rows outside Customer B are excluded while Customer B rows remain visible.',
|
|
327
|
-
prohibited_false_pass: 'Route load or non-empty table without row/customer proof.',
|
|
328
|
-
proof_artifacts: ['qa-artifacts/support-filter-before-after.json'],
|
|
329
|
-
data_or_dom_assertion: 'DOM rows and publication payload contain only Customer B ticket ids.'
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
evidence: [{
|
|
333
|
-
type: 'ticket',
|
|
334
|
-
summary: 'Ticket 004421 reports wrong-customer tickets appearing after a customer filter is applied.'
|
|
335
|
-
}, {
|
|
336
|
-
type: 'qa',
|
|
337
|
-
summary: 'Browser QA reproduced Customer A ticket visible while Customer B filter was active.',
|
|
338
|
-
artifactPath: 'qa-artifacts/support-filter-reproduction.json'
|
|
339
|
-
}, {
|
|
340
|
-
type: 'code',
|
|
341
|
-
summary: 'Publication owner file contains the query that returns support ticket rows.'
|
|
342
|
-
}]
|
|
343
|
-
},
|
|
344
|
-
supportV5AutonomousDecision: {
|
|
345
|
-
nextActionContract: {
|
|
346
|
-
contractId: 'support-next-action-safe-repair',
|
|
347
|
-
action: 'run_owner_scoped_repair',
|
|
348
|
-
label: 'Run owner-scoped repair',
|
|
349
|
-
primaryCommand: 'run_support_v5_owner_scoped_repair',
|
|
350
|
-
lane: 'build',
|
|
351
|
-
stepType: 'owner_scoped_repair',
|
|
352
|
-
safeToAutoRun: true,
|
|
353
|
-
requiresHumanApproval: false,
|
|
354
|
-
canRunWithoutCodexMonitor: true,
|
|
355
|
-
codexFallbackRequired: false,
|
|
356
|
-
rootCauseFirstSatisfied: true,
|
|
357
|
-
preconditions: ['SupportDiagnosisGate passed.'],
|
|
358
|
-
successEvidence: ['AIQaBusinessAssertion mapped to proof_plan.'],
|
|
359
|
-
stopConditions: ['Same failure class repeats without new evidence.'],
|
|
360
|
-
ownerFiles: ['server/src/publications/support-tickets.ts'],
|
|
361
|
-
decisionBasis: {
|
|
362
|
-
diagnosisValid: true,
|
|
363
|
-
ownerFilesReady: true,
|
|
364
|
-
proofPlanReady: true,
|
|
365
|
-
businessProofReady: false,
|
|
366
|
-
evidenceFreshnessStatus: 'fresh',
|
|
367
|
-
evidenceStrength: 'medium',
|
|
368
|
-
failureClass: 'product_code',
|
|
369
|
-
sameFailureCount: 0,
|
|
370
|
-
hotfixCommitRequired: true,
|
|
371
|
-
liveHotfixBlockedUntilCommit: false
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
taskEvents: [{ message: 'Route loaded in browser.', phase: 'qa' }],
|
|
377
|
-
usageLedger: [{
|
|
378
|
-
model: 'codex-manual',
|
|
379
|
-
category: 'manual-codex-monitor',
|
|
380
|
-
usage_source: 'manual_codex',
|
|
381
|
-
usage_surface: 'support',
|
|
382
|
-
cost_basis: 'manual_estimate',
|
|
383
|
-
is_manual: true,
|
|
384
|
-
is_untracked: true,
|
|
385
|
-
untracked_reason: 'Codex sidecar monitored support runner 004421.',
|
|
386
|
-
total_tokens: 0,
|
|
387
|
-
cost_estimate: 18.25
|
|
388
|
-
}],
|
|
389
|
-
qaEvidence: {
|
|
390
|
-
infraChecks: [{ name: 'puppeteer_require', status: 'pass' }],
|
|
391
|
-
compile: { status: 'pass' },
|
|
392
|
-
routeProbes: [{ route: '/support/004421', status: 'pass', screenshot: 'qa-artifacts/route.jpg' }],
|
|
393
|
-
hotfixEvidence: {
|
|
394
|
-
channel: 'backend_js',
|
|
395
|
-
target: {
|
|
396
|
-
host: 'backend.resolveio.com',
|
|
397
|
-
path: '/var/app/current/http/runner-manager-selftest.js'
|
|
398
|
-
},
|
|
399
|
-
compiledArtifactPath: 'dist/http/runner-manager-selftest.js',
|
|
400
|
-
remoteChecksumBefore: '1111111111111111111111111111111111111111111111111111111111111111',
|
|
401
|
-
remoteChecksumAfter: '2222222222222222222222222222222222222222222222222222222222222222',
|
|
402
|
-
sourceCommitSha: '6fd400e1d8c961c1e88820292c323e688fdcc0a4',
|
|
403
|
-
githubCommitUrl: 'https://github.com/resolveio/resolveio-all/commit/6fd400e1d8c961c1e88820292c323e688fdcc0a4',
|
|
404
|
-
gitCommitStatus: 'passed',
|
|
405
|
-
gitPushStatus: 'passed',
|
|
406
|
-
restartEvidence: 'nodejs restarted on all support hosts',
|
|
407
|
-
healthCheckStatus: 'passed',
|
|
408
|
-
selfTestStatus: 'passed'
|
|
409
|
-
},
|
|
410
|
-
scorecardPassed: true
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
assert.equal(supportRun.source, 'support_ticket');
|
|
414
|
-
assert.equal(supportRun.sourceIds.ticketNumber, '004421');
|
|
415
|
-
assert.equal(supportRun.outcome, 'false_pass');
|
|
416
|
-
assert.equal(supportRun.metadata?.diagnosis?.issueClass, 'filter_query_mismatch');
|
|
417
|
-
assert.equal(supportRun.metadata?.rootCauseEntryContract?.contractId, 'support-root-cause-entry-test');
|
|
418
|
-
assert.equal(supportRun.metadata?.rootCauseEntryContract?.issueClassProbeCount, 7);
|
|
419
|
-
assert.deepEqual(supportRun.metadata?.diagnosis?.ownerFiles, ['server/src/publications/support-tickets.ts']);
|
|
420
|
-
assert.equal(supportRun.events.some((event) => event.category === 'support_diagnosis_evidence_pack'), true);
|
|
421
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'support_diagnosis_evidence_pack' && gate.status === 'pass'), true);
|
|
422
|
-
assert.equal(supportRun.metadata?.diagnosisEvidencePack?.readOnly, true);
|
|
423
|
-
assert.equal(supportRun.metadata?.diagnosisEvidencePack?.sourceEditsAllowed, false);
|
|
424
|
-
assert.equal(supportRun.metadata?.diagnosisEvidencePack?.issueClassProbeCount, 7);
|
|
425
|
-
assert.equal(supportRun.events.some((event) => event.category === 'support_issue_class_probe_plan'), true);
|
|
426
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'support_issue_class_probe_plan' && gate.status === 'pass'), true);
|
|
427
|
-
assert.equal(supportRun.metadata?.issueClassProbePlan?.issueClassProbePlanReady, true);
|
|
428
|
-
assert.equal(supportRun.metadata?.issueClassProbePlan?.issueClass, 'filter_query_mismatch');
|
|
429
|
-
assert.equal(supportRun.events.some((event) => event.category === 'diagnosis_gate'), true);
|
|
430
|
-
assert.equal(supportRun.events.some((event) => event.category === 'support_root_cause_entry_contract'), true);
|
|
431
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'support_root_cause_entry_contract' && gate.status === 'pass'), true);
|
|
432
|
-
assert.equal(supportRun.events.some((event) => event.category === 'support_next_action_contract'), true);
|
|
433
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'support_next_action_contract' && gate.status === 'pass'), true);
|
|
434
|
-
assert.equal(supportRun.metadata?.nextActionContract?.canRunWithoutCodexMonitor, true);
|
|
435
|
-
assert.equal(supportRun.metadata?.nextActionContract?.hotfixCommitRequired, true);
|
|
436
|
-
assert.equal(supportRun.metadata?.nextActionContract?.liveHotfixBlockedUntilCommit, false);
|
|
437
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'cost_observability' && gate.status === 'warn'), true);
|
|
438
|
-
assert.equal(supportRun.metadata?.costObservability?.externalCodexMonitorUsed, true);
|
|
439
|
-
assert.equal(supportRun.metadata?.costObservability?.manualEstimatedUsd, 18.25);
|
|
440
|
-
assert.ok(supportRun.metadata?.costObservability?.warnings?.some((warning: string) => /support runner 004421/i.test(warning)));
|
|
441
|
-
assert.equal(supportRun.events.some((event) => event.type === 'hotfix' && event.category === 'backend_js'), true);
|
|
442
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'hotfix_evidence' && gate.status === 'pass'), true);
|
|
443
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'hotfix_commit_proof' && gate.status === 'pass'), true);
|
|
444
|
-
assert.equal(supportRun.events.some((event) => event.category === 'hotfix_commit_proof' && event.metadata?.passed === true), true);
|
|
445
|
-
assert.equal(supportRun.metadata?.hotfixDurability?.commitProofPassed, true);
|
|
446
|
-
assert.equal(supportRun.metadata?.hotfixDurability?.commitBlocked, false);
|
|
447
|
-
assert.equal(supportRun.gates.some((gate) => gate.key === 'qa_business_assertion' && gate.status === 'blocked'), true);
|
|
448
|
-
|
|
449
|
-
const supportRecoveryExecutionProofRun = buildSupportAIRunFromEvidence({
|
|
450
|
-
ticket: { _id: 'ticket-recovery-proof', ticketNumber: '004500', title: 'Recovery proof' },
|
|
451
|
-
job: {
|
|
452
|
-
_id: 'support-job-recovery-proof',
|
|
453
|
-
status: 'Running',
|
|
454
|
-
phase: 'REVIEW'
|
|
455
|
-
},
|
|
456
|
-
qaEvidence: {
|
|
457
|
-
managerRecoveryExecutionProof: {
|
|
458
|
-
contractId: 'mgr-execution-proof-1',
|
|
459
|
-
directiveId: 'mgr-directive-1',
|
|
460
|
-
surface: 'resolveio_support_runner',
|
|
461
|
-
dispatchAction: 'run_evidence_probe',
|
|
462
|
-
phase: 'evidence',
|
|
463
|
-
status: 'proof_ready',
|
|
464
|
-
canContinueRun: true,
|
|
465
|
-
canRunProductRepair: false,
|
|
466
|
-
canRunExpensiveModel: false,
|
|
467
|
-
canResetLoopBudget: true,
|
|
468
|
-
proofRequiredBeforeContinuation: true,
|
|
469
|
-
requiresNewEvidence: true,
|
|
470
|
-
newEvidence: true,
|
|
471
|
-
materialEvidence: true,
|
|
472
|
-
evidenceStrength: 'material',
|
|
473
|
-
evidenceSignals: ['evidence_hash_changed', 'artifact_paths_added'],
|
|
474
|
-
startingFailureClass: 'product_code',
|
|
475
|
-
startingBlockerFingerprint: 'before-fp',
|
|
476
|
-
startingEvidenceHash: 'before-hash',
|
|
477
|
-
latestFailureClass: 'product_code',
|
|
478
|
-
latestBlockerFingerprint: 'after-fp',
|
|
479
|
-
latestEvidenceHash: 'after-hash',
|
|
480
|
-
requiredEvidence: ['fresh issue-class probe artifact'],
|
|
481
|
-
missingEvidence: [],
|
|
482
|
-
artifactPaths: ['qa/recovery-after-dom-trace.json'],
|
|
483
|
-
changedFiles: [],
|
|
484
|
-
blockers: [],
|
|
485
|
-
nextAllowedAction: 'continue_gate',
|
|
486
|
-
forbiddenActions: ['Do not continue product-code repair until recovery execution proof is proof_ready.'],
|
|
487
|
-
createdAt: '2026-06-15T00:04:00.000Z'
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
const recoveryProofGate = supportRecoveryExecutionProofRun.gates.find((gate) => gate.key === 'manager_recovery_execution_proof');
|
|
492
|
-
assert.equal(recoveryProofGate?.status, 'pass');
|
|
493
|
-
assert.equal(supportRecoveryExecutionProofRun.events.some((event) => event.category === 'manager_recovery_execution_proof'), true);
|
|
494
|
-
assert.equal(supportRecoveryExecutionProofRun.metadata?.managerRecoveryExecutionProof?.canContinueRun, true);
|
|
495
|
-
assert.equal(supportRecoveryExecutionProofRun.metadata?.managerRecoveryExecutionProof?.canResetLoopBudget, true);
|
|
496
|
-
|
|
497
|
-
const supportBlockedRecoveryExecutionProofRun = buildSupportAIRunFromEvidence({
|
|
498
|
-
ticket: { _id: 'ticket-recovery-proof-blocked', ticketNumber: '004501', title: 'Recovery proof blocked' },
|
|
499
|
-
job: {
|
|
500
|
-
_id: 'support-job-recovery-proof-blocked',
|
|
501
|
-
status: 'Blocked',
|
|
502
|
-
phase: 'REVIEW',
|
|
503
|
-
managerRecoveryExecutionProof: {
|
|
504
|
-
contractId: 'mgr-execution-proof-2',
|
|
505
|
-
directiveId: 'mgr-directive-2',
|
|
506
|
-
surface: 'resolveio_support_runner',
|
|
507
|
-
dispatchAction: 'run_evidence_probe',
|
|
508
|
-
phase: 'evidence',
|
|
509
|
-
status: 'blocked_same_evidence',
|
|
510
|
-
canContinueRun: false,
|
|
511
|
-
canRunProductRepair: false,
|
|
512
|
-
canRunExpensiveModel: false,
|
|
513
|
-
canResetLoopBudget: false,
|
|
514
|
-
proofRequiredBeforeContinuation: true,
|
|
515
|
-
requiresNewEvidence: true,
|
|
516
|
-
newEvidence: false,
|
|
517
|
-
materialEvidence: false,
|
|
518
|
-
evidenceStrength: 'none',
|
|
519
|
-
evidenceSignals: [],
|
|
520
|
-
startingFailureClass: 'product_code',
|
|
521
|
-
startingBlockerFingerprint: 'same-fp',
|
|
522
|
-
startingEvidenceHash: 'same-hash',
|
|
523
|
-
latestFailureClass: 'product_code',
|
|
524
|
-
latestBlockerFingerprint: 'same-fp',
|
|
525
|
-
latestEvidenceHash: 'same-hash',
|
|
526
|
-
requiredEvidence: ['fresh issue-class probe artifact'],
|
|
527
|
-
missingEvidence: ['fresh issue-class probe artifact'],
|
|
528
|
-
artifactPaths: ['qa/recovery-before-dom-trace.json'],
|
|
529
|
-
changedFiles: [],
|
|
530
|
-
blockers: ['recovery_execution_same_evidence_after_dispatch'],
|
|
531
|
-
nextAllowedAction: 'collect_required_recovery_proof',
|
|
532
|
-
forbiddenActions: ['Do not continue product-code repair until recovery execution proof is proof_ready.'],
|
|
533
|
-
createdAt: '2026-06-15T00:05:00.000Z'
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
const blockedRecoveryProofGate = supportBlockedRecoveryExecutionProofRun.gates.find((gate) => gate.key === 'manager_recovery_execution_proof');
|
|
538
|
-
assert.equal(blockedRecoveryProofGate?.status, 'blocked');
|
|
539
|
-
assert.equal(supportBlockedRecoveryExecutionProofRun.metadata?.managerRecoveryExecutionProof?.canContinueRun, false);
|
|
540
|
-
assert.deepEqual(supportBlockedRecoveryExecutionProofRun.metadata?.managerRecoveryExecutionProof?.missingEvidence, ['fresh issue-class probe artifact']);
|
|
541
|
-
|
|
542
|
-
const supportAcceptedDiagnosisGate = {
|
|
543
|
-
issue_case: {
|
|
544
|
-
customer_complaint: 'Support ticket list shows tickets from the wrong customer after applying a customer filter.',
|
|
545
|
-
expected_result: 'Only tickets for Customer B should appear when Customer B is selected.',
|
|
546
|
-
observed_result: 'A Customer A ticket remains visible while filtered to Customer B.',
|
|
547
|
-
route_module: '/support tickets list',
|
|
548
|
-
account_customer_context: 'Support admin reviewing ticket 004430 for Customer B.',
|
|
549
|
-
reproduction_status: 'reproduced'
|
|
550
|
-
},
|
|
551
|
-
issue_class: 'filter_query_mismatch',
|
|
552
|
-
status: 'passed',
|
|
553
|
-
accepted_hypothesis: {
|
|
554
|
-
statement: 'The ticket list query ignores the customer filter.',
|
|
555
|
-
falsifiable_test: 'Apply the Customer B filter and verify every returned row belongs to Customer B.',
|
|
556
|
-
evidence: ['QA artifact shows Customer A ticket visible while Customer B filter is active.']
|
|
557
|
-
},
|
|
558
|
-
rejected_alternatives: [
|
|
559
|
-
'Frontend select state was rejected because the network payload includes the selected Customer B filter.',
|
|
560
|
-
'Authentication was rejected because the support admin can load the ticket list route.'
|
|
561
|
-
],
|
|
562
|
-
failing_path: {
|
|
563
|
-
frontend: 'Support ticket customer filter submits selected customer id.',
|
|
564
|
-
backend: 'server/src/publications/support-tickets.ts ticket list publication',
|
|
565
|
-
data_query: 'Mongo ticket query does not constrain by selected customer id.',
|
|
566
|
-
description: 'Filter input reaches the backend, but the publication query returns rows outside the selected customer.'
|
|
567
|
-
},
|
|
568
|
-
owner_files: ['server/src/publications/support-tickets.ts'],
|
|
569
|
-
proof_plan: {
|
|
570
|
-
before: 'Customer A ticket appears while filtered to Customer B.',
|
|
571
|
-
action: 'Apply the Customer B filter and reload the ticket list.',
|
|
572
|
-
after: 'Only Customer B tickets are listed.',
|
|
573
|
-
business_assertion: 'The wrong-customer ticket is absent after filtering.',
|
|
574
|
-
data_assertion: 'Every returned ticket row has customerId equal to Customer B.',
|
|
575
|
-
artifact_expectation: 'QA stores before/action/after row snapshots and the filtered publication payload.',
|
|
576
|
-
business_proof_contract: {
|
|
577
|
-
issue_class: 'filter_query_mismatch',
|
|
578
|
-
setup_state: 'Seed or select one Customer A ticket and one Customer B ticket.',
|
|
579
|
-
action_under_test: 'Apply the Customer B filter on the support ticket list.',
|
|
580
|
-
expected_business_state_change: 'Rows outside Customer B are excluded while Customer B rows remain visible.',
|
|
581
|
-
prohibited_false_pass: 'Route load or non-empty table without row/customer proof.',
|
|
582
|
-
proof_artifacts: ['qa-artifacts/support-filter-before-after.json', 'qa-artifacts/support-filter-payload.json'],
|
|
583
|
-
data_or_dom_assertion: 'DOM rows and publication payload contain only Customer B ticket ids.'
|
|
584
|
-
}
|
|
585
|
-
},
|
|
586
|
-
evidence: [{
|
|
587
|
-
type: 'ticket',
|
|
588
|
-
summary: 'Ticket 004430 reports wrong-customer tickets appearing after a customer filter is applied.'
|
|
589
|
-
}, {
|
|
590
|
-
type: 'qa',
|
|
591
|
-
summary: 'Browser QA reproduced Customer A ticket visible while Customer B filter was active.',
|
|
592
|
-
artifactPath: 'qa-artifacts/support-filter-reproduction.json'
|
|
593
|
-
}, {
|
|
594
|
-
type: 'code',
|
|
595
|
-
summary: 'Publication owner file contains the query that returns support ticket rows.'
|
|
596
|
-
}]
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
const supportBadProbePlanRun = buildSupportAIRunFromEvidence({
|
|
600
|
-
ticket: {
|
|
601
|
-
_id: 'ticket-bad-probe-plan',
|
|
602
|
-
ticketNumber: '004424',
|
|
603
|
-
title: 'Bad probe plan cannot be accepted',
|
|
604
|
-
accepted: true,
|
|
605
|
-
status: 'Resolved'
|
|
606
|
-
},
|
|
607
|
-
job: {
|
|
608
|
-
_id: 'support-job-bad-probe-plan',
|
|
609
|
-
status: 'Resolved',
|
|
610
|
-
phase: 'QA',
|
|
611
|
-
supportV5DiagnosisGate: {
|
|
612
|
-
issue_case: {
|
|
613
|
-
customer_complaint: 'Support ticket list shows tickets from the wrong customer after applying a customer filter.',
|
|
614
|
-
expected_result: 'Only tickets for Customer B should appear when Customer B is selected.',
|
|
615
|
-
observed_result: 'A Customer A ticket remains visible while filtered to Customer B.',
|
|
616
|
-
route_module: '/support tickets list',
|
|
617
|
-
account_customer_context: 'Support admin reviewing ticket 004424 for Customer B.',
|
|
618
|
-
reproduction_status: 'reproduced'
|
|
619
|
-
},
|
|
620
|
-
issue_class: 'filter_query_mismatch',
|
|
621
|
-
status: 'passed',
|
|
622
|
-
accepted_hypothesis: {
|
|
623
|
-
statement: 'The ticket list query ignores the customer filter.',
|
|
624
|
-
falsifiable_test: 'Apply the Customer B filter and verify every returned row belongs to Customer B.',
|
|
625
|
-
evidence: ['QA artifact shows Customer A ticket visible while Customer B filter is active.']
|
|
626
|
-
},
|
|
627
|
-
rejected_alternatives: [
|
|
628
|
-
'Frontend select state was rejected because the network payload includes the selected Customer B filter.',
|
|
629
|
-
'Auth was rejected because the support admin can load the ticket list route.'
|
|
630
|
-
],
|
|
631
|
-
failing_path: {
|
|
632
|
-
frontend: 'Support ticket customer filter submits selected customer id.',
|
|
633
|
-
backend: 'server/src/publications/support-tickets.ts ticket list publication',
|
|
634
|
-
data_query: 'Mongo ticket query does not constrain by selected customer id.',
|
|
635
|
-
description: 'Filter input reaches the backend, but the publication query returns rows outside the selected customer.'
|
|
636
|
-
},
|
|
637
|
-
owner_files: ['server/src/publications/support-tickets.ts'],
|
|
638
|
-
proof_plan: {
|
|
639
|
-
before: 'Customer A ticket appears while filtered to Customer B.',
|
|
640
|
-
action: 'Apply the Customer B filter and reload the ticket list.',
|
|
641
|
-
after: 'Only Customer B tickets are listed.',
|
|
642
|
-
business_assertion: 'The wrong-customer ticket is absent after filtering.',
|
|
643
|
-
data_assertion: 'Every returned ticket row has customerId equal to Customer B.',
|
|
644
|
-
artifact_expectation: 'QA stores before/action/after row snapshots and the filtered publication payload.'
|
|
645
|
-
},
|
|
646
|
-
evidence: [{
|
|
647
|
-
type: 'ticket',
|
|
648
|
-
summary: 'Ticket 004424 reports wrong-customer tickets after a customer filter is applied.'
|
|
649
|
-
}, {
|
|
650
|
-
type: 'qa',
|
|
651
|
-
summary: 'Browser QA reproduced Customer A ticket while Customer B filter was active.',
|
|
652
|
-
artifactPath: 'qa-artifacts/support-filter-reproduction.json'
|
|
653
|
-
}, {
|
|
654
|
-
type: 'code',
|
|
655
|
-
summary: 'Publication owner file contains the support ticket row query.'
|
|
656
|
-
}]
|
|
657
|
-
},
|
|
658
|
-
supportV5IssueClassProbePlan: {
|
|
659
|
-
planId: 'bad-probe-plan',
|
|
660
|
-
status: 'ready',
|
|
661
|
-
issue_class: 'filter_query_mismatch',
|
|
662
|
-
diagnosisValid: true,
|
|
663
|
-
probes: [{
|
|
664
|
-
issue_class: 'filter_query_mismatch',
|
|
665
|
-
probe_type: 'issue_class_probe',
|
|
666
|
-
failure_class: 'business',
|
|
667
|
-
objective: 'Verify the customer filter excludes wrong-customer rows.',
|
|
668
|
-
route: '',
|
|
669
|
-
action: '',
|
|
670
|
-
expected_evidence: '',
|
|
671
|
-
expected_business_proof: '',
|
|
672
|
-
required_artifacts: [],
|
|
673
|
-
state_transition: { before: '', action: '', after: '', assertion: '' },
|
|
674
|
-
acceptance_gate: 'route_probe',
|
|
675
|
-
blocks_acceptance_without_business_assertion: false
|
|
676
|
-
}],
|
|
677
|
-
requiredArtifacts: [],
|
|
678
|
-
acceptanceGate: 'route_probe',
|
|
679
|
-
falsePassBlockers: [],
|
|
680
|
-
blockers: [],
|
|
681
|
-
generatedAt: '2026-06-06T00:00:00.000Z'
|
|
682
|
-
},
|
|
683
|
-
supportV5AutonomousDecision: {
|
|
684
|
-
nextActionContract: {
|
|
685
|
-
contractId: 'support-next-action-business-qa',
|
|
686
|
-
action: 'run_business_proof_qa',
|
|
687
|
-
label: 'Run business proof QA',
|
|
688
|
-
primaryCommand: 'run_support_v5_business_proof_qa',
|
|
689
|
-
lane: 'qa',
|
|
690
|
-
stepType: 'business_proof',
|
|
691
|
-
safeToAutoRun: true,
|
|
692
|
-
requiresHumanApproval: false,
|
|
693
|
-
canRunWithoutCodexMonitor: true,
|
|
694
|
-
codexFallbackRequired: false,
|
|
695
|
-
rootCauseFirstSatisfied: true,
|
|
696
|
-
preconditions: ['SupportDiagnosisGate passed.'],
|
|
697
|
-
successEvidence: ['AIQaBusinessAssertion mapped to proof_plan.'],
|
|
698
|
-
stopConditions: ['Same failure class repeats without new evidence.'],
|
|
699
|
-
ownerFiles: ['server/src/publications/support-tickets.ts'],
|
|
700
|
-
decisionBasis: {
|
|
701
|
-
diagnosisValid: true,
|
|
702
|
-
ownerFilesReady: true,
|
|
703
|
-
proofPlanReady: true,
|
|
704
|
-
businessProofReady: true,
|
|
705
|
-
evidenceFreshnessStatus: 'fresh',
|
|
706
|
-
evidenceStrength: 'high',
|
|
707
|
-
failureClass: 'business',
|
|
708
|
-
sameFailureCount: 0
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
},
|
|
713
|
-
qaEvidence: {
|
|
714
|
-
compile: { status: 'pass' },
|
|
715
|
-
routeProbes: [{ route: '/support/004424', status: 'pass' }],
|
|
716
|
-
businessAssertions: [{
|
|
717
|
-
assertion: 'The wrong-customer ticket is absent after filtering.',
|
|
718
|
-
status: 'pass',
|
|
719
|
-
action: 'Apply the Customer B filter and reload the ticket list.',
|
|
720
|
-
expected: 'Only Customer B tickets are listed.',
|
|
721
|
-
observed: 'Only Customer B tickets are listed.',
|
|
722
|
-
dataProof: 'Every returned ticket row has customerId equal to Customer B.',
|
|
723
|
-
artifactPaths: ['qa-artifacts/support-filter-before-after.json'],
|
|
724
|
-
metadata: { proofPlanMatched: true, supportDiagnosisProof: true }
|
|
725
|
-
}]
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
const supportBadProbePlanGate = supportBadProbePlanRun.gates.find((gate) => gate.key === 'support_issue_class_probe_plan');
|
|
729
|
-
assert.equal(supportBadProbePlanGate?.status, 'blocked');
|
|
730
|
-
assert.equal(supportBadProbePlanRun.metadata?.issueClassProbePlan?.issueClassProbePlanReady, false);
|
|
731
|
-
assert.equal(supportBadProbePlanRun.outcome, 'false_pass');
|
|
732
|
-
assert.match(String(supportBadProbePlanRun.nextAction || ''), /IssueClassProbePlan/i);
|
|
733
|
-
|
|
734
|
-
const supportInvalidRootCauseContractRun = buildSupportAIRunFromEvidence({
|
|
735
|
-
ticket: { _id: 'ticket-invalid-root-cause', ticketNumber: '004422', title: 'Invalid root cause contract' },
|
|
736
|
-
job: {
|
|
737
|
-
_id: 'support-job-invalid-root-cause',
|
|
738
|
-
status: 'Running',
|
|
739
|
-
phase: 'Planning',
|
|
740
|
-
supportRootCauseEntryContract: {
|
|
741
|
-
contract_id: 'support-root-cause-entry-invalid',
|
|
742
|
-
required_output: {
|
|
743
|
-
object_key: 'support_diagnosis_gate',
|
|
744
|
-
required_fields: ['issue_case']
|
|
745
|
-
},
|
|
746
|
-
owner_file_policy: {
|
|
747
|
-
max_files: 50
|
|
748
|
-
},
|
|
749
|
-
business_proof_policy: {},
|
|
750
|
-
failure_policy: {},
|
|
751
|
-
issue_class_probes: [{ issue_class: 'no_op_submit' }]
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
});
|
|
755
|
-
const invalidRootCauseGate = supportInvalidRootCauseContractRun.gates.find((gate) => gate.key === 'support_root_cause_entry_contract');
|
|
756
|
-
assert.equal(invalidRootCauseGate?.status, 'fail');
|
|
757
|
-
assert.match(String(invalidRootCauseGate?.reason || ''), /missing required output fields|issue-class probes/i);
|
|
758
|
-
|
|
759
|
-
const supportHotfixBlockedUntilCommitRun = buildSupportAIRunFromEvidence({
|
|
760
|
-
ticket: { _id: 'ticket-hotfix-commit-blocked', ticketNumber: '004777', title: 'Hotfix must be committed' },
|
|
761
|
-
job: {
|
|
762
|
-
_id: 'support-hotfix-commit-blocked',
|
|
763
|
-
status: 'Running',
|
|
764
|
-
phase: 'Release',
|
|
765
|
-
support_v5_autonomous_decision: {
|
|
766
|
-
next_action_contract: {
|
|
767
|
-
contract_id: 'support-next-action-hotfix-blocked',
|
|
768
|
-
action: 'apply_live_hotfix',
|
|
769
|
-
label: 'Apply live hotfix',
|
|
770
|
-
primary_command: 'run_support_v5_live_hotfix',
|
|
771
|
-
lane: 'release',
|
|
772
|
-
step_type: 'hotfix',
|
|
773
|
-
safe_to_auto_run: false,
|
|
774
|
-
requires_human_approval: true,
|
|
775
|
-
can_run_without_codex_monitor: false,
|
|
776
|
-
codex_fallback_required: true,
|
|
777
|
-
codex_fallback_reason: 'Live hotfix cannot proceed until commit proof is pushed.',
|
|
778
|
-
success_evidence: ['sourceCommitSha', 'githubCommitUrl', 'gitCommitStatus=passed', 'gitPushStatus=passed'],
|
|
779
|
-
decision_basis: {
|
|
780
|
-
failure_class: 'release',
|
|
781
|
-
hotfix_commit_required: true,
|
|
782
|
-
live_hotfix_blocked_until_commit: true,
|
|
783
|
-
same_failure_count: 1
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
});
|
|
789
|
-
const supportHotfixBlockedGate = supportHotfixBlockedUntilCommitRun.gates.find((gate) => gate.key === 'support_next_action_contract');
|
|
790
|
-
assert.equal(supportHotfixBlockedGate?.status, 'blocked');
|
|
791
|
-
assert.match(String(supportHotfixBlockedGate?.reason || ''), /GitHub commit proof/i);
|
|
792
|
-
assert.equal(supportHotfixBlockedGate?.metadata?.codexFallbackRequired, true);
|
|
793
|
-
assert.equal(supportHotfixBlockedUntilCommitRun.metadata?.nextActionContract?.liveHotfixBlockedUntilCommit, true);
|
|
794
|
-
|
|
795
|
-
const supportHotfixDurabilityRun = buildSupportAIRunFromEvidence({
|
|
796
|
-
ticket: { _id: 'ticket-hotfix-durability', ticketNumber: '004779', title: 'Hotfix durability contract' },
|
|
797
|
-
job: {
|
|
798
|
-
_id: 'support-hotfix-durability',
|
|
799
|
-
status: 'Running',
|
|
800
|
-
phase: 'Release',
|
|
801
|
-
supportManagerHotfixDurabilityContract: {
|
|
802
|
-
contract_id: 'support-hotfix-durability-test',
|
|
803
|
-
required: true,
|
|
804
|
-
action: 'run_release_repair',
|
|
805
|
-
status: 'waiting_for_commit_proof',
|
|
806
|
-
can_prepare_hotfix_patch: true,
|
|
807
|
-
can_hotfix_backend: false,
|
|
808
|
-
live_hotfix_blocked_until_commit: true,
|
|
809
|
-
missing_commit_proof_fields: ['sourceCommitSha', 'githubCommitUrl', 'gitCommitStatus=passed', 'gitPushStatus=passed'],
|
|
810
|
-
next_safe_action: 'commit_and_push_hotfix_to_github'
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
});
|
|
814
|
-
const supportHotfixDurabilityGate = supportHotfixDurabilityRun.gates.find((gate) => gate.key === 'hotfix_durability_contract');
|
|
815
|
-
assert.equal(supportHotfixDurabilityGate?.status, 'blocked');
|
|
816
|
-
assert.equal(supportHotfixDurabilityGate?.metadata?.liveHotfixBlockedUntilCommit, true);
|
|
817
|
-
assert.equal(supportHotfixDurabilityGate?.metadata?.commitFirstProtocolSatisfied, false);
|
|
818
|
-
assert.equal(supportHotfixDurabilityRun.metadata?.hotfixDurability?.liveHotfixBlockedUntilCommit, true);
|
|
819
|
-
assert.equal(supportHotfixDurabilityRun.metadata?.hotfixDurability?.commitFirstProtocolSatisfied, false);
|
|
820
|
-
assert.equal(supportHotfixDurabilityRun.metadata?.hotfixDurability?.liveHotfixAllowed, false);
|
|
821
|
-
assert.equal(supportHotfixDurabilityRun.metadata?.hotfixDurability?.canHotfixBackend, false);
|
|
822
|
-
assert.equal(supportHotfixDurabilityRun.events.some((event) => event.category === 'hotfix_durability_contract'), true);
|
|
823
|
-
|
|
824
|
-
const supportMissingNextActionContractRun = buildSupportAIRunFromEvidence({
|
|
825
|
-
ticket: { _id: 'ticket-missing-next-action', ticketNumber: '004778', title: 'Support V5 missing next action' },
|
|
826
|
-
job: {
|
|
827
|
-
_id: 'support-missing-next-action',
|
|
828
|
-
status: 'Running',
|
|
829
|
-
phase: 'Manager',
|
|
830
|
-
supportWorkflowMode: 'support_v5',
|
|
831
|
-
supportV5SupervisorState: {
|
|
832
|
-
status: 'active',
|
|
833
|
-
activeStep: 'manager_recovery',
|
|
834
|
-
activeBlocker: 'Runner needs a structured next action.'
|
|
835
|
-
},
|
|
836
|
-
supportV5StepHistory: [{
|
|
837
|
-
lane: 'qa',
|
|
838
|
-
stepType: 'business_proof',
|
|
839
|
-
outcome: 'needs_repair',
|
|
840
|
-
failureClass: 'business',
|
|
841
|
-
blocker: 'Business proof missing after route-only QA.',
|
|
842
|
-
evidenceHash: 'route-only-no-next-action'
|
|
843
|
-
}]
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
const supportMissingNextActionGate = supportMissingNextActionContractRun.gates.find((gate) => gate.key === 'support_next_action_contract');
|
|
847
|
-
assert.equal(supportMissingNextActionGate?.status, 'blocked');
|
|
848
|
-
assert.equal(supportMissingNextActionGate?.metadata?.missingContract, true);
|
|
849
|
-
assert.equal(supportMissingNextActionGate?.metadata?.canRunWithoutCodexMonitor, false);
|
|
850
|
-
assert.equal(supportMissingNextActionGate?.metadata?.codexFallbackRequired, true);
|
|
851
|
-
assert.equal(supportMissingNextActionContractRun.outcome, 'manual_handoff');
|
|
852
|
-
assert.match(String(supportMissingNextActionContractRun.nextAction || ''), /validated next-action contract/i);
|
|
853
|
-
assert.equal(supportMissingNextActionContractRun.metadata?.nextActionContract?.status, 'blocked');
|
|
854
|
-
assert.equal(supportMissingNextActionContractRun.events.some((event) => event.category === 'support_next_action_contract'), true);
|
|
855
|
-
|
|
856
|
-
const supportRepairBeforeDiagnosisRun = buildSupportAIRunFromEvidence({
|
|
857
|
-
ticket: { _id: 'ticket-repair-before-diagnosis', ticketNumber: '004502', title: 'Repair started before diagnosis' },
|
|
858
|
-
job: {
|
|
859
|
-
_id: 'support-job-repair-before-diagnosis',
|
|
860
|
-
status: 'Running',
|
|
861
|
-
phase: 'Build',
|
|
862
|
-
supportV5StepHistory: [{
|
|
863
|
-
lane: 'build',
|
|
864
|
-
stepType: 'build_repair',
|
|
865
|
-
outcome: 'needs_repair',
|
|
866
|
-
failureClass: 'product_code',
|
|
867
|
-
blocker: 'Save action still fails.',
|
|
868
|
-
changedFiles: ['server/src/methods/support-ticket-save.ts'],
|
|
869
|
-
evidenceHash: 'repair-without-diagnosis'
|
|
870
|
-
}]
|
|
871
|
-
},
|
|
872
|
-
qaEvidence: {
|
|
873
|
-
compile: { status: 'pass' },
|
|
874
|
-
routeProbes: [{ route: '/support/004502', status: 'pass' }]
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
const supportRepairBeforeDiagnosisGate = supportRepairBeforeDiagnosisRun.gates.find((gate) => gate.key === 'support_diagnosis_before_repair');
|
|
878
|
-
assert.equal(supportRepairBeforeDiagnosisGate?.status, 'blocked');
|
|
879
|
-
assert.equal(supportRepairBeforeDiagnosisGate?.metadata?.diagnosisValid, false);
|
|
880
|
-
assert.equal(supportRepairBeforeDiagnosisGate?.metadata?.allowedDispatchAction, 'run_read_only_diagnosis');
|
|
881
|
-
assert.equal(supportRepairBeforeDiagnosisGate?.metadata?.productRepairAllowed, false);
|
|
882
|
-
assert.equal(supportRepairBeforeDiagnosisRun.outcome, 'manual_handoff');
|
|
883
|
-
assert.match(String(supportRepairBeforeDiagnosisGate?.reason || ''), /Support product repair is blocked/i);
|
|
884
|
-
assert.match(String(supportRepairBeforeDiagnosisRun.nextAction || ''), /read-only support diagnosis/i);
|
|
885
|
-
assert.equal(supportRepairBeforeDiagnosisRun.metadata?.diagnosisBeforeRepair?.allowedDispatchAction, 'run_read_only_diagnosis');
|
|
886
|
-
assert.deepEqual(supportRepairBeforeDiagnosisRun.metadata?.diagnosisBeforeRepair?.changedFiles, ['server/src/methods/support-ticket-save.ts']);
|
|
887
|
-
assert.equal(supportRepairBeforeDiagnosisRun.events.some((event) => event.category === 'support_diagnosis_before_repair'), true);
|
|
888
|
-
|
|
889
|
-
const supportInScopeRepairRun = buildSupportAIRunFromEvidence({
|
|
890
|
-
ticket: { _id: 'ticket-in-scope-repair', ticketNumber: '004503', title: 'In-scope support repair' },
|
|
891
|
-
job: {
|
|
892
|
-
_id: 'support-job-in-scope-repair',
|
|
893
|
-
status: 'Running',
|
|
894
|
-
phase: 'Build',
|
|
895
|
-
supportV5DiagnosisGate: supportAcceptedDiagnosisGate,
|
|
896
|
-
supportV5StepHistory: [{
|
|
897
|
-
lane: 'build',
|
|
898
|
-
stepType: 'build_repair',
|
|
899
|
-
outcome: 'pass',
|
|
900
|
-
failureClass: 'product_code',
|
|
901
|
-
summary: 'Owner-scoped publication repair completed.',
|
|
902
|
-
changedFiles: ['server/src/publications/support-tickets.ts', 'tests/support-ticket-filter.test.ts'],
|
|
903
|
-
evidenceHash: 'owner-scope-in-scope'
|
|
904
|
-
}]
|
|
905
|
-
},
|
|
906
|
-
qaEvidence: {
|
|
907
|
-
compile: { status: 'pass' },
|
|
908
|
-
routeProbes: [{ route: '/support', status: 'pass' }]
|
|
909
|
-
}
|
|
910
|
-
});
|
|
911
|
-
const supportInScopeGate = supportInScopeRepairRun.gates.find((gate) => gate.key === 'support_owner_file_scope');
|
|
912
|
-
assert.equal(supportInScopeGate?.status, 'pass');
|
|
913
|
-
assert.equal(supportInScopeGate?.metadata?.productRepairAllowed, true);
|
|
914
|
-
assert.deepEqual(supportInScopeGate?.metadata?.outsideOwnerFiles, []);
|
|
915
|
-
assert.equal(supportInScopeRepairRun.metadata?.ownerFileScope?.allowedTestFilesOutsideOwnerScope, true);
|
|
916
|
-
assert.equal(supportInScopeRepairRun.events.some((event) => event.category === 'support_owner_file_scope'), true);
|
|
917
|
-
|
|
918
|
-
const supportOutOfScopeRepairRun = buildSupportAIRunFromEvidence({
|
|
919
|
-
ticket: { _id: 'ticket-out-of-scope-repair', ticketNumber: '004504', title: 'Out-of-scope support repair' },
|
|
920
|
-
job: {
|
|
921
|
-
_id: 'support-job-out-of-scope-repair',
|
|
922
|
-
status: 'Running',
|
|
923
|
-
phase: 'Build',
|
|
924
|
-
supportV5DiagnosisGate: supportAcceptedDiagnosisGate,
|
|
925
|
-
supportV5StepHistory: [{
|
|
926
|
-
lane: 'build',
|
|
927
|
-
stepType: 'build_repair',
|
|
928
|
-
outcome: 'needs_repair',
|
|
929
|
-
failureClass: 'product_code',
|
|
930
|
-
blocker: 'Repair touched an unrelated support method.',
|
|
931
|
-
changedFiles: ['server/src/publications/support-tickets.ts', 'server/src/methods/support-ticket-save.ts'],
|
|
932
|
-
evidenceHash: 'owner-scope-out-of-scope'
|
|
933
|
-
}]
|
|
934
|
-
},
|
|
935
|
-
qaEvidence: {
|
|
936
|
-
compile: { status: 'pass' },
|
|
937
|
-
routeProbes: [{ route: '/support', status: 'pass' }]
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
const supportOutOfScopeGate = supportOutOfScopeRepairRun.gates.find((gate) => gate.key === 'support_owner_file_scope');
|
|
941
|
-
assert.equal(supportOutOfScopeGate?.status, 'blocked');
|
|
942
|
-
assert.deepEqual(supportOutOfScopeGate?.metadata?.outsideOwnerFiles, ['server/src/methods/support-ticket-save.ts']);
|
|
943
|
-
assert.equal(supportOutOfScopeGate?.metadata?.allowedDispatchAction, 'run_read_only_diagnosis');
|
|
944
|
-
assert.equal(supportOutOfScopeRepairRun.outcome, 'manual_handoff');
|
|
945
|
-
assert.match(String(supportOutOfScopeRepairRun.nextAction || ''), /Revise the SupportDiagnosisGate/i);
|
|
946
|
-
assert.equal(supportOutOfScopeRepairRun.metadata?.ownerFileScope?.productRepairAllowed, false);
|
|
947
|
-
assert.deepEqual(supportOutOfScopeRepairRun.metadata?.ownerFileScope?.outsideOwnerFiles, ['server/src/methods/support-ticket-save.ts']);
|
|
948
|
-
|
|
949
|
-
const supportUnpushedHotfixRun = buildSupportAIRunFromEvidence({
|
|
950
|
-
ticket: { _id: 'ticket-004421-hotfix', ticketNumber: '004421', title: 'Unpushed backend hotfix guard' },
|
|
951
|
-
job: {
|
|
952
|
-
_id: 'support-job-unpushed-hotfix',
|
|
953
|
-
status: 'Running',
|
|
954
|
-
phase: 'Release',
|
|
955
|
-
supportV5DiagnosisGate: supportAcceptedDiagnosisGate
|
|
956
|
-
},
|
|
957
|
-
qaEvidence: {
|
|
958
|
-
infraChecks: [{ name: 'puppeteer_require', status: 'pass' }],
|
|
959
|
-
compile: { status: 'pass' },
|
|
960
|
-
routeProbes: [{ route: '/support/004421', status: 'pass' }],
|
|
961
|
-
hotfixEvidence: {
|
|
962
|
-
channel: 'backend_js',
|
|
963
|
-
target: {
|
|
964
|
-
host: 'backend.resolveio.com',
|
|
965
|
-
path: '/var/app/current/http/runner-manager-selftest.js'
|
|
966
|
-
},
|
|
967
|
-
compiledArtifactPath: 'dist/http/runner-manager-selftest.js',
|
|
968
|
-
remoteChecksumBefore: '1111111111111111111111111111111111111111111111111111111111111111',
|
|
969
|
-
remoteChecksumAfter: '2222222222222222222222222222222222222222222222222222222222222222',
|
|
970
|
-
sourceCommitSha: '6fd400e1d8c961c1e88820292c323e688fdcc0a4',
|
|
971
|
-
githubCommitUrl: 'https://github.com/resolveio/resolveio-all/commit/6fd400e1d8c961c1e88820292c323e688fdcc0a4',
|
|
972
|
-
restartEvidence: 'nodejs restarted on all support hosts',
|
|
973
|
-
healthCheckStatus: 'passed',
|
|
974
|
-
selfTestStatus: 'passed'
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
});
|
|
978
|
-
const supportUnpushedHotfixGate = supportUnpushedHotfixRun.gates.find((gate) => gate.key === 'hotfix_evidence');
|
|
979
|
-
assert.equal(supportUnpushedHotfixGate?.status, 'fail');
|
|
980
|
-
assert.match(String(supportUnpushedHotfixGate?.reason || ''), /gitPushStatus|GitHub/i);
|
|
981
|
-
const supportUnpushedHotfixCommitGate = supportUnpushedHotfixRun.gates.find((gate) => gate.key === 'hotfix_commit_proof');
|
|
982
|
-
assert.equal(supportUnpushedHotfixCommitGate?.status, 'blocked');
|
|
983
|
-
assert.equal(supportUnpushedHotfixCommitGate?.metadata?.managerMustCommitBeforeHotfix, true);
|
|
984
|
-
assert.equal(supportUnpushedHotfixRun.outcome, 'release_blocked');
|
|
985
|
-
assert.equal(supportUnpushedHotfixRun.events.some((event) => event.type === 'hotfix' && event.metadata?.hotfixSatisfied === false), true);
|
|
986
|
-
assert.equal(supportUnpushedHotfixRun.events.some((event) => event.category === 'hotfix_commit_proof' && event.metadata?.managerMustCommitBeforeHotfix === true), true);
|
|
987
|
-
assert.equal(supportUnpushedHotfixRun.metadata?.hotfixDurability?.commitBlocked, true);
|
|
988
|
-
assert.match(String(supportUnpushedHotfixRun.metadata?.hotfixDurability?.nextAction || ''), /Commit and push/i);
|
|
989
|
-
|
|
990
|
-
const supportRepeatedFailureRun = buildSupportAIRunFromEvidence({
|
|
991
|
-
ticket: { _id: 'ticket-repeated-failure', ticketNumber: '004500', title: 'Repeated support failure' },
|
|
992
|
-
job: {
|
|
993
|
-
_id: 'support-job-repeated-failure',
|
|
994
|
-
status: 'Running',
|
|
995
|
-
phase: 'Build',
|
|
996
|
-
supportV5Budget: { maxRepeatedNoProgress: 2 },
|
|
997
|
-
supportV5StepHistory: [
|
|
998
|
-
{
|
|
999
|
-
lane: 'repair',
|
|
1000
|
-
stepType: 'workflow_build',
|
|
1001
|
-
outcome: 'needs_repair',
|
|
1002
|
-
failureClass: 'product_code',
|
|
1003
|
-
blocker: 'Save action still throws TypeError.',
|
|
1004
|
-
evidenceHash: 'save-typeerror-before',
|
|
1005
|
-
artifactPaths: ['qa/save-before.log']
|
|
1006
|
-
},
|
|
1007
|
-
{
|
|
1008
|
-
lane: 'repair',
|
|
1009
|
-
stepType: 'workflow_build',
|
|
1010
|
-
outcome: 'needs_repair',
|
|
1011
|
-
failureClass: 'product_code',
|
|
1012
|
-
blocker: 'Save action still throws TypeError.',
|
|
1013
|
-
evidenceHash: 'save-typeerror-before',
|
|
1014
|
-
artifactPaths: ['qa/save-before.log']
|
|
1015
|
-
}
|
|
1016
|
-
]
|
|
1017
|
-
},
|
|
1018
|
-
qaEvidence: {
|
|
1019
|
-
compile: { status: 'pass' },
|
|
1020
|
-
routeProbes: [{ route: '/support/004500', status: 'pass' }]
|
|
1021
|
-
}
|
|
1022
|
-
});
|
|
1023
|
-
const repeatedFailureGate = supportRepeatedFailureRun.gates.find((gate) => gate.key === 'manager_no_blind_loop_policy');
|
|
1024
|
-
assert.equal(repeatedFailureGate?.status, 'blocked');
|
|
1025
|
-
assert.equal(repeatedFailureGate?.metadata?.action, 'park_repeated_failure');
|
|
1026
|
-
assert.equal(repeatedFailureGate?.metadata?.requiresNewEvidence, true);
|
|
1027
|
-
assert.equal(repeatedFailureGate?.metadata?.productRepairAllowed, false);
|
|
1028
|
-
assert.equal(supportRepeatedFailureRun.outcome, 'manual_handoff');
|
|
1029
|
-
assert.equal(supportRepeatedFailureRun.events.some((event) => event.category === 'manager_no_blind_loop_policy'), true);
|
|
1030
|
-
assert.equal(supportRepeatedFailureRun.metadata?.managerNoBlindLoopPolicy?.requiresNewEvidence, true);
|
|
1031
|
-
|
|
1032
|
-
const supportInfraRetryRun = buildSupportAIRunFromEvidence({
|
|
1033
|
-
ticket: { _id: 'ticket-infra-retry', ticketNumber: '004501', title: 'Support infra retry' },
|
|
1034
|
-
job: {
|
|
1035
|
-
_id: 'support-job-infra-retry',
|
|
1036
|
-
status: 'Running',
|
|
1037
|
-
phase: 'QA',
|
|
1038
|
-
supportV5StepHistory: [{
|
|
1039
|
-
lane: 'qa',
|
|
1040
|
-
stepType: 'workflow_qa',
|
|
1041
|
-
outcome: 'needs_repair',
|
|
1042
|
-
failureClass: 'infra',
|
|
1043
|
-
blocker: 'Chrome executable missing.',
|
|
1044
|
-
evidenceHash: 'chrome-missing',
|
|
1045
|
-
artifactPaths: ['qa/chrome-preflight.log']
|
|
1046
|
-
}]
|
|
1047
|
-
},
|
|
1048
|
-
qaEvidence: {
|
|
1049
|
-
infraChecks: [{ name: 'chrome_executable', status: 'blocked', message: 'Chrome executable missing.', path: 'qa/chrome-preflight.log' }]
|
|
1050
|
-
}
|
|
1051
|
-
});
|
|
1052
|
-
const infraRetryGate = supportInfraRetryRun.gates.find((gate) => gate.key === 'manager_no_blind_loop_policy');
|
|
1053
|
-
assert.equal(infraRetryGate?.status, 'warn');
|
|
1054
|
-
assert.equal(infraRetryGate?.metadata?.action, 'retry_infra');
|
|
1055
|
-
assert.equal(infraRetryGate?.metadata?.productRepairFailure, false);
|
|
1056
|
-
assert.equal(infraRetryGate?.metadata?.dispatchAction, 'run_infra_repair');
|
|
1057
|
-
assert.equal(supportInfraRetryRun.outcome, 'qa_infra_failed');
|
|
1058
|
-
|
|
1059
|
-
const supportCompilePreflightGateRun = buildSupportAIRunFromEvidence({
|
|
1060
|
-
ticket: { _id: 'ticket-compile-preflight', ticketNumber: '004502', title: 'Support compile preflight' },
|
|
1061
|
-
job: {
|
|
1062
|
-
_id: 'support-job-compile-preflight',
|
|
1063
|
-
status: 'Running',
|
|
1064
|
-
phase: 'QA',
|
|
1065
|
-
supportV5PreflightGate: {
|
|
1066
|
-
required: true,
|
|
1067
|
-
status: 'compile_failed',
|
|
1068
|
-
failureClass: 'compile',
|
|
1069
|
-
blocksProductRepair: true,
|
|
1070
|
-
blocksModelRepair: true,
|
|
1071
|
-
nextCommand: 'run_support_v5_compile_repair',
|
|
1072
|
-
evidenceHash: 'compile-preflight-hash',
|
|
1073
|
-
compileResult: {
|
|
1074
|
-
status: 'fail',
|
|
1075
|
-
summary: 'Angular compile failed before browser QA.',
|
|
1076
|
-
command: 'npm run build-prod',
|
|
1077
|
-
artifactPath: 'qa-artifacts/preflight/compile.log',
|
|
1078
|
-
failureClass: 'compile'
|
|
1079
|
-
},
|
|
1080
|
-
requiredEvidence: ['compile command output', 'new compile evidence hash or pass']
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
});
|
|
1084
|
-
const supportCompilePreflightGate = supportCompilePreflightGateRun.gates.find((gate) => gate.key === 'support_preflight_gate');
|
|
1085
|
-
assert.equal(supportCompilePreflightGateRun.outcome, 'build_failed');
|
|
1086
|
-
assert.equal(supportCompilePreflightGate?.status, 'fail');
|
|
1087
|
-
assert.equal(supportCompilePreflightGate?.metadata?.failureClass, 'compile');
|
|
1088
|
-
assert.equal(supportCompilePreflightGate?.metadata?.nextCommand, 'run_support_v5_compile_repair');
|
|
1089
|
-
assert.equal(supportCompilePreflightGateRun.gates.some((gate) => gate.key === 'qa_compile' && gate.status === 'fail'), true);
|
|
1090
|
-
assert.equal(supportCompilePreflightGateRun.events.some((event) => event.category === 'support_preflight_gate' && event.type === 'qa_compile'), true);
|
|
1091
|
-
|
|
1092
|
-
const supportStartupPreflightGateRun = buildSupportAIRunFromEvidence({
|
|
1093
|
-
ticket: { _id: 'ticket-startup-preflight', ticketNumber: '004503', title: 'Support startup preflight' },
|
|
1094
|
-
job: {
|
|
1095
|
-
_id: 'support-job-startup-preflight',
|
|
1096
|
-
status: 'Running',
|
|
1097
|
-
phase: 'QA',
|
|
1098
|
-
supportV5PreflightGate: {
|
|
1099
|
-
required: true,
|
|
1100
|
-
status: 'infra_failed',
|
|
1101
|
-
failureClass: 'infra',
|
|
1102
|
-
blocksProductRepair: true,
|
|
1103
|
-
blocksModelRepair: true,
|
|
1104
|
-
nextCommand: 'run_support_v5_infra_repair',
|
|
1105
|
-
evidenceHash: 'startup-preflight-hash',
|
|
1106
|
-
checks: [{
|
|
1107
|
-
name: 'server_startup',
|
|
1108
|
-
status: 'fail',
|
|
1109
|
-
summary: 'Local startup preflight failed before browser QA.',
|
|
1110
|
-
artifactPaths: ['qa-artifacts/runner.log', 'qa-artifacts/server.log'],
|
|
1111
|
-
failureClass: 'infra'
|
|
1112
|
-
}],
|
|
1113
|
-
requiredEvidence: ['startup preflight log', 'new infra evidence hash or pass']
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
});
|
|
1117
|
-
const supportStartupPreflightGate = supportStartupPreflightGateRun.gates.find((gate) => gate.key === 'support_preflight_gate');
|
|
1118
|
-
assert.equal(supportStartupPreflightGateRun.outcome, 'qa_infra_failed');
|
|
1119
|
-
assert.equal(supportStartupPreflightGate?.status, 'fail');
|
|
1120
|
-
assert.equal(supportStartupPreflightGate?.metadata?.failureClass, 'infra');
|
|
1121
|
-
assert.equal(supportStartupPreflightGate?.metadata?.nextCommand, 'run_support_v5_infra_repair');
|
|
1122
|
-
assert.equal(supportStartupPreflightGateRun.gates.some((gate) => gate.key === 'qa_infra' && gate.status === 'blocked'), true);
|
|
1123
|
-
assert.equal(supportStartupPreflightGateRun.events.some((event) => event.category === 'support_preflight_gate' && event.type === 'qa_infra'), true);
|
|
1124
|
-
|
|
1125
|
-
const supportGenericBusinessProofRun = buildSupportAIRunFromEvidence({
|
|
1126
|
-
ticket: { _id: 'ticket-004421', ticketNumber: '004421', title: 'Generic support proof' },
|
|
1127
|
-
job: {
|
|
1128
|
-
_id: 'support-job-generic-proof',
|
|
1129
|
-
status: 'Closed',
|
|
1130
|
-
phase: 'COMPLETE',
|
|
1131
|
-
supportV5DiagnosisGate: supportAcceptedDiagnosisGate
|
|
1132
|
-
},
|
|
1133
|
-
qaEvidence: {
|
|
1134
|
-
infraChecks: [{ name: 'puppeteer_require', status: 'pass' }],
|
|
1135
|
-
compile: { status: 'pass' },
|
|
1136
|
-
routeProbes: [{ route: '/support', status: 'pass' }],
|
|
1137
|
-
scorecardPassed: true,
|
|
1138
|
-
businessAssertions: [{
|
|
1139
|
-
assertion: 'The route loads and the ticket page has visible controls.',
|
|
1140
|
-
status: 'pass',
|
|
1141
|
-
route: '/support',
|
|
1142
|
-
action: 'Open the ticket page.',
|
|
1143
|
-
expected: 'Visible controls render.',
|
|
1144
|
-
observed: 'Visible controls rendered.',
|
|
1145
|
-
dataProof: 'Screenshot showed page content.'
|
|
1146
|
-
}]
|
|
1147
|
-
}
|
|
1148
|
-
});
|
|
1149
|
-
assert.equal(supportGenericBusinessProofRun.outcome, 'false_pass');
|
|
1150
|
-
assert.equal(supportGenericBusinessProofRun.gates.some((gate) => gate.key === 'support_diagnosis_business_proof' && gate.status === 'blocked'), true);
|
|
1151
|
-
|
|
1152
|
-
const supportBusinessProofRun = buildSupportAIRunFromEvidence({
|
|
1153
|
-
ticket: { _id: 'ticket-004430', ticketNumber: '004430', title: 'Filtered support ticket list' },
|
|
1154
|
-
job: {
|
|
1155
|
-
_id: 'support-job-2',
|
|
1156
|
-
status: 'Closed',
|
|
1157
|
-
phase: 'COMPLETE',
|
|
1158
|
-
supportV5DiagnosisGate: supportAcceptedDiagnosisGate
|
|
1159
|
-
},
|
|
1160
|
-
qaEvidence: {
|
|
1161
|
-
infraChecks: [{ name: 'puppeteer_require', status: 'pass' }],
|
|
1162
|
-
compile: { status: 'pass' },
|
|
1163
|
-
routeProbes: [{ route: '/support', status: 'pass' }],
|
|
1164
|
-
businessAssertions: [{
|
|
1165
|
-
assertion: 'Wrong-customer ticket is absent after applying the customer filter.',
|
|
1166
|
-
status: 'pass',
|
|
1167
|
-
route: '/support',
|
|
1168
|
-
action: 'Apply customer filter and reload.',
|
|
1169
|
-
expected: 'Only Customer B tickets are visible.',
|
|
1170
|
-
observed: 'Customer A ticket was not rendered.',
|
|
1171
|
-
dataProof: 'DOM and query proof matched the diagnosis proof plan.'
|
|
1172
|
-
}]
|
|
1173
|
-
}
|
|
1174
|
-
});
|
|
1175
|
-
assert.equal(supportBusinessProofRun.outcome, 'accepted');
|
|
1176
|
-
|
|
1177
|
-
const supportJobStoredBusinessProofRun = buildSupportAIRunFromEvidence({
|
|
1178
|
-
ticket: { _id: 'ticket-004431', ticketNumber: '004431', title: 'Stored support business proof' },
|
|
1179
|
-
job: {
|
|
1180
|
-
_id: 'support-job-stored-proof',
|
|
1181
|
-
status: 'Closed',
|
|
1182
|
-
phase: 'COMPLETE',
|
|
1183
|
-
supportV5DiagnosisGate: supportAcceptedDiagnosisGate,
|
|
1184
|
-
supportQaValidationCursor: {
|
|
1185
|
-
route_probe: { route: '/support', status: 'pass', screenshot: 'qa-artifacts/stored-route.png' },
|
|
1186
|
-
business_assertions: [{
|
|
1187
|
-
assertion: 'Wrong-customer ticket is absent after applying the customer filter.',
|
|
1188
|
-
status: 'pass',
|
|
1189
|
-
route: '/support',
|
|
1190
|
-
action: 'Apply customer filter and reload.',
|
|
1191
|
-
expected: 'Only Customer B tickets are visible.',
|
|
1192
|
-
observed: 'Customer A ticket was not rendered.',
|
|
1193
|
-
dataProof: 'DOM and query proof matched the diagnosis proof plan.',
|
|
1194
|
-
artifactPaths: ['qa-artifacts/stored-business-proof.json'],
|
|
1195
|
-
metadata: { supportDiagnosisProof: true }
|
|
1196
|
-
}]
|
|
1197
|
-
},
|
|
1198
|
-
supportV5AutonomousDecision: {
|
|
1199
|
-
business_proof_readiness: {
|
|
1200
|
-
ready: true,
|
|
1201
|
-
status: 'passed',
|
|
1202
|
-
reason: 'Stored support business proof matched the diagnosis.',
|
|
1203
|
-
artifact_paths: ['qa-artifacts/stored-business-proof.json']
|
|
1204
|
-
},
|
|
1205
|
-
customer_reply_policy: {
|
|
1206
|
-
action: 'draft_resolution_reply',
|
|
1207
|
-
canDraftCustomerReply: true,
|
|
1208
|
-
canSendCustomerReply: false,
|
|
1209
|
-
confidenceLevel: 'high',
|
|
1210
|
-
safety: 'safe_to_draft',
|
|
1211
|
-
reason: 'support_reply_resolution_draft_allowed_after_business_proof',
|
|
1212
|
-
humanReviewPacket: {
|
|
1213
|
-
reviewType: 'customer_resolution_reply',
|
|
1214
|
-
primaryAction: 'review_customer_reply',
|
|
1215
|
-
customerFacingDraftAllowed: true,
|
|
1216
|
-
customerSendAllowed: false,
|
|
1217
|
-
requiresHumanApproval: true,
|
|
1218
|
-
evidenceRefs: ['qa-artifacts/stored-business-proof.json']
|
|
1219
|
-
},
|
|
1220
|
-
readinessContract: {
|
|
1221
|
-
contractId: 'support-customer-reply-stored-proof',
|
|
1222
|
-
status: 'draft_ready',
|
|
1223
|
-
policyAction: 'draft_resolution_reply',
|
|
1224
|
-
reviewType: 'customer_resolution_reply',
|
|
1225
|
-
primaryCommand: 'review_customer_reply',
|
|
1226
|
-
canDraftCustomerReply: true,
|
|
1227
|
-
canSendCustomerReply: false,
|
|
1228
|
-
requiresHumanApproval: true,
|
|
1229
|
-
proofBacked: true,
|
|
1230
|
-
businessProofReady: true,
|
|
1231
|
-
releaseReady: true,
|
|
1232
|
-
diagnosisReady: true,
|
|
1233
|
-
issueClassProbePlanReady: true,
|
|
1234
|
-
clarificationRequired: false,
|
|
1235
|
-
reason: 'support_reply_resolution_draft_allowed_after_business_proof',
|
|
1236
|
-
blockers: [],
|
|
1237
|
-
requiredEvidence: ['AIQaBusinessAssertion status=pass'],
|
|
1238
|
-
evidenceRefs: ['qa-artifacts/stored-business-proof.json'],
|
|
1239
|
-
nextCommands: ['review_customer_reply'],
|
|
1240
|
-
forbiddenActions: ['Do not send customer email without explicit human approval.'],
|
|
1241
|
-
createdAt: '2026-06-06T00:00:00.000Z'
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
});
|
|
1247
|
-
assert.equal(supportJobStoredBusinessProofRun.outcome, 'accepted');
|
|
1248
|
-
assert.equal(supportJobStoredBusinessProofRun.qa?.businessAssertions.length, 1);
|
|
1249
|
-
assert.equal(supportJobStoredBusinessProofRun.gates.some((gate) => gate.key === 'support_business_proof_readiness' && gate.status === 'pass'), true);
|
|
1250
|
-
assert.equal(supportJobStoredBusinessProofRun.metadata?.businessProofReadiness?.ready, true);
|
|
1251
|
-
assert.equal(supportJobStoredBusinessProofRun.gates.some((gate) => gate.key === 'support_customer_reply_policy' && gate.status === 'warn'), true);
|
|
1252
|
-
assert.equal(supportJobStoredBusinessProofRun.gates.some((gate) => gate.key === 'support_customer_reply_readiness' && gate.status === 'warn'), true);
|
|
1253
|
-
assert.equal(supportJobStoredBusinessProofRun.metadata?.customerReplyPolicy?.reviewType, 'customer_resolution_reply');
|
|
1254
|
-
assert.equal(supportJobStoredBusinessProofRun.metadata?.customerReplyPolicy?.canSendCustomerReply, false);
|
|
1255
|
-
assert.equal(supportJobStoredBusinessProofRun.metadata?.customerReplyReadiness?.status, 'draft_ready');
|
|
1256
|
-
assert.equal(supportJobStoredBusinessProofRun.metadata?.customerReplyReadiness?.proofBacked, true);
|
|
1257
|
-
|
|
1258
|
-
const supportClarificationContractRun = buildSupportAIRunFromEvidence({
|
|
1259
|
-
ticket: { _id: 'ticket-004431', ticketNumber: '004431', title: 'Needs reproduction detail' },
|
|
1260
|
-
job: {
|
|
1261
|
-
_id: 'support-job-clarification-contract',
|
|
1262
|
-
status: 'Blocked',
|
|
1263
|
-
phase: 'REVIEW',
|
|
1264
|
-
customerReplyPolicy: {
|
|
1265
|
-
action: 'ask_clarification',
|
|
1266
|
-
canDraftCustomerReply: true,
|
|
1267
|
-
canSendCustomerReply: false,
|
|
1268
|
-
confidenceLevel: 'low',
|
|
1269
|
-
safety: 'needs_clarification',
|
|
1270
|
-
reason: 'support_reply_waiting_on_customer_reproduction_detail',
|
|
1271
|
-
clarificationQuestion: 'Can you provide the exact invoice number where the export fails?',
|
|
1272
|
-
clarificationContract: {
|
|
1273
|
-
contractId: 'support-clarification-invoice-export',
|
|
1274
|
-
status: 'ready',
|
|
1275
|
-
missingField: 'reproduction_blocker',
|
|
1276
|
-
question: 'Can you provide the exact invoice number where the export fails?',
|
|
1277
|
-
sourceBlockers: ['Need an invoice number to reproduce the PDF/export issue.'],
|
|
1278
|
-
oneQuestionOnly: true,
|
|
1279
|
-
customerFacingDraftAllowed: true,
|
|
1280
|
-
customerSendAllowed: false,
|
|
1281
|
-
parksTicketUntilCustomerReply: true,
|
|
1282
|
-
nextCommands: ['review_customer_clarification', 'send_after_human_review', 'park_ticket_until_customer_reply'],
|
|
1283
|
-
forbiddenActions: ['Do not run product repair from a guessed reproduction path.'],
|
|
1284
|
-
requiredEvidence: ['missing_field=reproduction_blocker', 'one customer-facing question'],
|
|
1285
|
-
createdAt: '2026-06-06T00:00:00.000Z'
|
|
1286
|
-
},
|
|
1287
|
-
humanReviewPacket: {
|
|
1288
|
-
reviewType: 'customer_clarification',
|
|
1289
|
-
primaryAction: 'review_customer_clarification',
|
|
1290
|
-
question: 'Can you provide the exact invoice number where the export fails?',
|
|
1291
|
-
customerFacingDraftAllowed: true,
|
|
1292
|
-
customerSendAllowed: false,
|
|
1293
|
-
requiresHumanApproval: true,
|
|
1294
|
-
blockers: ['Need an invoice number to reproduce the PDF/export issue.']
|
|
1295
|
-
},
|
|
1296
|
-
readinessContract: {
|
|
1297
|
-
contractId: 'support-customer-reply-clarification',
|
|
1298
|
-
status: 'clarification_required',
|
|
1299
|
-
policyAction: 'ask_clarification',
|
|
1300
|
-
reviewType: 'customer_clarification',
|
|
1301
|
-
primaryCommand: 'review_customer_clarification',
|
|
1302
|
-
canDraftCustomerReply: true,
|
|
1303
|
-
canSendCustomerReply: false,
|
|
1304
|
-
requiresHumanApproval: true,
|
|
1305
|
-
proofBacked: false,
|
|
1306
|
-
businessProofReady: false,
|
|
1307
|
-
releaseReady: true,
|
|
1308
|
-
diagnosisReady: false,
|
|
1309
|
-
issueClassProbePlanReady: false,
|
|
1310
|
-
clarificationRequired: true,
|
|
1311
|
-
reason: 'support_reply_waiting_on_customer_reproduction_detail',
|
|
1312
|
-
blockers: ['Need an invoice number to reproduce the PDF/export issue.'],
|
|
1313
|
-
requiredEvidence: ['one customer-facing question'],
|
|
1314
|
-
evidenceRefs: [],
|
|
1315
|
-
nextCommands: ['review_customer_clarification', 'park_ticket_until_customer_reply'],
|
|
1316
|
-
forbiddenActions: ['Do not send customer email without explicit human approval.'],
|
|
1317
|
-
createdAt: '2026-06-06T00:00:00.000Z'
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
});
|
|
1322
|
-
const supportClarificationPolicyGate = supportClarificationContractRun.gates.find((gate) => gate.key === 'support_customer_reply_policy');
|
|
1323
|
-
assert.equal(supportClarificationPolicyGate?.status, 'warn');
|
|
1324
|
-
assert.equal(supportClarificationPolicyGate?.metadata?.clarificationContractStatus, 'ready');
|
|
1325
|
-
assert.equal(supportClarificationPolicyGate?.metadata?.clarificationMissingField, 'reproduction_blocker');
|
|
1326
|
-
assert.equal(supportClarificationPolicyGate?.metadata?.clarificationOneQuestionOnly, true);
|
|
1327
|
-
assert.equal(supportClarificationPolicyGate?.metadata?.clarificationParksTicket, true);
|
|
1328
|
-
const supportClarificationReadinessGate = supportClarificationContractRun.gates.find((gate) => gate.key === 'support_customer_reply_readiness');
|
|
1329
|
-
assert.equal(supportClarificationReadinessGate?.status, 'warn');
|
|
1330
|
-
assert.equal(supportClarificationReadinessGate?.metadata?.status, 'clarification_required');
|
|
1331
|
-
assert.equal(supportClarificationReadinessGate?.metadata?.primaryCommand, 'review_customer_clarification');
|
|
1332
|
-
assert.equal(supportClarificationContractRun.metadata?.customerReplyPolicy?.clarificationContract?.oneQuestionOnly, true);
|
|
1333
|
-
assert.equal(supportClarificationContractRun.metadata?.customerReplyPolicy?.clarificationContract?.parksTicketUntilCustomerReply, true);
|
|
1334
|
-
assert.equal(supportClarificationContractRun.metadata?.customerReplyPolicy?.canSendCustomerReply, false);
|
|
1335
|
-
assert.equal(supportClarificationContractRun.metadata?.customerReplyReadiness?.status, 'clarification_required');
|
|
1336
|
-
|
|
1337
|
-
const supportRouteOnlyReadinessRun = buildSupportAIRunFromEvidence({
|
|
1338
|
-
ticket: { _id: 'ticket-004432', ticketNumber: '004432', title: 'Stored route-only support proof' },
|
|
1339
|
-
job: {
|
|
1340
|
-
_id: 'support-job-route-only-readiness',
|
|
1341
|
-
status: 'Closed',
|
|
1342
|
-
phase: 'COMPLETE',
|
|
1343
|
-
supportV5DiagnosisGate: supportAcceptedDiagnosisGate,
|
|
1344
|
-
supportQaValidationCursor: {
|
|
1345
|
-
workflow_probe: {
|
|
1346
|
-
route: '/support',
|
|
1347
|
-
status: 'pass',
|
|
1348
|
-
screenshot: 'qa-artifacts/route-only.png',
|
|
1349
|
-
message: 'Route loaded but no business assertion ran.'
|
|
1350
|
-
}
|
|
1351
|
-
},
|
|
1352
|
-
supportV5AutonomousDecision: {
|
|
1353
|
-
business_proof_readiness: {
|
|
1354
|
-
ready: false,
|
|
1355
|
-
status: 'route_only',
|
|
1356
|
-
reason: 'Route probe is not business proof.',
|
|
1357
|
-
blockers: ['Run the issue-class business assertion.'],
|
|
1358
|
-
artifact_paths: ['qa-artifacts/route-only.png']
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
assert.notEqual(supportRouteOnlyReadinessRun.outcome, 'accepted');
|
|
1364
|
-
assert.equal(supportRouteOnlyReadinessRun.gates.some((gate) => gate.key === 'support_business_proof_readiness' && gate.status === 'blocked'), true);
|
|
1365
|
-
assert.equal(supportRouteOnlyReadinessRun.metadata?.businessProofReadiness?.status, 'route_only');
|
|
1366
|
-
|
|
1367
|
-
const aicoderJourneyContract = {
|
|
1368
|
-
app_archetype: 'optimizer',
|
|
1369
|
-
primary_actor: 'Operations planner',
|
|
1370
|
-
primary_goal: 'Create a saved hose pressure recommendation for a field route.',
|
|
1371
|
-
primary_workflow_id: 'layflat-optimizer',
|
|
1372
|
-
first_screen: {
|
|
1373
|
-
route: '/dashboard/hub',
|
|
1374
|
-
purpose: 'Command center showing active scenarios and next optimizer action.',
|
|
1375
|
-
visible_cta: 'Start optimizer scenario',
|
|
1376
|
-
next_step: 'Open assumptions for the seeded route.'
|
|
1377
|
-
},
|
|
1378
|
-
north_star_workflow: [{
|
|
1379
|
-
position: 'first',
|
|
1380
|
-
id: 'start-scenario',
|
|
1381
|
-
route: '/dashboard/hub',
|
|
1382
|
-
visible_cta: 'Start optimizer scenario',
|
|
1383
|
-
data_input_or_selection: 'Select North Field route.',
|
|
1384
|
-
method_or_calculation: 'local calculation path optimizerScenarioDraft',
|
|
1385
|
-
expected_state_transition: 'Scenario assumptions panel opens.',
|
|
1386
|
-
success_confirmation: 'Scenario ready badge appears.',
|
|
1387
|
-
next_step_destination: '/dashboard/hub?scenario=active'
|
|
1388
|
-
}, {
|
|
1389
|
-
position: 'next',
|
|
1390
|
-
id: 'run-optimizer',
|
|
1391
|
-
route: '/dashboard/hub',
|
|
1392
|
-
visible_cta: 'Run optimization',
|
|
1393
|
-
data_input_or_selection: 'Confirm pressure limit, terrain, pump, and hose specs.',
|
|
1394
|
-
method_or_calculation: 'local calculation path runLayflatPressureOptimizer and server method saveOptimizerResult',
|
|
1395
|
-
expected_state_transition: 'Alternatives table and recommendation card update.',
|
|
1396
|
-
success_confirmation: 'Recommendation calculated badge appears.',
|
|
1397
|
-
next_step_destination: '/dashboard/hub?result=compare'
|
|
1398
|
-
}, {
|
|
1399
|
-
position: 'last',
|
|
1400
|
-
id: 'save-report',
|
|
1401
|
-
route: '/reports/optimizer',
|
|
1402
|
-
visible_cta: 'Save recommendation report',
|
|
1403
|
-
data_input_or_selection: 'Choose the recommended hose plan.',
|
|
1404
|
-
method_or_calculation: 'server method publishOptimizerRecommendation',
|
|
1405
|
-
expected_state_transition: 'Saved report row appears.',
|
|
1406
|
-
success_confirmation: 'Recommendation saved message appears.',
|
|
1407
|
-
final_result: 'Saved optimizer recommendation with exportable pressure report.'
|
|
1408
|
-
}],
|
|
1409
|
-
secondary_workflows: [
|
|
1410
|
-
{ id: 'setup', route: '/manage/settings', purpose: 'Maintain pump defaults.' },
|
|
1411
|
-
{ id: 'report-export', route: '/reports/optimizer', purpose: 'Review saved recommendations.' },
|
|
1412
|
-
{ id: 'recovery', route: '/dashboard/hub', purpose: 'Handle invalid pressure states.' }
|
|
1413
|
-
],
|
|
1414
|
-
screen_sequence: [{
|
|
1415
|
-
route: '/dashboard/hub',
|
|
1416
|
-
screen_purpose: 'Command center with seeded scenario and embedded optimizer action.',
|
|
1417
|
-
visible_cta: 'Start optimizer scenario',
|
|
1418
|
-
action: 'Open scenario assumptions',
|
|
1419
|
-
method_or_calculation: 'local calculation path optimizerScenarioDraft',
|
|
1420
|
-
expected_next_state: 'Scenario assumptions are visible.',
|
|
1421
|
-
data_shown: 'Seeded route, elevation, pump, hose, and pressure-limit records.'
|
|
1422
|
-
}, {
|
|
1423
|
-
route: '/dashboard/hub',
|
|
1424
|
-
screen_purpose: 'Run optimizer and compare alternatives.',
|
|
1425
|
-
visible_cta: 'Run optimization',
|
|
1426
|
-
action: 'Calculate pressure recommendation',
|
|
1427
|
-
method_or_calculation: 'local calculation path runLayflatPressureOptimizer',
|
|
1428
|
-
expected_next_state: 'Recommendation and alternatives update.',
|
|
1429
|
-
data_shown: 'Comparison table and recommendation card.'
|
|
1430
|
-
}, {
|
|
1431
|
-
route: '/reports/optimizer',
|
|
1432
|
-
screen_purpose: 'Save and export recommendation report.',
|
|
1433
|
-
visible_cta: 'Save recommendation report',
|
|
1434
|
-
action: 'Persist recommendation report',
|
|
1435
|
-
method_or_calculation: 'server method publishOptimizerRecommendation',
|
|
1436
|
-
expected_next_state: 'Saved report row and export button visible.',
|
|
1437
|
-
data_shown: 'Saved recommendation and calculated pressure.'
|
|
1438
|
-
}],
|
|
1439
|
-
data_story: {
|
|
1440
|
-
seeded_scenario: 'North Field irrigation route with elevation changes, pumps, and hose alternatives.',
|
|
1441
|
-
records: ['North Field route', 'Pump A', 'Pump B', '4-inch layflat hose', '6-inch layflat hose'],
|
|
1442
|
-
relationships: ['Route uses pump options', 'Pump options feed hose alternatives', 'Optimization result belongs to scenario'],
|
|
1443
|
-
non_empty_states: ['Dashboard KPIs show pressure and flow.', 'Reports table shows saved recommendation row.']
|
|
1444
|
-
},
|
|
1445
|
-
completion_states: [
|
|
1446
|
-
'Recommendation card shows selected hose and pressure margin.',
|
|
1447
|
-
'Report route lists saved recommendation with export action.'
|
|
1448
|
-
],
|
|
1449
|
-
qa_assertions: [{
|
|
1450
|
-
id: 'login-hub',
|
|
1451
|
-
route: '/dashboard/hub',
|
|
1452
|
-
coverage_tags: ['login', 'hub_action', 'non_empty_data'],
|
|
1453
|
-
proof_kind: 'login',
|
|
1454
|
-
action: 'Login and land on dashboard hub.',
|
|
1455
|
-
expected_dom_or_data_proof: 'Hub shows seeded North Field scenario and non-empty KPIs.'
|
|
1456
|
-
}, {
|
|
1457
|
-
id: 'primary-hub-action',
|
|
1458
|
-
route: '/dashboard/hub',
|
|
1459
|
-
coverage_tags: ['hub_action'],
|
|
1460
|
-
proof_kind: 'hub_action',
|
|
1461
|
-
action: 'Click Start optimizer scenario.',
|
|
1462
|
-
expected_dom_or_data_proof: 'Scenario assumptions panel opens with seeded route and pump records.'
|
|
1463
|
-
}, {
|
|
1464
|
-
id: 'workflow-completion',
|
|
1465
|
-
route: '/dashboard/hub',
|
|
1466
|
-
coverage_tags: ['workflow_completion', 'report_export'],
|
|
1467
|
-
proof_kind: 'report_export',
|
|
1468
|
-
action: 'Run optimization and save recommendation.',
|
|
1469
|
-
expected_dom_or_data_proof: 'Saved recommendation report row appears with calculated pressure result.'
|
|
1470
|
-
}, {
|
|
1471
|
-
id: 'mobile-viewport',
|
|
1472
|
-
route: '/dashboard/hub',
|
|
1473
|
-
coverage_tags: ['mobile', 'workflow_completion'],
|
|
1474
|
-
proof_kind: 'mobile',
|
|
1475
|
-
action: 'Repeat primary optimizer path at mobile viewport 390x844.',
|
|
1476
|
-
expected_dom_or_data_proof: 'Mobile hub shows non-empty scenario and recommendation controls.',
|
|
1477
|
-
viewport: '390x844 mobile'
|
|
1478
|
-
}, {
|
|
1479
|
-
id: 'empty-error-recovery',
|
|
1480
|
-
route: '/dashboard/hub',
|
|
1481
|
-
coverage_tags: ['recovery'],
|
|
1482
|
-
proof_kind: 'recovery',
|
|
1483
|
-
action: 'Clear scenario input and submit invalid pressure limit.',
|
|
1484
|
-
expected_dom_or_data_proof: 'Empty/error recovery message appears and Start optimizer scenario remains available.'
|
|
1485
|
-
}]
|
|
1486
|
-
};
|
|
1487
|
-
const aicoderWorkflowQaRows = aicoderJourneyContract.qa_assertions.map((row, index) => ({
|
|
1488
|
-
index: index + 1,
|
|
1489
|
-
workflowId: 'layflat-optimizer',
|
|
1490
|
-
stepId: row.id,
|
|
1491
|
-
route: row.route,
|
|
1492
|
-
action: row.action,
|
|
1493
|
-
assertion: row.expected_dom_or_data_proof,
|
|
1494
|
-
expectedState: row.expected_dom_or_data_proof,
|
|
1495
|
-
status: 'pass',
|
|
1496
|
-
artifactPaths: [`qa-artifacts/${row.id}.json`]
|
|
1497
|
-
}));
|
|
1498
|
-
const aicoderWorkflowBusinessAssertions = aicoderWorkflowQaRows.map((row) => ({
|
|
1499
|
-
stepId: row.stepId,
|
|
1500
|
-
workflowId: row.workflowId,
|
|
1501
|
-
route: row.route,
|
|
1502
|
-
action: row.action,
|
|
1503
|
-
assertion: row.assertion,
|
|
1504
|
-
status: 'pass',
|
|
1505
|
-
observed: `${row.stepId} produced the expected visible workflow state.`,
|
|
1506
|
-
dataProof: `${row.stepId} has observed DOM/data proof from seeded Layflat records.`,
|
|
1507
|
-
artifactPaths: row.artifactPaths
|
|
1508
|
-
}));
|
|
1509
|
-
|
|
1510
|
-
const aicoderRun = buildAICoderAIRunFromEvidence({
|
|
1511
|
-
app: { _id: 'layflat-app', name: 'Layflat Pressure Optimizer', domain: 'layflat.resolveio.app' },
|
|
1512
|
-
job: {
|
|
1513
|
-
_id: 'aicoder-job-1',
|
|
1514
|
-
phase: 'COMPLETE',
|
|
1515
|
-
status: 'Passed',
|
|
1516
|
-
managerHotfixEvidence: {
|
|
1517
|
-
channel: 'backend_js',
|
|
1518
|
-
target: {
|
|
1519
|
-
host: 'backend.aicoder.resolveio.com',
|
|
1520
|
-
path: '/var/app/current/http/runner-manager-selftest.js'
|
|
1521
|
-
},
|
|
1522
|
-
compiledArtifactPath: 'dist/http/runner-manager-selftest.js',
|
|
1523
|
-
remoteChecksumAfter: '3333333333333333333333333333333333333333333333333333333333333333',
|
|
1524
|
-
sourceCommitSha: '6fd400e1d8c961c1e88820292c323e688fdcc0a4',
|
|
1525
|
-
githubCommitUrl: 'https://github.com/resolveio/resolveio-all/commit/6fd400e1d8c961c1e88820292c323e688fdcc0a4',
|
|
1526
|
-
gitCommitStatus: 'passed',
|
|
1527
|
-
gitPushStatus: 'passed',
|
|
1528
|
-
restartEvidence: 'nodejs restarted on AICoder hosts',
|
|
1529
|
-
healthCheckStatus: 'passed',
|
|
1530
|
-
selfTestStatus: 'passed'
|
|
1531
|
-
},
|
|
1532
|
-
nextActionContract: {
|
|
1533
|
-
contractId: 'aicoder-next-release-hotfix',
|
|
1534
|
-
action: 'retry_same_step',
|
|
1535
|
-
label: 'Repair Release Gate',
|
|
1536
|
-
primaryCommand: 'repair_aicoder_release_gate',
|
|
1537
|
-
lane: 'publish',
|
|
1538
|
-
stepType: 'test_deploy',
|
|
1539
|
-
safeToAutoRun: true,
|
|
1540
|
-
requiresHumanApproval: false,
|
|
1541
|
-
canRunWithoutCodexMonitor: true,
|
|
1542
|
-
codexFallbackRequired: false,
|
|
1543
|
-
costRisk: 'release_or_customer_send',
|
|
1544
|
-
workflowFirstSatisfied: false,
|
|
1545
|
-
decisionBasis: {
|
|
1546
|
-
releaseBlocked: true,
|
|
1547
|
-
hotfixCommitRequired: true,
|
|
1548
|
-
liveHotfixBlockedUntilCommit: true
|
|
1549
|
-
},
|
|
1550
|
-
requiredHotfixCommitProof: ['sourceCommitSha', 'githubCommitUrl', 'gitCommitStatus=passed', 'gitPushStatus=passed'],
|
|
1551
|
-
preconditions: ['sourceCommitSha, githubCommitUrl, passed gitCommitStatus, and passed gitPushStatus before live hotfix apply'],
|
|
1552
|
-
successEvidence: ['GitHub commit and push proof for any manager-applied hotfix'],
|
|
1553
|
-
stopConditions: ['Do not apply a live AICoder backend/static hotfix until sourceCommitSha, githubCommitUrl, passed gitCommitStatus, and passed gitPushStatus are recorded.'],
|
|
1554
|
-
forbiddenActions: ['applying live hotfix before pushed GitHub commit proof'],
|
|
1555
|
-
nextCommands: ['repair_aicoder_release_gate', 'commit_and_push_hotfix_to_github', 'apply_live_hotfix_only_after_github_commit_proof'],
|
|
1556
|
-
blockers: ['Sample data release gate is blocked.']
|
|
1557
|
-
}
|
|
1558
|
-
},
|
|
1559
|
-
usageLedger: [{
|
|
1560
|
-
model: 'codex-manual',
|
|
1561
|
-
category: 'manual-codex-builder-monitor',
|
|
1562
|
-
usage_source: 'manual_codex',
|
|
1563
|
-
usage_surface: 'aicoder',
|
|
1564
|
-
cost_basis: 'manual_estimate',
|
|
1565
|
-
is_manual: true,
|
|
1566
|
-
is_untracked: true,
|
|
1567
|
-
untracked_reason: 'Sidecar Codex session watched the Layflat builder.',
|
|
1568
|
-
total_tokens: 0,
|
|
1569
|
-
cost_estimate: 42
|
|
1570
|
-
}],
|
|
1571
|
-
qaEvidence: {
|
|
1572
|
-
journeyContract: aicoderJourneyContract,
|
|
1573
|
-
workflowQaRows: aicoderWorkflowQaRows,
|
|
1574
|
-
scorecardPassed: true,
|
|
1575
|
-
deployStatus: 'pass',
|
|
1576
|
-
publishStatus: 'published',
|
|
1577
|
-
sampleDataStatus: 'empty seed collections',
|
|
1578
|
-
compile: { status: 'pass' },
|
|
1579
|
-
routeProbes: [{ route: '/optimizer', status: 'pass' }],
|
|
1580
|
-
businessAssertions: aicoderWorkflowBusinessAssertions
|
|
1581
|
-
}
|
|
1582
|
-
});
|
|
1583
|
-
assert.equal(aicoderRun.source, 'aicoder_app');
|
|
1584
|
-
assert.equal(aicoderRun.outcome, 'release_blocked');
|
|
1585
|
-
assert.equal(aicoderRun.events.some((event) => event.type === 'hotfix' && event.metadata?.hotfixSatisfied === true), true);
|
|
1586
|
-
assert.equal(aicoderRun.gates.some((gate) => gate.key === 'hotfix_commit_proof' && gate.status === 'pass'), true);
|
|
1587
|
-
assert.equal(aicoderRun.gates.some((gate) => gate.key === 'aicoder_workflow_proof_readiness' && gate.status === 'fail'), true);
|
|
1588
|
-
assert.equal(aicoderRun.metadata?.journeyContract?.workflowQaCoverageTags?.includes('workflow_completion'), true);
|
|
1589
|
-
assert.equal(aicoderRun.metadata?.journeyContract?.workflowQaProofKinds?.includes('report_export'), true);
|
|
1590
|
-
assert.equal(aicoderRun.metadata?.workflowProofReadiness?.status, 'release_blocked');
|
|
1591
|
-
assert.equal(aicoderRun.metadata?.hotfixDurability?.commitProofPassed, true);
|
|
1592
|
-
assert.equal(aicoderRun.metadata?.hotfixDurability?.commitFirstProtocolSatisfied, true);
|
|
1593
|
-
assert.equal(aicoderRun.metadata?.hotfixDurability?.liveHotfixAllowed, true);
|
|
1594
|
-
assert.equal(aicoderRun.metadata?.hotfixDurability?.commitBlocked, false);
|
|
1595
|
-
assert.equal(aicoderRun.gates.some((gate) => gate.key === 'cost_observability' && gate.status === 'warn'), true);
|
|
1596
|
-
assert.equal(aicoderRun.metadata?.costObservability?.externalCodexMonitorUsed, true);
|
|
1597
|
-
assert.equal(aicoderRun.metadata?.costObservability?.untrackedEstimatedUsd, 42);
|
|
1598
|
-
assert.equal(aicoderRun.metadata?.nextActionContract?.primaryCommand, 'repair_aicoder_release_gate');
|
|
1599
|
-
assert.equal(aicoderRun.metadata?.nextActionContract?.hotfixCommitRequired, true);
|
|
1600
|
-
assert.equal(aicoderRun.metadata?.nextActionContract?.liveHotfixBlockedUntilCommit, true);
|
|
1601
|
-
assert.deepEqual(aicoderRun.metadata?.nextActionContract?.requiredHotfixCommitProof, ['sourceCommitSha', 'githubCommitUrl', 'gitCommitStatus=passed', 'gitPushStatus=passed']);
|
|
1602
|
-
|
|
1603
|
-
const aicoderRouteOnlyRun = buildAICoderAIRunFromEvidence({
|
|
1604
|
-
app: { _id: 'route-only-app', name: 'Route Only App' },
|
|
1605
|
-
job: {
|
|
1606
|
-
_id: 'aicoder-route-only',
|
|
1607
|
-
phase: 'COMPLETE',
|
|
1608
|
-
status: 'Passed',
|
|
1609
|
-
workflowProofCheckpoint: {
|
|
1610
|
-
required: true,
|
|
1611
|
-
status: 'waiting_for_workflow_proof',
|
|
1612
|
-
readinessStatus: 'workflow_qa_required',
|
|
1613
|
-
nextGate: 'workflow_qa',
|
|
1614
|
-
workflowProofFingerprint: 'aicoder-workflow-proof-route-only',
|
|
1615
|
-
artifactFingerprint: 'aicoder-workflow-artifacts-route-only',
|
|
1616
|
-
requiredEvidence: ['AIQaBusinessAssertion tied to journey_contract.qa_assertions'],
|
|
1617
|
-
requiredResetEvidence: ['new workflow proof fingerprint', 'fresh workflow QA artifact'],
|
|
1618
|
-
successRequiresWorkflowBusinessProof: true,
|
|
1619
|
-
blocksProductRepairUntilJourneyContract: false,
|
|
1620
|
-
blocksPublishUntilWorkflowProof: true,
|
|
1621
|
-
blocksPublishUntilReleaseGate: false,
|
|
1622
|
-
blocksWowUiUntilWorkflowProof: true,
|
|
1623
|
-
nextAction: 'Run workflow QA from the journey contract before publish or wow UI polish.'
|
|
1624
|
-
},
|
|
1625
|
-
nextActionContract: {
|
|
1626
|
-
contractId: 'aicoder-next-route-only',
|
|
1627
|
-
action: 'retry_same_step',
|
|
1628
|
-
label: 'Run Workflow QA',
|
|
1629
|
-
primaryCommand: 'run_aicoder_workflow_qa',
|
|
1630
|
-
lane: 'qa',
|
|
1631
|
-
stepType: 'workflow_qa',
|
|
1632
|
-
safeToAutoRun: true,
|
|
1633
|
-
requiresHumanApproval: false,
|
|
1634
|
-
canRunWithoutCodexMonitor: true,
|
|
1635
|
-
codexFallbackRequired: false,
|
|
1636
|
-
costRisk: 'small_model_or_qa',
|
|
1637
|
-
workflowFirstSatisfied: false,
|
|
1638
|
-
decisionBasis: {
|
|
1639
|
-
journeyContractReady: true,
|
|
1640
|
-
workflowProofReady: false,
|
|
1641
|
-
routeOnlyBlocked: true
|
|
1642
|
-
},
|
|
1643
|
-
preconditions: ['workflow QA rows generated from the journey contract'],
|
|
1644
|
-
expectedStateTransition: 'Route/browser evidence becomes AIQaBusinessAssertion proof for the north-star workflow.',
|
|
1645
|
-
successEvidence: ['AIQaBusinessAssertion tied to journey_contract.qa_assertions'],
|
|
1646
|
-
stopConditions: ['Route-only proof must stay labeled as route evidence, not acceptance.'],
|
|
1647
|
-
forbiddenActions: ['accepting route-only proof as app success'],
|
|
1648
|
-
nextCommands: ['run_aicoder_workflow_qa', 'record_aiqa_business_assertion'],
|
|
1649
|
-
blockers: ['Route-only proof blocks publish.']
|
|
1650
|
-
}
|
|
1651
|
-
},
|
|
1652
|
-
qaEvidence: {
|
|
1653
|
-
journeyContract: aicoderJourneyContract,
|
|
1654
|
-
scorecardPassed: true,
|
|
1655
|
-
compile: { status: 'pass' },
|
|
1656
|
-
routeProbes: [{ route: '/dashboard/hub', status: 'pass' }],
|
|
1657
|
-
deployStatus: 'pass',
|
|
1658
|
-
publishStatus: 'published',
|
|
1659
|
-
sampleDataStatus: 'pass'
|
|
1660
|
-
}
|
|
1661
|
-
});
|
|
1662
|
-
assert.equal(aicoderRouteOnlyRun.outcome, 'false_pass');
|
|
1663
|
-
assert.equal(aicoderRouteOnlyRun.gates.some((gate) => gate.key === 'aicoder_workflow_proof_readiness' && gate.status === 'blocked'), true);
|
|
1664
|
-
assert.equal(aicoderRouteOnlyRun.gates.some((gate) => gate.key === 'aicoder_workflow_proof_checkpoint' && gate.status === 'blocked'), true);
|
|
1665
|
-
assert.equal(aicoderRouteOnlyRun.metadata?.workflowProofReadiness?.status, 'route_only');
|
|
1666
|
-
assert.equal(aicoderRouteOnlyRun.metadata?.workflowProofCheckpoint?.blocksPublishUntilWorkflowProof, true);
|
|
1667
|
-
assert.equal(aicoderRouteOnlyRun.metadata?.workflowProofCheckpoint?.blocksWowUiUntilWorkflowProof, true);
|
|
1668
|
-
assert.equal(aicoderRouteOnlyRun.events.some((event) => event.category === 'aicoder_workflow_proof_checkpoint'), true);
|
|
1669
|
-
assert.equal(aicoderRouteOnlyRun.gates.some((gate) => gate.key === 'aicoder_next_action_contract' && gate.status === 'pass'), true);
|
|
1670
|
-
assert.equal(aicoderRouteOnlyRun.metadata?.nextActionContract?.primaryCommand, 'run_aicoder_workflow_qa');
|
|
1671
|
-
assert.equal(aicoderRouteOnlyRun.metadata?.nextActionContract?.canRunWithoutCodexMonitor, true);
|
|
1672
|
-
assert.equal(aicoderRouteOnlyRun.metadata?.nextActionContract?.costRisk, 'small_model_or_qa');
|
|
1673
|
-
assert.equal(aicoderRouteOnlyRun.events.some((event) => event.category === 'aicoder_next_action_contract'), true);
|
|
1674
|
-
|
|
1675
|
-
const aicoderCodexFallbackBlockedRun = buildAICoderAIRunFromEvidence({
|
|
1676
|
-
app: { _id: 'codex-fallback-app', name: 'Codex Fallback Blocked App' },
|
|
1677
|
-
job: {
|
|
1678
|
-
_id: 'aicoder-codex-fallback-blocked',
|
|
1679
|
-
phase: 'QA',
|
|
1680
|
-
status: 'Running',
|
|
1681
|
-
nextActionContract: {
|
|
1682
|
-
contractId: 'aicoder-next-codex-fallback',
|
|
1683
|
-
action: 'retry_same_step',
|
|
1684
|
-
label: 'Run Scoped Repair',
|
|
1685
|
-
primaryCommand: 'run_aicoder_owner_scoped_repair',
|
|
1686
|
-
lane: 'repair',
|
|
1687
|
-
stepType: 'repair',
|
|
1688
|
-
safeToAutoRun: false,
|
|
1689
|
-
requiresHumanApproval: false,
|
|
1690
|
-
canRunWithoutCodexMonitor: false,
|
|
1691
|
-
codexFallbackRequired: true,
|
|
1692
|
-
codexFallbackReason: 'owner_files_or_workflow_proof_missing',
|
|
1693
|
-
costRisk: 'expensive_model',
|
|
1694
|
-
workflowFirstSatisfied: true,
|
|
1695
|
-
blockers: ['Owner-file repair scope is missing.'],
|
|
1696
|
-
stopConditions: ['Do not run repair without owner scope.'],
|
|
1697
|
-
nextCommands: ['collect_aicoder_owner_scope']
|
|
1698
|
-
}
|
|
1699
|
-
},
|
|
1700
|
-
qaEvidence: {
|
|
1701
|
-
journeyContract: aicoderJourneyContract,
|
|
1702
|
-
workflowQaRows: aicoderWorkflowQaRows,
|
|
1703
|
-
scorecardPassed: false,
|
|
1704
|
-
compile: { status: 'pass' },
|
|
1705
|
-
routeProbes: [{ route: '/dashboard/hub', status: 'pass' }],
|
|
1706
|
-
deployStatus: 'pass',
|
|
1707
|
-
publishStatus: 'ready',
|
|
1708
|
-
sampleDataStatus: 'pass',
|
|
1709
|
-
businessAssertions: aicoderWorkflowBusinessAssertions
|
|
1710
|
-
}
|
|
1711
|
-
});
|
|
1712
|
-
assert.equal(aicoderCodexFallbackBlockedRun.outcome, 'manual_handoff');
|
|
1713
|
-
assert.equal(aicoderCodexFallbackBlockedRun.gates.some((gate) => gate.key === 'aicoder_next_action_contract' && gate.status === 'blocked'), true);
|
|
1714
|
-
assert.equal(aicoderCodexFallbackBlockedRun.metadata?.nextActionContract?.canRunWithoutCodexMonitor, false);
|
|
1715
|
-
assert.equal(aicoderCodexFallbackBlockedRun.metadata?.nextActionContract?.codexFallbackRequired, true);
|
|
1716
|
-
assert.ok(/validated AICoder next-action contract/i.test(String(aicoderCodexFallbackBlockedRun.nextAction || '')));
|
|
1717
|
-
|
|
1718
|
-
const aicoderMissingJourneyContractRun = buildAICoderAIRunFromEvidence({
|
|
1719
|
-
app: { _id: 'missing-journey-app', name: 'Missing Journey App' },
|
|
1720
|
-
job: {
|
|
1721
|
-
_id: 'aicoder-missing-journey',
|
|
1722
|
-
phase: 'COMPLETE',
|
|
1723
|
-
status: 'Passed'
|
|
1724
|
-
},
|
|
1725
|
-
qaEvidence: {
|
|
1726
|
-
scorecardPassed: true,
|
|
1727
|
-
compile: { status: 'pass' },
|
|
1728
|
-
routeProbes: [{ route: '/dashboard/hub', status: 'pass' }],
|
|
1729
|
-
deployStatus: 'pass',
|
|
1730
|
-
publishStatus: 'published',
|
|
1731
|
-
sampleDataStatus: 'pass'
|
|
1732
|
-
}
|
|
1733
|
-
});
|
|
1734
|
-
const aicoderMissingJourneyGate = aicoderMissingJourneyContractRun.gates.find((gate) => gate.key === 'aicoder_journey_contract');
|
|
1735
|
-
assert.equal(aicoderMissingJourneyContractRun.outcome, 'false_pass');
|
|
1736
|
-
assert.equal(aicoderMissingJourneyGate?.status, 'blocked');
|
|
1737
|
-
assert.equal(aicoderMissingJourneyGate?.metadata?.valid, false);
|
|
1738
|
-
assert.equal(aicoderMissingJourneyGate?.metadata?.blocksBuildUntilValid, true);
|
|
1739
|
-
assert.ok(Array.isArray(aicoderMissingJourneyGate?.metadata?.issueCodes));
|
|
1740
|
-
assert.ok((aicoderMissingJourneyGate?.metadata?.issueCodes || []).includes('missing_contract'));
|
|
1741
|
-
assert.equal(aicoderMissingJourneyContractRun.metadata?.journeyContract?.valid, false);
|
|
1742
|
-
assert.equal(aicoderMissingJourneyContractRun.metadata?.workflowProofReadiness?.status, 'missing_journey_contract');
|
|
1743
|
-
assert.equal(classifyAIRunFailureClass(aicoderMissingJourneyContractRun), 'journey_contract');
|
|
1744
|
-
const aicoderMissingJourneyRetry = decideAIRunRetry({ currentRun: aicoderMissingJourneyContractRun });
|
|
1745
|
-
assert.equal(aicoderMissingJourneyRetry.action, 'retry_journey_contract');
|
|
1746
|
-
assert.match(String(aicoderMissingJourneyRetry.nextAction || ''), /APP_JOURNEY_CONTRACT/i);
|
|
1747
|
-
assert.equal(aicoderMissingJourneyContractRun.events.some((event) => event.category === 'aicoder_journey_contract'), true);
|
|
1748
|
-
|
|
1749
|
-
const aicoderRepeatedJourneyRun = buildAICoderAIRunFromEvidence({
|
|
1750
|
-
app: { _id: 'repeated-journey-app', name: 'Repeated Journey App' },
|
|
1751
|
-
job: {
|
|
1752
|
-
_id: 'aicoder-repeated-journey',
|
|
1753
|
-
phase: 'Build',
|
|
1754
|
-
status: 'Running',
|
|
1755
|
-
aicoderV6Budget: { maxRepeatedNoProgress: 2 },
|
|
1756
|
-
aicoderV6StepHistory: [{
|
|
1757
|
-
lane: 'aicoder',
|
|
1758
|
-
stepType: 'journey_validation',
|
|
1759
|
-
outcome: 'needs_repair',
|
|
1760
|
-
failureClass: 'workflow',
|
|
1761
|
-
blocker: 'Journey contract still has no last saved/exported result.',
|
|
1762
|
-
evidenceHash: 'journey-missing-final-result',
|
|
1763
|
-
artifactPaths: ['qa/journey-contract-review.json']
|
|
1764
|
-
}, {
|
|
1765
|
-
lane: 'aicoder',
|
|
1766
|
-
stepType: 'journey_validation',
|
|
1767
|
-
outcome: 'needs_repair',
|
|
1768
|
-
failureClass: 'workflow',
|
|
1769
|
-
blocker: 'Journey contract still has no last saved/exported result.',
|
|
1770
|
-
evidenceHash: 'journey-missing-final-result',
|
|
1771
|
-
artifactPaths: ['qa/journey-contract-review.json']
|
|
1772
|
-
}]
|
|
1773
|
-
},
|
|
1774
|
-
qaEvidence: {
|
|
1775
|
-
journeyContract: aicoderJourneyContract,
|
|
1776
|
-
compile: { status: 'pass' },
|
|
1777
|
-
routeProbes: [{ route: '/dashboard/hub', status: 'pass' }]
|
|
1778
|
-
}
|
|
1779
|
-
});
|
|
1780
|
-
const aicoderRepeatedJourneyGate = aicoderRepeatedJourneyRun.gates.find((gate) => gate.key === 'manager_no_blind_loop_policy');
|
|
1781
|
-
assert.equal(aicoderRepeatedJourneyGate?.status, 'blocked');
|
|
1782
|
-
assert.equal(aicoderRepeatedJourneyGate?.metadata?.action, 'park_repeated_failure');
|
|
1783
|
-
assert.equal(aicoderRepeatedJourneyGate?.metadata?.requiresNewEvidence, true);
|
|
1784
|
-
assert.equal(aicoderRepeatedJourneyGate?.metadata?.productRepairAllowed, false);
|
|
1785
|
-
assert.equal(aicoderRepeatedJourneyRun.outcome, 'manual_handoff');
|
|
1786
|
-
assert.equal(aicoderRepeatedJourneyRun.events.some((event) => event.category === 'manager_no_blind_loop_policy'), true);
|
|
1787
|
-
assert.equal(aicoderRepeatedJourneyRun.metadata?.managerNoBlindLoopPolicy?.requiresNewEvidence, true);
|
|
1788
|
-
|
|
1789
|
-
const aicoderInfraRetryRun = buildAICoderAIRunFromEvidence({
|
|
1790
|
-
app: { _id: 'aicoder-infra-retry-app', name: 'AICoder Infra Retry App' },
|
|
1791
|
-
job: {
|
|
1792
|
-
_id: 'aicoder-infra-retry',
|
|
1793
|
-
phase: 'QA',
|
|
1794
|
-
status: 'Running',
|
|
1795
|
-
aicoderV6StepHistory: [{
|
|
1796
|
-
lane: 'qa',
|
|
1797
|
-
stepType: 'workflow_qa',
|
|
1798
|
-
outcome: 'needs_repair',
|
|
1799
|
-
failureClass: 'infra',
|
|
1800
|
-
blocker: 'Puppeteer module is missing before workflow QA can run.',
|
|
1801
|
-
evidenceHash: 'puppeteer-module-missing',
|
|
1802
|
-
artifactPaths: ['qa/puppeteer-preflight.log']
|
|
1803
|
-
}]
|
|
1804
|
-
},
|
|
1805
|
-
qaEvidence: {
|
|
1806
|
-
infraChecks: [{
|
|
1807
|
-
name: 'puppeteer_require',
|
|
1808
|
-
status: 'blocked',
|
|
1809
|
-
message: 'Cannot find module puppeteer.',
|
|
1810
|
-
path: 'qa/puppeteer-preflight.log'
|
|
1811
|
-
}]
|
|
1812
|
-
}
|
|
1813
|
-
});
|
|
1814
|
-
const aicoderInfraRetryGate = aicoderInfraRetryRun.gates.find((gate) => gate.key === 'manager_no_blind_loop_policy');
|
|
1815
|
-
assert.equal(aicoderInfraRetryGate?.status, 'warn');
|
|
1816
|
-
assert.equal(aicoderInfraRetryGate?.metadata?.action, 'retry_infra');
|
|
1817
|
-
assert.equal(aicoderInfraRetryGate?.metadata?.productRepairFailure, false);
|
|
1818
|
-
assert.equal(aicoderInfraRetryGate?.metadata?.dispatchAction, 'run_infra_repair');
|
|
1819
|
-
assert.equal(aicoderInfraRetryRun.outcome, 'qa_infra_failed');
|
|
1820
|
-
|
|
1821
|
-
const aicoderFreshProofRun = buildAICoderAIRunFromEvidence({
|
|
1822
|
-
app: { _id: 'fresh-proof-app', name: 'Fresh Proof App' },
|
|
1823
|
-
job: { _id: 'aicoder-fresh-proof', phase: 'COMPLETE', status: 'Passed' },
|
|
1824
|
-
qaEvidence: {
|
|
1825
|
-
journeyContract: aicoderJourneyContract,
|
|
1826
|
-
workflowQaRows: aicoderWorkflowQaRows,
|
|
1827
|
-
scorecardPassed: true,
|
|
1828
|
-
compile: { status: 'pass' },
|
|
1829
|
-
routeProbes: [{ route: '/dashboard/hub', status: 'pass' }],
|
|
1830
|
-
deployStatus: 'pass',
|
|
1831
|
-
publishStatus: 'published',
|
|
1832
|
-
sampleDataStatus: 'pass',
|
|
1833
|
-
businessAssertions: aicoderWorkflowBusinessAssertions
|
|
1834
|
-
}
|
|
1835
|
-
});
|
|
1836
|
-
const freshProofFingerprint = String(aicoderFreshProofRun.metadata?.workflowProofReadiness?.workflowProofFingerprint || '');
|
|
1837
|
-
assert.match(freshProofFingerprint, /^aicoder-workflow-proof-/);
|
|
1838
|
-
|
|
1839
|
-
const aicoderStaleProofRun = buildAICoderAIRunFromEvidence({
|
|
1840
|
-
app: { _id: 'stale-proof-app', name: 'Stale Proof App' },
|
|
1841
|
-
job: { _id: 'aicoder-stale-proof', phase: 'COMPLETE', status: 'Passed' },
|
|
1842
|
-
qaEvidence: {
|
|
1843
|
-
journeyContract: aicoderJourneyContract,
|
|
1844
|
-
workflowQaRows: aicoderWorkflowQaRows,
|
|
1845
|
-
scorecardPassed: true,
|
|
1846
|
-
compile: { status: 'pass' },
|
|
1847
|
-
routeProbes: [{ route: '/dashboard/hub', status: 'pass' }],
|
|
1848
|
-
deployStatus: 'pass',
|
|
1849
|
-
publishStatus: 'published',
|
|
1850
|
-
sampleDataStatus: 'pass',
|
|
1851
|
-
previousWorkflowProofFingerprint: freshProofFingerprint,
|
|
1852
|
-
businessAssertions: aicoderWorkflowBusinessAssertions
|
|
1853
|
-
}
|
|
1854
|
-
});
|
|
1855
|
-
assert.equal(aicoderStaleProofRun.metadata?.workflowProofReadiness?.status, 'stale_workflow_proof');
|
|
1856
|
-
assert.equal(aicoderStaleProofRun.metadata?.workflowProofReadiness?.proofFreshness, 'same_as_previous');
|
|
1857
|
-
assert.equal(aicoderStaleProofRun.gates.some((gate) => gate.key === 'aicoder_workflow_proof_readiness' && gate.status === 'blocked'), true);
|
|
1858
|
-
|
|
1859
|
-
const assistantRun = buildAssistantAIRunFromEvidence({
|
|
1860
|
-
conversation: { _id: 'conversation-1', title: 'Invoice query', status: 'Closed', accepted: true },
|
|
1861
|
-
messages: [{ role: 'assistant', content: 'Used the current date window.' }],
|
|
1862
|
-
answerQuality: {
|
|
1863
|
-
queryStatus: 'ok',
|
|
1864
|
-
requiresCurrentDate: true,
|
|
1865
|
-
currentDateUsed: '2026-06-16',
|
|
1866
|
-
expectedCurrentDate: '2026-06-16',
|
|
1867
|
-
legalQueryShape: true,
|
|
1868
|
-
queryExecutions: [{
|
|
1869
|
-
id: 'tool-result-invoices-june-2026',
|
|
1870
|
-
tool: 'aiAssistantMongoRead',
|
|
1871
|
-
status: 'ok',
|
|
1872
|
-
collection: 'invoices',
|
|
1873
|
-
resultCount: 3
|
|
1874
|
-
}],
|
|
1875
|
-
citations: [{ id: 'tool-result-invoices-june-2026' }],
|
|
1876
|
-
confidence: { level: 'high' },
|
|
1877
|
-
nextActions: ['Review the returned June 2026 invoice rows.']
|
|
1878
|
-
},
|
|
1879
|
-
correctnessChecks: [{
|
|
1880
|
-
assertion: 'Date window uses the actual current month.',
|
|
1881
|
-
status: 'pass',
|
|
1882
|
-
expected: 'June 2026',
|
|
1883
|
-
observed: 'June 2026'
|
|
1884
|
-
}],
|
|
1885
|
-
usageLedger: [{
|
|
1886
|
-
model: 'gpt-5.4-mini',
|
|
1887
|
-
category: 'assistant',
|
|
1888
|
-
usage_source: 'runner',
|
|
1889
|
-
usage_surface: 'assistant',
|
|
1890
|
-
input_tokens: 500,
|
|
1891
|
-
output_tokens: 120,
|
|
1892
|
-
cost_estimate: 0.18
|
|
1893
|
-
}]
|
|
1894
|
-
});
|
|
1895
|
-
assert.equal(assistantRun.source, 'ai_assistant');
|
|
1896
|
-
assert.equal(assistantRun.outcome, 'accepted');
|
|
1897
|
-
assert.equal(assistantRun.gates.some((gate) => gate.key === 'assistant_answer_quality' && gate.status === 'pass'), true);
|
|
1898
|
-
assert.equal(assistantRun.gates.some((gate) => gate.key === 'assistant_answer_actionability' && gate.status === 'pass'), true);
|
|
1899
|
-
assert.equal(assistantRun.gates.some((gate) => gate.key === 'cost_observability' && gate.status === 'pass'), true);
|
|
1900
|
-
assert.equal(assistantRun.metadata?.costObservability?.externalCodexMonitorUsed, false);
|
|
1901
|
-
assert.equal(assistantRun.metadata?.costObservability?.estimatedUsd, 0.18);
|
|
1902
|
-
assert.equal(assistantRun.metadata?.answerQuality?.queryStatus, 'ok');
|
|
1903
|
-
assert.equal(assistantRun.metadata?.answerQuality?.queryEvidencePresent, true);
|
|
1904
|
-
assert.equal(assistantRun.metadata?.answerActionability?.primaryCommand, 'answer_from_verified_system_data');
|
|
1905
|
-
assert.equal(assistantRun.metadata?.answerActionability?.canAnswerCustomer, true);
|
|
1906
|
-
assert.equal(assistantRun.metadata?.answerActionability?.canRunWithoutCodexMonitor, true);
|
|
1907
|
-
assert.equal(assistantRun.events.some((event) => event.type === 'assistant_query' && event.metadata?.collection === 'invoices'), true);
|
|
1908
|
-
assert.equal(assistantRun.events.some((event) => event.category === 'assistant_answer_actionability'), true);
|
|
1909
|
-
|
|
1910
|
-
const assistantNoDataRun = buildAssistantAIRunFromEvidence({
|
|
1911
|
-
conversation: { _id: 'conversation-no-data', title: 'No invoice query', status: 'Closed', accepted: true },
|
|
1912
|
-
messages: [{ role: 'assistant', content: 'No invoices were found for June 2026.' }],
|
|
1913
|
-
answerQuality: {
|
|
1914
|
-
queryStatus: 'no_data',
|
|
1915
|
-
noDataConfirmed: true,
|
|
1916
|
-
requiresCurrentDate: true,
|
|
1917
|
-
currentDateUsed: '2026-06-16',
|
|
1918
|
-
expectedCurrentDate: '2026-06-16',
|
|
1919
|
-
legalQueryShape: true,
|
|
1920
|
-
queryExecutions: [{
|
|
1921
|
-
id: 'tool-result-empty-invoices-june-2026',
|
|
1922
|
-
tool: 'aiAssistantMongoRead',
|
|
1923
|
-
status: 'no_data',
|
|
1924
|
-
collection: 'invoices',
|
|
1925
|
-
resultCount: 0
|
|
1926
|
-
}],
|
|
1927
|
-
citationRefs: ['tool-result-empty-invoices-june-2026'],
|
|
1928
|
-
confidenceLevel: 'high',
|
|
1929
|
-
nextActions: ['Verify the date range or customer filter if invoices were expected.']
|
|
1930
|
-
}
|
|
1931
|
-
});
|
|
1932
|
-
assert.equal(assistantNoDataRun.outcome, 'accepted');
|
|
1933
|
-
assert.equal(assistantNoDataRun.metadata?.answerQuality?.queryStatus, 'no_data');
|
|
1934
|
-
assert.equal(assistantNoDataRun.metadata?.answerQuality?.noDataConfirmed, true);
|
|
1935
|
-
assert.equal(assistantNoDataRun.metadata?.answerQuality?.queryEvidencePresent, true);
|
|
1936
|
-
assert.equal(assistantNoDataRun.metadata?.answerActionability?.status, 'ready_to_answer');
|
|
1937
|
-
assert.equal(assistantNoDataRun.metadata?.answerActionability?.queryResultClass, 'no_data');
|
|
1938
|
-
assert.equal(assistantNoDataRun.metadata?.answerActionability?.canAnswerCustomer, true);
|
|
1939
|
-
|
|
1940
|
-
const assistantCitationOnlyRun = buildAssistantAIRunFromEvidence({
|
|
1941
|
-
conversation: { _id: 'conversation-citation-only', title: 'Citation-only answer', status: 'Closed', accepted: true },
|
|
1942
|
-
messages: [{ role: 'assistant', content: 'Found invoices for June 2026.' }],
|
|
1943
|
-
answerQuality: {
|
|
1944
|
-
queryStatus: 'ok',
|
|
1945
|
-
requiresCurrentDate: true,
|
|
1946
|
-
currentDateUsed: '2026-06-16',
|
|
1947
|
-
expectedCurrentDate: '2026-06-16',
|
|
1948
|
-
legalQueryShape: true,
|
|
1949
|
-
citationRefs: ['tool-result-invoices-june-2026'],
|
|
1950
|
-
confidenceLevel: 'high',
|
|
1951
|
-
nextActions: ['Open the invoice list.']
|
|
1952
|
-
}
|
|
1953
|
-
});
|
|
1954
|
-
assert.notEqual(assistantCitationOnlyRun.outcome, 'accepted');
|
|
1955
|
-
assert.equal(assistantCitationOnlyRun.metadata?.answerQuality?.status, 'missing_query_proof');
|
|
1956
|
-
assert.equal(assistantCitationOnlyRun.metadata?.answerQuality?.queryEvidenceRequired, true);
|
|
1957
|
-
assert.equal(assistantCitationOnlyRun.metadata?.answerQuality?.queryEvidencePresent, false);
|
|
1958
|
-
assert.equal(assistantCitationOnlyRun.gates.some((gate) => gate.key === 'assistant_answer_actionability' && gate.status === 'blocked'), true);
|
|
1959
|
-
assert.equal(assistantCitationOnlyRun.metadata?.answerActionability?.status, 'needs_evidence');
|
|
1960
|
-
assert.equal(assistantCitationOnlyRun.metadata?.answerActionability?.primaryCommand, 'collect_assistant_answer_evidence');
|
|
1961
|
-
assert.ok(assistantCitationOnlyRun.metadata?.answerActionability?.forbiddenActions.some((entry: string) => /keyword or route guesses/i.test(entry)));
|
|
1962
|
-
assert.equal(assistantCitationOnlyRun.outcome, 'false_pass');
|
|
1963
|
-
assert.equal(classifyAIRunFailureClass(assistantCitationOnlyRun), 'assistant_missing_evidence');
|
|
1964
|
-
assert.equal(decideAIRunRetry({ currentRun: assistantCitationOnlyRun }).action, 'retry_assistant_answer_quality');
|
|
1965
|
-
|
|
1966
|
-
const assistantWrongDateRun = buildAssistantAIRunFromEvidence({
|
|
1967
|
-
conversation: { _id: 'conversation-wrong-date', title: 'Wrong month query', status: 'Closed', accepted: true },
|
|
1968
|
-
messages: [{ role: 'assistant', content: 'Used May 2026.' }],
|
|
1969
|
-
answerQuality: {
|
|
1970
|
-
queryStatus: 'ok',
|
|
1971
|
-
requiresCurrentDate: true,
|
|
1972
|
-
currentDateUsed: '2026-05-01',
|
|
1973
|
-
expectedCurrentDate: '2026-06-16',
|
|
1974
|
-
legalQueryShape: true,
|
|
1975
|
-
citationRefs: ['tool-result-wrong-month'],
|
|
1976
|
-
confidenceLevel: 'high',
|
|
1977
|
-
nextActions: ['Rerun using the actual current date.']
|
|
1978
|
-
}
|
|
1979
|
-
});
|
|
1980
|
-
assert.notEqual(assistantWrongDateRun.outcome, 'accepted');
|
|
1981
|
-
assert.equal(assistantWrongDateRun.gates.some((gate) => gate.key === 'assistant_answer_quality' && gate.status === 'fail'), true);
|
|
1982
|
-
assert.equal(assistantWrongDateRun.metadata?.answerQuality?.status, 'date_incorrect');
|
|
1983
|
-
assert.equal(classifyAIRunFailureClass(assistantWrongDateRun), 'assistant_date_window');
|
|
1984
|
-
assert.equal(decideAIRunRetry({ currentRun: assistantWrongDateRun }).action, 'retry_assistant_date_window');
|
|
1985
|
-
|
|
1986
|
-
const assistantMissingDateWindowRun = buildAssistantAIRunFromEvidence({
|
|
1987
|
-
conversation: { _id: 'conversation-missing-window', title: 'Missing date window', status: 'Closed', accepted: true },
|
|
1988
|
-
messages: [{ role: 'assistant', content: 'Used the current date but did not record the query window.' }],
|
|
1989
|
-
answerQuality: {
|
|
1990
|
-
queryStatus: 'ok',
|
|
1991
|
-
requiresCurrentDate: true,
|
|
1992
|
-
currentDateUsed: '2026-06-16',
|
|
1993
|
-
expectedCurrentDate: '2026-06-16',
|
|
1994
|
-
requiresDateWindow: true,
|
|
1995
|
-
citationRefs: ['tool-result-no-window'],
|
|
1996
|
-
confidenceLevel: 'high',
|
|
1997
|
-
nextActions: ['Rerun with concrete date-window evidence.']
|
|
1998
|
-
}
|
|
1999
|
-
});
|
|
2000
|
-
assert.notEqual(assistantMissingDateWindowRun.outcome, 'accepted');
|
|
2001
|
-
assert.equal(assistantMissingDateWindowRun.gates.some((gate) => gate.key === 'assistant_answer_quality' && gate.status === 'fail'), true);
|
|
2002
|
-
assert.equal(assistantMissingDateWindowRun.metadata?.answerQuality?.status, 'missing_date_window');
|
|
2003
|
-
assert.equal(assistantMissingDateWindowRun.metadata?.answerQuality?.dateWindowRequired, true);
|
|
2004
|
-
assert.equal(assistantMissingDateWindowRun.metadata?.answerQuality?.dateWindowPresent, false);
|
|
2005
|
-
assert.equal(classifyAIRunFailureClass(assistantMissingDateWindowRun), 'assistant_date_window');
|
|
2006
|
-
assert.equal(decideAIRunRetry({ currentRun: assistantMissingDateWindowRun }).action, 'retry_assistant_date_window');
|
|
2007
|
-
|
|
2008
|
-
const assistantIllegalProjectionRun = buildAssistantAIRunFromEvidence({
|
|
2009
|
-
conversation: { _id: 'conversation-illegal-query', title: 'Illegal Mongo projection', status: 'Closed', accepted: true },
|
|
2010
|
-
messages: [{ role: 'assistant', content: 'Mongo query failed.' }],
|
|
2011
|
-
answerQuality: {
|
|
2012
|
-
queryStatus: 'ok',
|
|
2013
|
-
requiresCurrentDate: false,
|
|
2014
|
-
mongoQuery: {
|
|
2015
|
-
collection: 'invoices',
|
|
2016
|
-
filter: { customerId: 'customer-1' },
|
|
2017
|
-
projection: { 'lineItems.$.amount': 1 }
|
|
2018
|
-
},
|
|
2019
|
-
citationRefs: ['tool-result-illegal-projection'],
|
|
2020
|
-
confidenceLevel: 'high',
|
|
2021
|
-
nextActions: ['Rewrite the projection using a legal aggregation or full field projection.']
|
|
2022
|
-
}
|
|
2023
|
-
});
|
|
2024
|
-
assert.notEqual(assistantIllegalProjectionRun.outcome, 'accepted');
|
|
2025
|
-
assert.equal(assistantIllegalProjectionRun.metadata?.answerQuality?.status, 'illegal_query_shape');
|
|
2026
|
-
assert.equal(classifyAIRunFailureClass(assistantIllegalProjectionRun), 'assistant_query_shape');
|
|
2027
|
-
assert.equal(decideAIRunRetry({ currentRun: assistantIllegalProjectionRun }).action, 'retry_assistant_query_shape');
|
|
2028
|
-
|
|
2029
|
-
const assistantQueryErrorRun = buildAssistantAIRunFromEvidence({
|
|
2030
|
-
conversation: { _id: 'conversation-query-error', title: 'Query error answer', status: 'Closed', accepted: true },
|
|
2031
|
-
messages: [{ role: 'assistant', content: 'No invoices were found.' }],
|
|
2032
|
-
answerQuality: {
|
|
2033
|
-
queryStatus: 'query_error',
|
|
2034
|
-
requiresCurrentDate: false,
|
|
2035
|
-
legalQueryShape: true,
|
|
2036
|
-
citationRefs: ['tool-result-query-error'],
|
|
2037
|
-
confidenceLevel: 'high',
|
|
2038
|
-
nextActions: ['Fix the query error and retry before answering.']
|
|
2039
|
-
}
|
|
2040
|
-
});
|
|
2041
|
-
assert.notEqual(assistantQueryErrorRun.outcome, 'accepted');
|
|
2042
|
-
assert.equal(assistantQueryErrorRun.gates.some((gate) => gate.key === 'assistant_answer_quality' && gate.status === 'blocked'), true);
|
|
2043
|
-
assert.equal(assistantQueryErrorRun.gates.some((gate) => gate.key === 'assistant_answer_actionability' && gate.status === 'blocked'), true);
|
|
2044
|
-
assert.equal(assistantQueryErrorRun.metadata?.answerQuality?.queryStatus, 'query_error');
|
|
2045
|
-
assert.equal(assistantQueryErrorRun.metadata?.answerActionability?.primaryCommand, 'repair_assistant_query_and_rerun');
|
|
2046
|
-
assert.equal(assistantQueryErrorRun.metadata?.answerActionability?.canAnswerCustomer, false);
|
|
2047
|
-
assert.equal(classifyAIRunFailureClass(assistantQueryErrorRun), 'assistant_query_error');
|
|
2048
|
-
assert.equal(decideAIRunRetry({ currentRun: assistantQueryErrorRun }).action, 'retry_assistant_query');
|
|
2049
|
-
|
|
2050
|
-
const assistantPermissionErrorRun = buildAssistantAIRunFromEvidence({
|
|
2051
|
-
conversation: { _id: 'conversation-permission-error', title: 'Permission error answer', status: 'Closed', accepted: true },
|
|
2052
|
-
messages: [{ role: 'assistant', content: 'No invoices were found.' }],
|
|
2053
|
-
answerQuality: {
|
|
2054
|
-
queryStatus: 'permission_error',
|
|
2055
|
-
requiresCurrentDate: false,
|
|
2056
|
-
citationRefs: ['tool-result-permission-error'],
|
|
2057
|
-
confidenceLevel: 'high',
|
|
2058
|
-
nextActions: ['Ask an authorized user to grant invoice access before answering.']
|
|
2059
|
-
}
|
|
2060
|
-
});
|
|
2061
|
-
assert.notEqual(assistantPermissionErrorRun.outcome, 'accepted');
|
|
2062
|
-
assert.equal(assistantPermissionErrorRun.gates.some((gate) => gate.key === 'assistant_answer_quality' && gate.status === 'blocked'), true);
|
|
2063
|
-
assert.equal(assistantPermissionErrorRun.metadata?.answerQuality?.queryStatus, 'permission_error');
|
|
2064
|
-
assert.equal(assistantPermissionErrorRun.metadata?.answerActionability?.primaryCommand, 'request_assistant_data_permission');
|
|
2065
|
-
assert.equal(assistantPermissionErrorRun.metadata?.answerActionability?.costRisk, 'manual_blocked');
|
|
2066
|
-
assert.equal(classifyAIRunFailureClass(assistantPermissionErrorRun), 'assistant_permission');
|
|
2067
|
-
assert.equal(decideAIRunRetry({ currentRun: assistantPermissionErrorRun }).action, 'request_assistant_permission');
|
|
2068
|
-
|
|
2069
|
-
const assistantMissingQualityRun = buildAssistantAIRunFromEvidence({
|
|
2070
|
-
conversation: { _id: 'conversation-missing-quality', title: 'Missing assistant answerQuality', status: 'Closed', accepted: true },
|
|
2071
|
-
messages: [{ role: 'assistant', content: 'Invoices look fine.' }]
|
|
2072
|
-
});
|
|
2073
|
-
assert.notEqual(assistantMissingQualityRun.outcome, 'accepted');
|
|
2074
|
-
assert.equal(assistantMissingQualityRun.gates.some((gate) => gate.key === 'assistant_answer_quality' && gate.status === 'blocked'), true);
|
|
2075
|
-
assert.equal(assistantMissingQualityRun.metadata?.answerQuality?.status, 'missing_data_source');
|
|
2076
|
-
assert.equal(classifyAIRunFailureClass(assistantMissingQualityRun), 'assistant_missing_evidence');
|
|
2077
|
-
assert.equal(decideAIRunRetry({ currentRun: assistantMissingQualityRun }).action, 'retry_assistant_answer_quality');
|
|
2078
|
-
|
|
2079
|
-
const assistantAnswerRun = buildAssistantAIRunFromEvidence({
|
|
2080
|
-
runId: 'ai-run:ai_assistant:chat:conversation-1:message-2',
|
|
2081
|
-
requestId: 'request-1',
|
|
2082
|
-
messageId: 'message-2',
|
|
2083
|
-
conversation: { _id: 'conversation-1', title: 'Invoice query', status: 'Closed' },
|
|
2084
|
-
messages: [
|
|
2085
|
-
{ _id: 'message-1', role: 'user', content: 'Show invoices for this month.' },
|
|
2086
|
-
{
|
|
2087
|
-
_id: 'message-2',
|
|
2088
|
-
role: 'assistant',
|
|
2089
|
-
content: 'Found 3 invoices for June 2026.',
|
|
2090
|
-
usage: { model: 'gpt-5.4-mini' }
|
|
2091
|
-
}
|
|
2092
|
-
],
|
|
2093
|
-
answerQuality: {
|
|
2094
|
-
queryStatus: 'ok',
|
|
2095
|
-
requiresCurrentDate: true,
|
|
2096
|
-
currentDateUsed: '2026-06-16',
|
|
2097
|
-
expectedCurrentDate: '2026-06-16',
|
|
2098
|
-
legalQueryShape: true,
|
|
2099
|
-
queryExecutions: [{
|
|
2100
|
-
id: 'tool-result-invoices-june-2026',
|
|
2101
|
-
tool: 'aiAssistantMongoRead',
|
|
2102
|
-
status: 'ok',
|
|
2103
|
-
collection: 'invoices',
|
|
2104
|
-
resultCount: 3
|
|
2105
|
-
}],
|
|
2106
|
-
citationRefs: ['tool-result-invoices-june-2026'],
|
|
2107
|
-
confidenceLevel: 'high',
|
|
2108
|
-
nextActions: ['Open the invoice list filtered to June 2026.']
|
|
2109
|
-
},
|
|
2110
|
-
usageLedger: [{
|
|
2111
|
-
model: 'gpt-5.4-mini',
|
|
2112
|
-
category: 'ai-terminal',
|
|
2113
|
-
usage_source: 'ai_assistant',
|
|
2114
|
-
usage_surface: 'assistant',
|
|
2115
|
-
usage_phase: 'chat',
|
|
2116
|
-
input_tokens: 100,
|
|
2117
|
-
output_tokens: 50,
|
|
2118
|
-
total_tokens: 150,
|
|
2119
|
-
cost_estimate: 0.02
|
|
2120
|
-
}]
|
|
2121
|
-
});
|
|
2122
|
-
assert.equal(assistantAnswerRun.id, 'ai-run:ai_assistant:chat:conversation-1:message-2');
|
|
2123
|
-
assert.equal(assistantAnswerRun.sourceIds.requestId, 'request-1');
|
|
2124
|
-
assert.equal(assistantAnswerRun.sourceIds.messageId, 'message-2');
|
|
2125
|
-
assert.equal(assistantAnswerRun.events.some((event) => event.type === 'assistant_message' && event.metadata?.model === 'gpt-5.4-mini'), true);
|
|
2126
|
-
assert.equal(assistantAnswerRun.events.some((event) => event.type === 'assistant_query' && event.metadata?.id === 'tool-result-invoices-june-2026'), true);
|
|
2127
|
-
assert.equal(assistantAnswerRun.cost?.surfaces?.assistant.estimatedUsd, 0.02);
|
|
2128
|
-
|
|
2129
|
-
console.log('ai run evidence tests passed');
|