@resolveio/server-lib 22.3.90 → 22.3.92
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/package.json +1 -1
- package/services/codex-client.d.ts +1 -0
- package/services/codex-client.js +27 -26
- package/services/codex-client.js.map +1 -1
- package/util/ai-qa-policy.js +5 -1
- package/util/ai-qa-policy.js.map +1 -1
- package/util/ai-runner-qa-auth.js +66 -12
- package/util/ai-runner-qa-auth.js.map +1 -1
- package/util/ai-runner-qa-tools.js +93 -30
- package/util/ai-runner-qa-tools.js.map +1 -1
|
@@ -246,7 +246,7 @@ function buildResolveIORunnerLocalQaScript() {
|
|
|
246
246
|
'kill_artifact_log_writers() {',
|
|
247
247
|
' local artifact="$ARTIFACT_DIR"',
|
|
248
248
|
' [ -n "$artifact" ] || return 0',
|
|
249
|
-
' for pid in $(ps -eo pid=,args= | awk -v artifact="$artifact" \'index($0, artifact) && $0 !~ /awk -v artifact=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~
|
|
249
|
+
' for pid in $(ps -eo pid=,args= | awk -v artifact="$artifact" \'index($0, artifact) && $0 !~ /awk -v artifact=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~ /(^|[ /])(tee|tail)( |$)/ {print $1}\' 2>/dev/null || true); do',
|
|
250
250
|
' skip_cleanup_pid "$pid" && continue',
|
|
251
251
|
' kill_tree "$pid"',
|
|
252
252
|
' done',
|
|
@@ -282,21 +282,13 @@ function buildResolveIORunnerLocalQaScript() {
|
|
|
282
282
|
' kill_env_marked_processes',
|
|
283
283
|
' kill_artifact_log_writers',
|
|
284
284
|
' kill_local_mongo_processes',
|
|
285
|
-
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng|esbuild|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
285
|
+
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng[[:space:]]+serve|esbuild --service|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
286
286
|
' skip_cleanup_pid "$pid" && continue',
|
|
287
287
|
' kill_tree "$pid"',
|
|
288
288
|
' done',
|
|
289
|
-
'
|
|
290
|
-
'
|
|
291
|
-
'
|
|
292
|
-
' pid="${pid%/cwd}"',
|
|
293
|
-
' skip_cleanup_pid "$pid" && continue',
|
|
294
|
-
' cwd="$(readlink -f "$proc_cwd" 2>/dev/null || true)"',
|
|
295
|
-
' case "$cwd" in',
|
|
296
|
-
' "$PROJECT_ROOT"|"$PROJECT_ROOT"/*) kill_tree "$pid" ;;',
|
|
297
|
-
' esac',
|
|
298
|
-
' done',
|
|
299
|
-
' fi',
|
|
289
|
+
' # Do not kill arbitrary processes by project cwd; completion builds run',
|
|
290
|
+
' # from the same cwd. Cleanup is limited to known QA process signatures,',
|
|
291
|
+
' # recorded PIDs, scoped ports, and QA runner env markers.',
|
|
300
292
|
' sleep 1',
|
|
301
293
|
' done',
|
|
302
294
|
' local wait_until=$((SECONDS + 60))',
|
|
@@ -326,7 +318,7 @@ function buildResolveIORunnerLocalQaScript() {
|
|
|
326
318
|
' fi',
|
|
327
319
|
' kill_artifact_log_writers',
|
|
328
320
|
' kill_local_mongo_processes',
|
|
329
|
-
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng|esbuild|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
321
|
+
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng[[:space:]]+serve|esbuild --service|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
330
322
|
' skip_cleanup_pid "$pid" && continue',
|
|
331
323
|
' found=1',
|
|
332
324
|
' done',
|
|
@@ -386,7 +378,7 @@ function buildResolveIORunnerLocalQaScript() {
|
|
|
386
378
|
'log_has_fatal() {',
|
|
387
379
|
' local file="$1"',
|
|
388
380
|
' [ -f "$file" ] || return 1',
|
|
389
|
-
' grep -Eiq "Unhandled Rejection|Cannot read properties of undefined|TypeError|ReferenceError|EADDRINUSE|app crashed|Failed to compile|
|
|
381
|
+
' grep -Eiq "Unhandled Rejection|Cannot read properties of undefined|TypeError|ReferenceError|EADDRINUSE|app crashed|Failed to compile|Compilation failed|TypeScript:.*(semantic errors|Compilation failed)|error TS[0-9]{4}|NG[0-9]{4}|TS[0-9]{4}|Error: Cannot find module" "$file"',
|
|
390
382
|
'}',
|
|
391
383
|
'prepare_angular_cache_dirs() {',
|
|
392
384
|
' [ -d "$PROJECT_ROOT" ] || return 0',
|
|
@@ -592,7 +584,7 @@ function buildResolveIORunnerLocalQaStopperScript() {
|
|
|
592
584
|
'kill_artifact_log_writers() {',
|
|
593
585
|
' local artifact="$ARTIFACT_DIR"',
|
|
594
586
|
' [ -n "$artifact" ] || return 0',
|
|
595
|
-
' for pid in $(ps -eo pid=,args= | awk -v artifact="$artifact" \'index($0, artifact) && $0 !~ /awk -v artifact=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~
|
|
587
|
+
' for pid in $(ps -eo pid=,args= | awk -v artifact="$artifact" \'index($0, artifact) && $0 !~ /awk -v artifact=/ && $0 !~ /ps -eo pid=,args=/ && $0 ~ /(^|[ /])(tee|tail)( |$)/ {print $1}\' 2>/dev/null || true); do',
|
|
596
588
|
' skip_cleanup_pid "$pid" && continue',
|
|
597
589
|
' kill_tree "$pid"',
|
|
598
590
|
' killed_count=$((killed_count + 1))',
|
|
@@ -632,22 +624,14 @@ function buildResolveIORunnerLocalQaStopperScript() {
|
|
|
632
624
|
' kill_env_marked_processes',
|
|
633
625
|
' kill_artifact_log_writers',
|
|
634
626
|
' kill_local_mongo_processes',
|
|
635
|
-
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng|esbuild|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
627
|
+
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng[[:space:]]+serve|esbuild --service|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
636
628
|
' skip_cleanup_pid "$pid" && continue',
|
|
637
629
|
' kill_tree "$pid"',
|
|
638
630
|
' killed_count=$((killed_count + 1))',
|
|
639
631
|
' done',
|
|
640
|
-
'
|
|
641
|
-
'
|
|
642
|
-
'
|
|
643
|
-
' pid="${pid%/cwd}"',
|
|
644
|
-
' skip_cleanup_pid "$pid" && continue',
|
|
645
|
-
' cwd="$(readlink -f "$proc_cwd" 2>/dev/null || true)"',
|
|
646
|
-
' case "$cwd" in',
|
|
647
|
-
' "$PROJECT_ROOT"|"$PROJECT_ROOT"/*) kill_tree "$pid" ;;',
|
|
648
|
-
' esac',
|
|
649
|
-
' done',
|
|
650
|
-
' fi',
|
|
632
|
+
' # Do not kill arbitrary processes by project cwd; completion builds run',
|
|
633
|
+
' # from the same cwd. Stop only known QA process signatures, recorded PIDs,',
|
|
634
|
+
' # scoped ports, and QA runner env markers.',
|
|
651
635
|
' sleep 1',
|
|
652
636
|
'done',
|
|
653
637
|
'wait_until=$((SECONDS + 60))',
|
|
@@ -677,7 +661,7 @@ function buildResolveIORunnerLocalQaStopperScript() {
|
|
|
677
661
|
' fi',
|
|
678
662
|
' kill_artifact_log_writers',
|
|
679
663
|
' kill_local_mongo_processes',
|
|
680
|
-
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng|esbuild|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
664
|
+
' for pid in $(ps -eo pid=,args= | awk -v root="$PROJECT_ROOT" \'index($0, root) && $0 !~ /awk -v root=/ && $0 !~ /ps -eo pid=,args=/ && $0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/ && $0 ~ /(ng serve|node .*node_modules\\/\\.bin\\/ng[[:space:]]+serve|esbuild --service|npm run client|start_client\\.sh|npm run server|start_server\\.sh|nodemon|node .*tmp\\/index\\.js|mongod|mongodb-binaries\\/mongod)/ {print $1}\' 2>/dev/null || true); do',
|
|
681
665
|
' skip_cleanup_pid "$pid" && continue',
|
|
682
666
|
' found=1',
|
|
683
667
|
' done',
|
|
@@ -728,6 +712,9 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
728
712
|
'function preserveExistingSeedResult(reason) {',
|
|
729
713
|
' const existing = readJsonIfExists(resultPath);',
|
|
730
714
|
' const status = String(existing && existing.status || "").toLowerCase();',
|
|
715
|
+
' if (existing && existing.profile === "billing_inventory" && !(existing.selected && existing.selected.qa_billing_fixture)) {',
|
|
716
|
+
' return;',
|
|
717
|
+
' }',
|
|
731
718
|
' if (["pass", "needs-data"].includes(status)) {',
|
|
732
719
|
' const preserved = { ...existing, reused_existing: true, reuse_reason: reason, checked_at: new Date().toISOString() };',
|
|
733
720
|
' console.log(JSON.stringify(preserved, null, 2));',
|
|
@@ -898,6 +885,51 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
898
885
|
' if (pricingDocs.length) summary.notes.push(`Ensured ${pricingDocs.length} local pricing-items for service/misc surcharge override/default QA.`);',
|
|
899
886
|
'}',
|
|
900
887
|
'',
|
|
888
|
+
'async function ensureBillingDashboardQaFixtures(targetDb, summary, customerIds, yardIds, serviceItems) {',
|
|
889
|
+
' const now = new Date();',
|
|
890
|
+
' const customerId = (customerIds && customerIds[0]) || "qa-billing-customer";',
|
|
891
|
+
' const yardId = (yardIds && yardIds[0]) || "qa-billing-yard";',
|
|
892
|
+
' const item = (serviceItems || []).find((doc) => doc && doc._id) || { _id: "qa-billing-service-item", name: "QA Billing Service Item", unit: "Each", type: "Service", active: true };',
|
|
893
|
+
' const locationId = "qa-billing-location";',
|
|
894
|
+
' const bolId = "qa-billing-bol";',
|
|
895
|
+
' const psoId = "qa-billing-pso-awaiting-invoice";',
|
|
896
|
+
' const deliveryId = "qa-billing-delivery-awaiting-invoice";',
|
|
897
|
+
' const invoiceId = "qa-billing-existing-processing-invoice";',
|
|
898
|
+
' await targetDb.collection("customers").replaceOne({ _id: customerId }, {',
|
|
899
|
+
' _id: customerId, name: "QA Billing Customer", active: true, send_type: "Email", customer_approval_required: false, createdAt: now, updatedAt: now',
|
|
900
|
+
' }, { upsert: true });',
|
|
901
|
+
' await targetDb.collection("yards").replaceOne({ _id: yardId }, { _id: yardId, name: "QA Billing Yard", active: true, createdAt: now, updatedAt: now }, { upsert: true });',
|
|
902
|
+
' await targetDb.collection("items").replaceOne({ _id: item._id }, { ...item, _id: item._id, name: item.name || "QA Billing Service Item", unit: item.unit || "Each", type: item.type || "Service", active: true, updatedAt: now }, { upsert: true });',
|
|
903
|
+
' await targetDb.collection("production-locations").replaceOne({ _id: locationId }, {',
|
|
904
|
+
' _id: locationId, id_customer: customerId, customer: "QA Billing Customer", location: "QA Billing Location", id_yard: yardId, county: "QA County", active: true, createdAt: now, updatedAt: now',
|
|
905
|
+
' }, { upsert: true });',
|
|
906
|
+
' await targetDb.collection("bols").replaceOne({ _id: bolId }, {',
|
|
907
|
+
' _id: bolId, bol_string: "QA-BOL-004333", bol_number: "QA-BOL-004333", status: "Delivered", date: now, driver: "QA Driver", createdAt: now, updatedAt: now',
|
|
908
|
+
' }, { upsert: true });',
|
|
909
|
+
' const lineItem = {',
|
|
910
|
+
' _id: "qa-billing-pso-line-1", id_item: item._id, item: item.name || "QA Billing Service Item", item_type: item.type || "Service", type: item.type || "Service", quantity: 2, unit: item.unit || "Each", price: 100, price_subtotal: 200, price_total: 216.5, tax_amount: 16.5, billed: true, memo_bill: false, taxable: true, id_location: locationId, location: "QA Billing Location", id_yard: yardId, yard: "QA Billing Yard"',
|
|
911
|
+
' };',
|
|
912
|
+
' await targetDb.collection("production-sales-orders").replaceOne({ _id: psoId }, {',
|
|
913
|
+
' _id: psoId, status: "Awaiting Invoice", type: "Invoice", id_customer: customerId, customer: "QA Billing Customer", id_default_yard: yardId, date_created: now, date_ship: now, date_needed: now, order_number_string: "QA-PSO-004333", activity_number: "QA-PSO-004333", bol_numbers: "QA-BOL-004333", drivers: "QA Driver", ship_to_type: "Location", ship_to_location: "QA Billing Location", price: 200, price_subtotal: 200, account_manager: "QA Admin", user_approved: "QA Admin", production_locations: [{ id_location: locationId, location: "QA Billing Location", items: [lineItem] }], createdAt: now, updatedAt: now',
|
|
914
|
+
' }, { upsert: true });',
|
|
915
|
+
' await targetDb.collection("production-deliveries").replaceOne({ _id: deliveryId }, {',
|
|
916
|
+
' _id: deliveryId, type: "Delivery", approved: true, billed: true, memo_bill: false, invoiced: false, generic: false, invoices: [], consignment: false, id_activity: psoId, activity_number: "QA-PSO-004333", activity_type: "Invoice", id_customer: customerId, id_location: locationId, location: "QA Billing Location", id_yard: yardId, yard: "QA Billing Yard", id_item: item._id, item: item.name || "QA Billing Service Item", item_type: item.type || "Service", quantity: 2, unit: item.unit || "Each", price_per_unit: 100, price_subtotal: 200, price_total: 216.5, tax_amount: 16.5, id_bol: bolId, bol_number: "QA-BOL-004333", date: now, date_ship: now, user_approved: "QA Admin", account_manager: "QA Admin", createdAt: now, updatedAt: now',
|
|
917
|
+
' }, { upsert: true });',
|
|
918
|
+
' await targetDb.collection("invoices").replaceOne({ _id: invoiceId }, {',
|
|
919
|
+
' _id: invoiceId, status: "Processing", type: "Invoice", id_customer: customerId, customer: "QA Billing Customer", id_yard: yardId, yard: "QA Billing Yard", invoice_string: "QA-INV-004333", invoice_number: 4333, date_invoice: now, total: 216.5, subtotal: 200, tax_amount: 16.5, printed: false, invoice_opened: false, logs: [], files: [], line_items: [{ ...lineItem, source_production_delivery_id: deliveryId, description: lineItem.item, date: now }], createdAt: now, updatedAt: now',
|
|
920
|
+
' }, { upsert: true });',
|
|
921
|
+
' summary.collections.customers = (summary.collections.customers || 0) + 1;',
|
|
922
|
+
' summary.collections.yards = (summary.collections.yards || 0) + 1;',
|
|
923
|
+
' summary.collections.items = (summary.collections.items || 0) + 1;',
|
|
924
|
+
' summary.collections["production-locations"] = (summary.collections["production-locations"] || 0) + 1;',
|
|
925
|
+
' summary.collections.bols = (summary.collections.bols || 0) + 1;',
|
|
926
|
+
' summary.collections["production-sales-orders"] = (summary.collections["production-sales-orders"] || 0) + 1;',
|
|
927
|
+
' summary.collections["production-deliveries"] = (summary.collections["production-deliveries"] || 0) + 1;',
|
|
928
|
+
' summary.collections.invoices = (summary.collections.invoices || 0) + 1;',
|
|
929
|
+
' summary.selected.qa_billing_fixture = { customerId, yardId, psoId, deliveryId, invoiceId, itemId: item._id };',
|
|
930
|
+
' summary.notes.push("Ensured localhost-only Billing Dashboard fixtures: one existing processing invoice plus one awaiting-invoice PSO/delivery source row.");',
|
|
931
|
+
'}',
|
|
932
|
+
'',
|
|
901
933
|
'async function selectDashboardReadyProductionDeliveryIds(sourceDb, query, limit = 5) {',
|
|
902
934
|
' const rows = await sourceDb.collection("production-deliveries").aggregate([',
|
|
903
935
|
' { $match: query || {} },',
|
|
@@ -1035,6 +1067,7 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1035
1067
|
' { name: /surcharge|fuel|delivery|service|misc/i }',
|
|
1036
1068
|
' ] }, summary, 80, { updatedAt: -1 });',
|
|
1037
1069
|
' await ensureBillingSurchargePricingFixtures(targetDb, summary, copiedServiceItems, customerIds);',
|
|
1070
|
+
' await ensureBillingDashboardQaFixtures(targetDb, summary, customerIds, yardIds, copiedServiceItems);',
|
|
1038
1071
|
'',
|
|
1039
1072
|
' const inventoryLocationQuery = { $or: [',
|
|
1040
1073
|
' { id_item: { $in: unique([...itemIds, ...copiedItems.map((doc) => doc._id), ...copiedServiceItems.map((doc) => doc._id)]) } },',
|
|
@@ -1337,6 +1370,35 @@ function buildResolveIORunnerQaWorkflowProbeScript() {
|
|
|
1337
1370
|
' return { url: location.href, title: document.title, bodyTextSnippet: bodyText.slice(0, 1200), hasLoginText: /Employee\\/Customer Login|Employee Sign In|Customer Access|Unable to sign in/i.test(bodyText), hasOfflineModeText: bodyText.includes("*** OFFLINE MODE ***") };',
|
|
1338
1371
|
' });',
|
|
1339
1372
|
'}',
|
|
1373
|
+
'function billingDashboardHasVisibleWork(text) {',
|
|
1374
|
+
' const value = String(text || "");',
|
|
1375
|
+
' const patterns = [',
|
|
1376
|
+
' /PSO Type Invoice Awaiting Invoices, Customers: \\((\\d+)\\), Deliveries: \\((\\d+)\\)/i,',
|
|
1377
|
+
' /Deliveries Awaiting Invoices, Customers: \\((\\d+)\\), Treatments: \\((\\d+)\\)/i,',
|
|
1378
|
+
' /Truck Treatments Awaiting Invoices, Customers: \\((\\d+)\\), Treatments: \\((\\d+)\\)/i,',
|
|
1379
|
+
' /Periodic Billing, Customers: \\((\\d+)\\), Items: \\((\\d+)\\)/i,',
|
|
1380
|
+
' /Custom Consolidated Invoicing, Customers: \\((\\d+)\\), Items: \\((\\d+)\\)/i,',
|
|
1381
|
+
' /Processing, Customers: \\((\\d+)\\), Invoices: \\((\\d+)\\)/i,',
|
|
1382
|
+
' /Prepared, Customers: \\((\\d+)\\), Invoices: \\((\\d+)\\)/i,',
|
|
1383
|
+
' /Open Invoices, Customers: \\((\\d+)\\), Invoices: \\((\\d+)\\)/i',
|
|
1384
|
+
' ];',
|
|
1385
|
+
' for (const pattern of patterns) {',
|
|
1386
|
+
' const match = pattern.exec(value);',
|
|
1387
|
+
' if (match && (Number(match[1]) > 0 || Number(match[2]) > 0)) return true;',
|
|
1388
|
+
' }',
|
|
1389
|
+
' return false;',
|
|
1390
|
+
'}',
|
|
1391
|
+
'async function waitForBillingDashboardWork(page) {',
|
|
1392
|
+
' if (!/\\/billing(?:$|[?#])|\\/dashboard\\/billing(?:$|[?#])/.test(targetRoute)) return null;',
|
|
1393
|
+
' const deadline = Date.now() + Number(process.env.RESOLVEIO_RUNNER_QA_BILLING_DATA_TIMEOUT_MS || process.env.RESOLVEIO_SUPPORT_QA_BILLING_DATA_TIMEOUT_MS || 45000);',
|
|
1394
|
+
' let summary = await pageSummary(page);',
|
|
1395
|
+
' while (Date.now() < deadline) {',
|
|
1396
|
+
' summary = await pageSummary(page);',
|
|
1397
|
+
' if (billingDashboardHasVisibleWork(summary.bodyTextSnippet)) return summary;',
|
|
1398
|
+
' await delay(1500);',
|
|
1399
|
+
' }',
|
|
1400
|
+
' throw new Error(`Billing Dashboard loaded but no actionable seeded billing rows became visible before QA handoff. This is a runner data-seeding blocker, not a feature failure. Page summary: ${JSON.stringify(summary).slice(0, 1000)}`);',
|
|
1401
|
+
'}',
|
|
1340
1402
|
'function updateMatrix(status, screenshotPath, caption, assertion) {',
|
|
1341
1403
|
' const matrix = readJson(matrixPath) || { status: "started", rows: [] };',
|
|
1342
1404
|
' matrix.workflow_probe = { status, route: targetRoute, screenshot: screenshotPath, caption, assertion, updated_at: new Date().toISOString() };',
|
|
@@ -1366,8 +1428,9 @@ function buildResolveIORunnerQaWorkflowProbeScript() {
|
|
|
1366
1428
|
' await page.goto(`${clientUrl}${targetRoute}`, { waitUntil: "domcontentloaded", timeout: 60000 });',
|
|
1367
1429
|
' await page.waitForSelector("body", { timeout: 30000 });',
|
|
1368
1430
|
' await delay(2500);',
|
|
1369
|
-
'
|
|
1431
|
+
' let summary = await pageSummary(page);',
|
|
1370
1432
|
' if (summary.hasLoginText || summary.hasOfflineModeText || !summary.bodyTextSnippet) throw new Error(`Workflow route did not reach authenticated app: ${JSON.stringify(summary).slice(0, 1000)}`);',
|
|
1433
|
+
' summary = await waitForBillingDashboardWork(page) || summary;',
|
|
1371
1434
|
' const caption = `Workflow route ready: ${targetRoute} loaded in authenticated local QA with live seeded data available.`;',
|
|
1372
1435
|
' await page.screenshot({ path: passScreenshotPath, type: "jpeg", quality: 82, fullPage: false });',
|
|
1373
1436
|
' updateMatrix("pass", passScreenshotPath, caption, "Authenticated customer workflow route loaded; deeper row-specific UI/data proof still required.");',
|