@resolveio/server-lib 22.3.171 → 22.3.172
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.
|
@@ -86,6 +86,48 @@ export interface ResolveIOSupportSimilarCaseSelection {
|
|
|
86
86
|
ignoredCount: number;
|
|
87
87
|
generatedAt: string;
|
|
88
88
|
}
|
|
89
|
+
export type ResolveIOSupportDiagnosisEvidencePackStatus = 'needs_diagnosis' | 'diagnosis_ready' | 'blocked';
|
|
90
|
+
export interface ResolveIOSupportIssueClassProbeCatalogEntry {
|
|
91
|
+
issue_class: ResolveIOSupportIssueClass;
|
|
92
|
+
probe_type: ResolveIOSupportV5StepType;
|
|
93
|
+
failure_class: ResolveIOSupportV5FailureClass;
|
|
94
|
+
action: string;
|
|
95
|
+
proof_required: string;
|
|
96
|
+
required_artifacts: string[];
|
|
97
|
+
acceptance_gate: 'aiqa_business_assertion';
|
|
98
|
+
false_pass_blockers: string[];
|
|
99
|
+
}
|
|
100
|
+
export interface ResolveIOSupportDiagnosisEvidencePack {
|
|
101
|
+
packId: string;
|
|
102
|
+
status: ResolveIOSupportDiagnosisEvidencePackStatus;
|
|
103
|
+
readOnly: true;
|
|
104
|
+
sourceEditsAllowed: false;
|
|
105
|
+
rootCauseFirstRequired: true;
|
|
106
|
+
requiredOutputKey: 'support_diagnosis_gate';
|
|
107
|
+
requiredFields: string[];
|
|
108
|
+
requiredEvidence: string[];
|
|
109
|
+
forbiddenActions: string[];
|
|
110
|
+
diagnosisValid: boolean;
|
|
111
|
+
diagnosisStatus: ResolveIOSupportDiagnosisGateStatus;
|
|
112
|
+
validationBlockers: string[];
|
|
113
|
+
issueClassHint?: ResolveIOSupportIssueClass;
|
|
114
|
+
ownerFileHints: string[];
|
|
115
|
+
activeMicrotaskId?: string;
|
|
116
|
+
similarCaseSelection: ResolveIOSupportSimilarCaseSelection;
|
|
117
|
+
issueClassProbeCatalog: ResolveIOSupportIssueClassProbeCatalogEntry[];
|
|
118
|
+
structuredFacts: Record<string, any>;
|
|
119
|
+
generatedAt: string;
|
|
120
|
+
}
|
|
121
|
+
export interface ResolveIOSupportDiagnosisEvidencePackInput {
|
|
122
|
+
bundle?: ResolveIOSupportV5StateBundle;
|
|
123
|
+
diagnosisGate?: any;
|
|
124
|
+
similarCaseHints?: any;
|
|
125
|
+
issueClass?: ResolveIOSupportIssueClass | string;
|
|
126
|
+
ownerFiles?: any;
|
|
127
|
+
text?: any;
|
|
128
|
+
ticketContext?: Record<string, any>;
|
|
129
|
+
now?: Date | string;
|
|
130
|
+
}
|
|
89
131
|
export interface ResolveIOSupportDiagnosisEvidence {
|
|
90
132
|
type: 'ticket' | 'browser' | 'mongo' | 'log' | 'code' | 'commit' | 'qa' | 'other';
|
|
91
133
|
summary: string;
|
|
@@ -651,6 +693,7 @@ export interface ResolveIOSupportV5AutonomousDecision {
|
|
|
651
693
|
recordedAt: string;
|
|
652
694
|
}
|
|
653
695
|
export declare function selectResolveIOSupportSimilarCaseHints(input?: ResolveIOSupportSimilarCaseSelectionInput): ResolveIOSupportSimilarCaseSelection;
|
|
696
|
+
export declare function buildResolveIOSupportDiagnosisEvidencePack(input?: ResolveIOSupportDiagnosisEvidencePackInput): ResolveIOSupportDiagnosisEvidencePack;
|
|
654
697
|
export declare function evaluateResolveIOSupportDiagnosisEvidenceQuality(value: any): ResolveIOSupportDiagnosisEvidenceQuality;
|
|
655
698
|
export declare function normalizeResolveIOSupportDiagnosisGate(value: any, now?: Date | string): ResolveIOSupportDiagnosisGate | undefined;
|
|
656
699
|
export declare function extractResolveIOSupportDiagnosisGateFromText(value: string, now?: Date | string): ResolveIOSupportDiagnosisGate | undefined;
|
|
@@ -738,6 +781,7 @@ export declare function buildResolveIOSupportV5MicrotaskPrompt(input: {
|
|
|
738
781
|
prompt: string;
|
|
739
782
|
promptTokenEstimate: number;
|
|
740
783
|
promptSections: ResolveIOSupportV5UsageSection[];
|
|
784
|
+
diagnosisEvidencePack: ResolveIOSupportDiagnosisEvidencePack;
|
|
741
785
|
activeMicrotask?: ResolveIOSupportV5Microtask;
|
|
742
786
|
withinCap: boolean;
|
|
743
787
|
withinHardCap: boolean;
|
|
@@ -48,6 +48,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
exports.selectResolveIOSupportSimilarCaseHints = selectResolveIOSupportSimilarCaseHints;
|
|
51
|
+
exports.buildResolveIOSupportDiagnosisEvidencePack = buildResolveIOSupportDiagnosisEvidencePack;
|
|
51
52
|
exports.evaluateResolveIOSupportDiagnosisEvidenceQuality = evaluateResolveIOSupportDiagnosisEvidenceQuality;
|
|
52
53
|
exports.normalizeResolveIOSupportDiagnosisGate = normalizeResolveIOSupportDiagnosisGate;
|
|
53
54
|
exports.extractResolveIOSupportDiagnosisGateFromText = extractResolveIOSupportDiagnosisGateFromText;
|
|
@@ -425,6 +426,221 @@ function selectResolveIOSupportSimilarCaseHints(input) {
|
|
|
425
426
|
generatedAt: isoNow(input.now)
|
|
426
427
|
};
|
|
427
428
|
}
|
|
429
|
+
var SUPPORT_DIAGNOSIS_GATE_REQUIRED_FIELDS = [
|
|
430
|
+
'issue_case',
|
|
431
|
+
'issue_class',
|
|
432
|
+
'accepted_hypothesis',
|
|
433
|
+
'rejected_alternatives',
|
|
434
|
+
'failing_path',
|
|
435
|
+
'owner_files',
|
|
436
|
+
'proof_plan',
|
|
437
|
+
'evidence',
|
|
438
|
+
'status'
|
|
439
|
+
];
|
|
440
|
+
var SUPPORT_DIAGNOSIS_REQUIRED_EVIDENCE = [
|
|
441
|
+
'customer complaint, expected result, observed result, route/module, and account/customer context',
|
|
442
|
+
'reproduction proof or blocked-reproduction reason',
|
|
443
|
+
'one accepted falsifiable root-cause hypothesis with evidence',
|
|
444
|
+
'rejected alternatives showing the runner did not guess',
|
|
445
|
+
'frontend/backend/shared failing path',
|
|
446
|
+
'small exact owner_files set',
|
|
447
|
+
'before/action/after business proof plan',
|
|
448
|
+
'AIQaBusinessAssertion acceptance requirement'
|
|
449
|
+
];
|
|
450
|
+
var SUPPORT_DIAGNOSIS_FORBIDDEN_ACTIONS = [
|
|
451
|
+
'Do not edit source, package, generated, fixture, QA artifact, or local data files while building the diagnosis gate.',
|
|
452
|
+
'Do not use similar tickets or commits as proof; they are advisory hints only.',
|
|
453
|
+
'Do not broaden owner_files from similar hints without fresh evidence from the current ticket.',
|
|
454
|
+
'Do not accept route load, screenshot, scorecard, wow score, or model claim as ticket acceptance.',
|
|
455
|
+
'Do not run product-code repair until SupportDiagnosisGate validates.'
|
|
456
|
+
];
|
|
457
|
+
var SUPPORT_ISSUE_CLASS_PROBE_CATALOG = [{
|
|
458
|
+
issue_class: 'no_op_submit',
|
|
459
|
+
probe_type: 'issue_class_probe',
|
|
460
|
+
failure_class: 'business',
|
|
461
|
+
action: 'Submit the reported form/action and prove a persisted state change or expected validation result.',
|
|
462
|
+
proof_required: 'Before/action/after DOM or data proof that the submit is no longer a no-op.',
|
|
463
|
+
required_artifacts: ['before form state', 'submit action trace', 'post-submit DOM/data proof', 'method or network result'],
|
|
464
|
+
acceptance_gate: 'aiqa_business_assertion',
|
|
465
|
+
false_pass_blockers: ['route loaded only', 'button clicked without persisted result', 'model claim without DOM/data proof']
|
|
466
|
+
}, {
|
|
467
|
+
issue_class: 'missing_wrong_data',
|
|
468
|
+
probe_type: 'issue_class_probe',
|
|
469
|
+
failure_class: 'business',
|
|
470
|
+
action: 'Load the named record/list and compare visible data to the expected persisted source.',
|
|
471
|
+
proof_required: 'Visible data and persisted data match the customer expectation.',
|
|
472
|
+
required_artifacts: ['expected source record', 'visible DOM/data snapshot', 'persisted data comparison'],
|
|
473
|
+
acceptance_gate: 'aiqa_business_assertion',
|
|
474
|
+
false_pass_blockers: ['non-empty page only', 'wrong account/customer context', 'sample substitute for named record']
|
|
475
|
+
}, {
|
|
476
|
+
issue_class: 'filter_query_mismatch',
|
|
477
|
+
probe_type: 'issue_class_probe',
|
|
478
|
+
failure_class: 'business',
|
|
479
|
+
action: 'Apply the reported filter/query inputs and assert included/excluded rows or counts.',
|
|
480
|
+
proof_required: 'Returned rows/counts match the expected dataset and exclude the wrong records.',
|
|
481
|
+
required_artifacts: ['filter input trace', 'included/excluded row proof', 'query or publication result proof'],
|
|
482
|
+
acceptance_gate: 'aiqa_business_assertion',
|
|
483
|
+
false_pass_blockers: ['filter control visible only', 'route screenshot without row proof']
|
|
484
|
+
}, {
|
|
485
|
+
issue_class: 'invoice_pdf_export',
|
|
486
|
+
probe_type: 'issue_class_probe',
|
|
487
|
+
failure_class: 'business',
|
|
488
|
+
action: 'Generate the invoice/PDF/export and inspect the generated artifact.',
|
|
489
|
+
proof_required: 'Generated artifact contains the expected customer-visible rows, totals, fields, or file output.',
|
|
490
|
+
required_artifacts: ['export trigger trace', 'generated file artifact path', 'parsed artifact content proof'],
|
|
491
|
+
acceptance_gate: 'aiqa_business_assertion',
|
|
492
|
+
false_pass_blockers: ['download button visible only', 'unparsed file exists only']
|
|
493
|
+
}, {
|
|
494
|
+
issue_class: 'upload_import',
|
|
495
|
+
probe_type: 'issue_class_probe',
|
|
496
|
+
failure_class: 'business',
|
|
497
|
+
action: 'Run the upload/import workflow with a representative file and assert parsed plus persisted results.',
|
|
498
|
+
proof_required: 'Import result message and persisted rows/counts changed as expected.',
|
|
499
|
+
required_artifacts: ['input file fixture', 'import result message', 'persisted row/count delta'],
|
|
500
|
+
acceptance_gate: 'aiqa_business_assertion',
|
|
501
|
+
false_pass_blockers: ['file picker opens only', 'upload toast without persisted delta']
|
|
502
|
+
}, {
|
|
503
|
+
issue_class: 'route_auth_hydration',
|
|
504
|
+
probe_type: 'issue_class_probe',
|
|
505
|
+
failure_class: 'route',
|
|
506
|
+
action: 'Open the route as the affected user and prove authenticated hydration reaches the functional screen.',
|
|
507
|
+
proof_required: 'Hydrated route shows required controls/data for the affected account and no shell-only fallback.',
|
|
508
|
+
required_artifacts: ['auth context', 'hydrated DOM proof', 'console/network error log'],
|
|
509
|
+
acceptance_gate: 'aiqa_business_assertion',
|
|
510
|
+
false_pass_blockers: ['home route proof', 'login shell proof', 'header-only screenshot']
|
|
511
|
+
}, {
|
|
512
|
+
issue_class: 'slow_query_performance',
|
|
513
|
+
probe_type: 'issue_class_probe',
|
|
514
|
+
failure_class: 'business',
|
|
515
|
+
action: 'Run the reported query/workflow with timing/log evidence before and after the fix.',
|
|
516
|
+
proof_required: 'Timing improves or meets target while result equivalence is preserved.',
|
|
517
|
+
required_artifacts: ['before timing', 'after timing', 'result equivalence proof', 'query/log trace'],
|
|
518
|
+
acceptance_gate: 'aiqa_business_assertion',
|
|
519
|
+
false_pass_blockers: ['compile pass only', 'single timing without before/after comparison']
|
|
520
|
+
}];
|
|
521
|
+
function normalizeSupportSimilarCaseSelection(value, input) {
|
|
522
|
+
var object = cleanObject(value);
|
|
523
|
+
if (Array.isArray(value)) {
|
|
524
|
+
return selectResolveIOSupportSimilarCaseHints(__assign(__assign({}, input), { candidates: value }));
|
|
525
|
+
}
|
|
526
|
+
if (object.ranked || object.similarTickets || object.similar_tickets || object.similarCommits || object.similar_commits) {
|
|
527
|
+
var normalizeRanked = function (entries) { return (Array.isArray(entries) ? entries : [])
|
|
528
|
+
.map(function (entry) {
|
|
529
|
+
var candidate = normalizeResolveIOSupportSimilarCaseCandidate(entry);
|
|
530
|
+
if (!candidate) {
|
|
531
|
+
return undefined;
|
|
532
|
+
}
|
|
533
|
+
var signals = cleanList((entry || {}).structuredSignals || (entry || {}).structured_signals, 10, 160);
|
|
534
|
+
return {
|
|
535
|
+
id: candidate.id,
|
|
536
|
+
ticketNumber: candidate.ticketNumber,
|
|
537
|
+
title: candidate.title,
|
|
538
|
+
outcome: candidate.outcome,
|
|
539
|
+
issueClass: normalizeIssueClass(candidate.issueClass) || candidate.issueClass,
|
|
540
|
+
ownerFiles: candidate.ownerFiles.slice(0, 8),
|
|
541
|
+
commitSha: candidate.commitSha,
|
|
542
|
+
commitMessage: candidate.commitMessage,
|
|
543
|
+
reason: cleanText((entry || {}).reason || signals.join('; '), 500),
|
|
544
|
+
source: candidate.source,
|
|
545
|
+
score: Number((entry || {}).score || 0),
|
|
546
|
+
structuredSignals: signals,
|
|
547
|
+
advisoryOnly: true
|
|
548
|
+
};
|
|
549
|
+
})
|
|
550
|
+
.filter(function (entry) { return Boolean(entry); })
|
|
551
|
+
.slice(0, Math.max(1, Math.min(12, Number(input.limit || 6)))); };
|
|
552
|
+
var rankedHints = normalizeRanked(object.ranked);
|
|
553
|
+
var ticketHints = normalizeRanked(object.similarTickets || object.similar_tickets);
|
|
554
|
+
var commitHints = normalizeRanked(object.similarCommits || object.similar_commits);
|
|
555
|
+
var merged = rankedHints.length
|
|
556
|
+
? rankedHints
|
|
557
|
+
: __spreadArray(__spreadArray([], __read(ticketHints), false), __read(commitHints), false).sort(function (a, b) { return b.score - a.score; })
|
|
558
|
+
.slice(0, Math.max(1, Math.min(12, Number(input.limit || 6))));
|
|
559
|
+
return {
|
|
560
|
+
ranked: merged,
|
|
561
|
+
similarTickets: ticketHints.length ? ticketHints : merged.filter(function (hint) { return hint.source !== 'git_commit'; }),
|
|
562
|
+
similarCommits: commitHints.length ? commitHints : merged.filter(function (hint) { return hint.source === 'git_commit' || !!hint.commitSha; }),
|
|
563
|
+
ignoredCount: Number(object.ignoredCount || object.ignored_count || 0),
|
|
564
|
+
generatedAt: cleanText(object.generatedAt || object.generated_at, 120) || isoNow(input.now)
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
return selectResolveIOSupportSimilarCaseHints(input);
|
|
568
|
+
}
|
|
569
|
+
function buildResolveIOSupportDiagnosisEvidencePack(input) {
|
|
570
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
571
|
+
if (input === void 0) { input = {}; }
|
|
572
|
+
var bundle = input.bundle;
|
|
573
|
+
var activeMicrotask = bundle
|
|
574
|
+
? selectResolveIOSupportV5ActiveMicrotask(bundle.supportV5MicrotaskLedger || [], bundle.supportV5ActiveMicrotaskId)
|
|
575
|
+
: undefined;
|
|
576
|
+
var diagnosisSource = input.diagnosisGate || (bundle === null || bundle === void 0 ? void 0 : bundle.supportV5DiagnosisGate);
|
|
577
|
+
var validation = validateResolveIOSupportDiagnosisGate(diagnosisSource);
|
|
578
|
+
var normalizedDiagnosis = validation.normalized;
|
|
579
|
+
var ownerFileHints = cleanList(__spreadArray(__spreadArray(__spreadArray([], __read(cleanList(input.ownerFiles, 16, 500)), false), __read(cleanList(normalizedDiagnosis === null || normalizedDiagnosis === void 0 ? void 0 : normalizedDiagnosis.owner_files, 16, 500)), false), __read(cleanList(activeMicrotask === null || activeMicrotask === void 0 ? void 0 : activeMicrotask.targetFiles, 8, 500)), false), 16, 500).map(normalizeOwnerFilePath).filter(Boolean);
|
|
580
|
+
var issueClassHint = normalizeIssueClass(input.issueClass || (normalizedDiagnosis === null || normalizedDiagnosis === void 0 ? void 0 : normalizedDiagnosis.issue_class));
|
|
581
|
+
var text = cleanText([
|
|
582
|
+
input.text,
|
|
583
|
+
bundle === null || bundle === void 0 ? void 0 : bundle.supportV5ScopeDigest,
|
|
584
|
+
(_a = bundle === null || bundle === void 0 ? void 0 : bundle.supportV5SupervisorState) === null || _a === void 0 ? void 0 : _a.currentGoal,
|
|
585
|
+
(_b = input.ticketContext) === null || _b === void 0 ? void 0 : _b.title,
|
|
586
|
+
(_c = input.ticketContext) === null || _c === void 0 ? void 0 : _c.subject,
|
|
587
|
+
(_d = input.ticketContext) === null || _d === void 0 ? void 0 : _d.summary
|
|
588
|
+
].filter(Boolean).join(' '), 3000);
|
|
589
|
+
var similarInput = {
|
|
590
|
+
issueClass: issueClassHint || (normalizedDiagnosis === null || normalizedDiagnosis === void 0 ? void 0 : normalizedDiagnosis.issue_class),
|
|
591
|
+
ownerFiles: ownerFileHints,
|
|
592
|
+
text: text,
|
|
593
|
+
candidates: Array.isArray(input.similarCaseHints) ? input.similarCaseHints : [],
|
|
594
|
+
limit: 6,
|
|
595
|
+
now: input.now
|
|
596
|
+
};
|
|
597
|
+
var similarCaseSelection = normalizeSupportSimilarCaseSelection(input.similarCaseHints, similarInput);
|
|
598
|
+
var status = validation.valid
|
|
599
|
+
? 'diagnosis_ready'
|
|
600
|
+
: validation.status === 'blocked'
|
|
601
|
+
? 'blocked'
|
|
602
|
+
: 'needs_diagnosis';
|
|
603
|
+
var generatedAt = isoNow(input.now);
|
|
604
|
+
return {
|
|
605
|
+
packId: "support-diagnosis-pack-".concat(hashResolveIOSupportV5Evidence({
|
|
606
|
+
status: status,
|
|
607
|
+
issueClassHint: issueClassHint,
|
|
608
|
+
ownerFileHints: ownerFileHints,
|
|
609
|
+
blockers: validation.blockers,
|
|
610
|
+
text: text,
|
|
611
|
+
activeMicrotaskId: activeMicrotask === null || activeMicrotask === void 0 ? void 0 : activeMicrotask.microtaskId
|
|
612
|
+
})),
|
|
613
|
+
status: status,
|
|
614
|
+
readOnly: true,
|
|
615
|
+
sourceEditsAllowed: false,
|
|
616
|
+
rootCauseFirstRequired: true,
|
|
617
|
+
requiredOutputKey: 'support_diagnosis_gate',
|
|
618
|
+
requiredFields: SUPPORT_DIAGNOSIS_GATE_REQUIRED_FIELDS,
|
|
619
|
+
requiredEvidence: SUPPORT_DIAGNOSIS_REQUIRED_EVIDENCE,
|
|
620
|
+
forbiddenActions: SUPPORT_DIAGNOSIS_FORBIDDEN_ACTIONS,
|
|
621
|
+
diagnosisValid: validation.valid,
|
|
622
|
+
diagnosisStatus: validation.status,
|
|
623
|
+
validationBlockers: validation.blockers,
|
|
624
|
+
issueClassHint: issueClassHint || undefined,
|
|
625
|
+
ownerFileHints: ownerFileHints.slice(0, 12),
|
|
626
|
+
activeMicrotaskId: activeMicrotask === null || activeMicrotask === void 0 ? void 0 : activeMicrotask.microtaskId,
|
|
627
|
+
similarCaseSelection: similarCaseSelection,
|
|
628
|
+
issueClassProbeCatalog: SUPPORT_ISSUE_CLASS_PROBE_CATALOG,
|
|
629
|
+
structuredFacts: {
|
|
630
|
+
currentDiagnosisStatus: validation.status,
|
|
631
|
+
currentDiagnosisValid: validation.valid,
|
|
632
|
+
reproductionStatus: normalizedDiagnosis === null || normalizedDiagnosis === void 0 ? void 0 : normalizedDiagnosis.issue_case.reproduction_status,
|
|
633
|
+
evidenceTypes: ((_e = validation.evidenceQuality) === null || _e === void 0 ? void 0 : _e.evidenceTypes) || [],
|
|
634
|
+
reproductionEvidenceTypes: ((_f = validation.evidenceQuality) === null || _f === void 0 ? void 0 : _f.reproductionEvidenceTypes) || [],
|
|
635
|
+
rootCauseEvidenceTypes: ((_g = validation.evidenceQuality) === null || _g === void 0 ? void 0 : _g.rootCauseEvidenceTypes) || [],
|
|
636
|
+
artifactBackedEvidenceCount: ((_h = validation.evidenceQuality) === null || _h === void 0 ? void 0 : _h.artifactBackedEvidenceCount) || 0,
|
|
637
|
+
similarHintCount: similarCaseSelection.ranked.length,
|
|
638
|
+
similarHintsAdvisoryOnly: true,
|
|
639
|
+
productRepairBlockedUntilDiagnosisPassed: validation.valid !== true
|
|
640
|
+
},
|
|
641
|
+
generatedAt: generatedAt
|
|
642
|
+
};
|
|
643
|
+
}
|
|
428
644
|
function normalizeSupportDiagnosisBusinessProofContract(value, issueClassHint) {
|
|
429
645
|
var source = cleanObject(value);
|
|
430
646
|
if (!Object.keys(source).length) {
|
|
@@ -3027,23 +3243,14 @@ function buildResolveIOSupportV5MicrotaskPrompt(input) {
|
|
|
3027
3243
|
var artifactPaths = cleanList(((_b = input.artifactPaths) === null || _b === void 0 ? void 0 : _b.length) ? input.artifactPaths : laneMemory.artifactPaths, 8, 200);
|
|
3028
3244
|
var targetFiles = cleanList(((_c = input.targetFiles) === null || _c === void 0 ? void 0 : _c.length) ? input.targetFiles : activeMicrotask === null || activeMicrotask === void 0 ? void 0 : activeMicrotask.targetFiles, 5, 160);
|
|
3029
3245
|
var contextSnippets = cleanList(input.contextSnippets, 5, 360);
|
|
3030
|
-
var
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
: input.similarCaseHints && typeof input.similarCaseHints === 'object'
|
|
3039
|
-
? {
|
|
3040
|
-
ranked: cleanObject(input.similarCaseHints).ranked || [],
|
|
3041
|
-
similarTickets: cleanObject(input.similarCaseHints).similarTickets || cleanObject(input.similarCaseHints).similar_tickets || [],
|
|
3042
|
-
similarCommits: cleanObject(input.similarCaseHints).similarCommits || cleanObject(input.similarCaseHints).similar_commits || [],
|
|
3043
|
-
ignoredCount: Number(cleanObject(input.similarCaseHints).ignoredCount || cleanObject(input.similarCaseHints).ignored_count || 0),
|
|
3044
|
-
generatedAt: cleanText(cleanObject(input.similarCaseHints).generatedAt || cleanObject(input.similarCaseHints).generated_at, 120)
|
|
3045
|
-
}
|
|
3046
|
-
: undefined;
|
|
3246
|
+
var diagnosisEvidencePack = buildResolveIOSupportDiagnosisEvidencePack({
|
|
3247
|
+
bundle: input.bundle,
|
|
3248
|
+
similarCaseHints: input.similarCaseHints,
|
|
3249
|
+
issueClass: diagnosisGate === null || diagnosisGate === void 0 ? void 0 : diagnosisGate.issue_class,
|
|
3250
|
+
ownerFiles: (diagnosisGate === null || diagnosisGate === void 0 ? void 0 : diagnosisGate.owner_files) || targetFiles,
|
|
3251
|
+
text: input.bundle.supportV5ScopeDigest || input.bundle.supportV5SupervisorState.currentGoal
|
|
3252
|
+
});
|
|
3253
|
+
var similarCaseSelection = diagnosisEvidencePack.similarCaseSelection;
|
|
3047
3254
|
var similarCaseHintsText = ((_d = similarCaseSelection === null || similarCaseSelection === void 0 ? void 0 : similarCaseSelection.ranked) === null || _d === void 0 ? void 0 : _d.length)
|
|
3048
3255
|
? __spreadArray([
|
|
3049
3256
|
'Similar accepted fix hints. Advisory only: use these to prioritize inspection paths, not as proof.'
|
|
@@ -3106,6 +3313,31 @@ function buildResolveIOSupportV5MicrotaskPrompt(input) {
|
|
|
3106
3313
|
"Before/action/after: ".concat(diagnosisGate.proof_plan.before || diagnosisGate.proof_plan.before_state_unavailable_reason, " -> ").concat(diagnosisGate.proof_plan.action, " -> ").concat(diagnosisGate.proof_plan.after)
|
|
3107
3314
|
].filter(Boolean).join('\n') : 'SupportDiagnosisGate is not valid. Park instead of editing product code.'
|
|
3108
3315
|
},
|
|
3316
|
+
diagnosisActive ? {
|
|
3317
|
+
name: 'diagnosis_evidence_pack',
|
|
3318
|
+
text: JSON.stringify({
|
|
3319
|
+
packId: diagnosisEvidencePack.packId,
|
|
3320
|
+
status: diagnosisEvidencePack.status,
|
|
3321
|
+
readOnly: diagnosisEvidencePack.readOnly,
|
|
3322
|
+
sourceEditsAllowed: diagnosisEvidencePack.sourceEditsAllowed,
|
|
3323
|
+
requiredOutputKey: diagnosisEvidencePack.requiredOutputKey,
|
|
3324
|
+
requiredFields: diagnosisEvidencePack.requiredFields,
|
|
3325
|
+
requiredEvidence: diagnosisEvidencePack.requiredEvidence,
|
|
3326
|
+
forbiddenActions: diagnosisEvidencePack.forbiddenActions,
|
|
3327
|
+
validationBlockers: diagnosisEvidencePack.validationBlockers,
|
|
3328
|
+
issueClassHint: diagnosisEvidencePack.issueClassHint,
|
|
3329
|
+
ownerFileHints: diagnosisEvidencePack.ownerFileHints,
|
|
3330
|
+
similarHintsAdvisoryOnly: true,
|
|
3331
|
+
similarHintCount: diagnosisEvidencePack.similarCaseSelection.ranked.length,
|
|
3332
|
+
issueClassProbeCatalog: diagnosisEvidencePack.issueClassProbeCatalog.map(function (entry) { return ({
|
|
3333
|
+
issue_class: entry.issue_class,
|
|
3334
|
+
action: entry.action,
|
|
3335
|
+
proof_required: entry.proof_required,
|
|
3336
|
+
acceptance_gate: entry.acceptance_gate,
|
|
3337
|
+
false_pass_blockers: entry.false_pass_blockers
|
|
3338
|
+
}); })
|
|
3339
|
+
})
|
|
3340
|
+
} : undefined,
|
|
3109
3341
|
diagnosisActive && similarCaseHintsText ? {
|
|
3110
3342
|
name: 'similar_accepted_fix_hints',
|
|
3111
3343
|
text: similarCaseHintsText
|
|
@@ -3186,6 +3418,7 @@ function buildResolveIOSupportV5MicrotaskPrompt(input) {
|
|
|
3186
3418
|
prompt: prompt,
|
|
3187
3419
|
promptTokenEstimate: promptTokenEstimate,
|
|
3188
3420
|
promptSections: promptSections,
|
|
3421
|
+
diagnosisEvidencePack: diagnosisEvidencePack,
|
|
3189
3422
|
activeMicrotask: activeMicrotask,
|
|
3190
3423
|
withinCap: promptTokenEstimate <= cap,
|
|
3191
3424
|
withinHardCap: promptTokenEstimate <= hardCap,
|