@resolveio/server-lib 22.3.194 → 22.3.196
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/util/ai-run-evidence-adapters.js +196 -88
- package/util/ai-run-evidence-adapters.js.map +1 -1
- package/util/ai-runner-manager-policy.d.ts +67 -0
- package/util/ai-runner-manager-policy.js +213 -1
- package/util/ai-runner-manager-policy.js.map +1 -1
- package/util/aicoder-runner-v6.d.ts +1 -0
- package/util/aicoder-runner-v6.js +187 -39
- package/util/aicoder-runner-v6.js.map +1 -1
|
@@ -316,10 +316,20 @@ export interface ResolveIOAIManagerHotfixEvidenceRecord {
|
|
|
316
316
|
githubCommitRequired: boolean;
|
|
317
317
|
githubCommitProofPassed: boolean;
|
|
318
318
|
commitProofStatus: 'not_required' | 'missing' | 'invalid' | 'passed';
|
|
319
|
+
commitFirstProtocol: 'not_required' | 'commit_first_hotfix';
|
|
320
|
+
commit_first_protocol: 'not_required' | 'commit_first_hotfix';
|
|
321
|
+
commitFirstProtocolSatisfied: boolean;
|
|
322
|
+
commit_first_protocol_satisfied: boolean;
|
|
323
|
+
liveHotfixBlockedUntilCommit: boolean;
|
|
324
|
+
live_hotfix_blocked_until_commit: boolean;
|
|
325
|
+
liveHotfixAllowed: boolean;
|
|
326
|
+
live_hotfix_allowed: boolean;
|
|
319
327
|
managerMustCommitBeforeHotfix: boolean;
|
|
320
328
|
githubCommitGuard: ResolveIOAIManagerHotfixGitProof;
|
|
321
329
|
readyForReleaseGate: boolean;
|
|
322
330
|
readyForContinuation: boolean;
|
|
331
|
+
managerContinuationAllowed: boolean;
|
|
332
|
+
manager_continuation_allowed: boolean;
|
|
323
333
|
}
|
|
324
334
|
export type ResolveIOAIManagerHotfixDurabilityStatus = 'not_required' | 'waiting_for_commit_proof' | 'ready_for_live_hotfix' | 'ready_for_release_gate' | 'ready_for_continuation';
|
|
325
335
|
export interface ResolveIOAIManagerHotfixDurabilityContractInput {
|
|
@@ -351,6 +361,16 @@ export interface ResolveIOAIManagerHotfixDurabilityContract {
|
|
|
351
361
|
can_hotfix_backend: boolean;
|
|
352
362
|
liveHotfixBlockedUntilCommit: boolean;
|
|
353
363
|
live_hotfix_blocked_until_commit: boolean;
|
|
364
|
+
durabilityProtocol: 'not_required' | 'commit_first_hotfix';
|
|
365
|
+
durability_protocol: 'not_required' | 'commit_first_hotfix';
|
|
366
|
+
commitFirstProtocolRequired: boolean;
|
|
367
|
+
commit_first_protocol_required: boolean;
|
|
368
|
+
commitFirstProtocolSatisfied: boolean;
|
|
369
|
+
commit_first_protocol_satisfied: boolean;
|
|
370
|
+
liveHotfixAllowed: boolean;
|
|
371
|
+
live_hotfix_allowed: boolean;
|
|
372
|
+
managerContinuationAllowed: boolean;
|
|
373
|
+
manager_continuation_allowed: boolean;
|
|
354
374
|
commitProofPassed: boolean;
|
|
355
375
|
commit_proof_passed: boolean;
|
|
356
376
|
commitProofStatus: ResolveIOAIManagerHotfixGitProofStatus | 'missing';
|
|
@@ -582,6 +602,46 @@ export interface ResolveIOAIManagerRecoveryExecutionDirective {
|
|
|
582
602
|
releasePolicy?: ResolveIOAIManagerHotfixFirstReleasePolicy;
|
|
583
603
|
createdAt: string;
|
|
584
604
|
}
|
|
605
|
+
export type ResolveIOAIManagerRecoveryExecutionProofStatus = 'proof_ready' | 'waiting_for_execution' | 'waiting_for_new_evidence' | 'blocked_same_evidence' | 'manual_handoff';
|
|
606
|
+
export interface ResolveIOAIManagerRecoveryExecutionProofContractInput {
|
|
607
|
+
directive?: ResolveIOAIManagerRecoveryExecutionDirective;
|
|
608
|
+
previous?: ResolveIOAIManagerFailureRecord;
|
|
609
|
+
current?: ResolveIOAIManagerFailureRecord;
|
|
610
|
+
requiredEvidence?: any;
|
|
611
|
+
now?: Date | string;
|
|
612
|
+
}
|
|
613
|
+
export interface ResolveIOAIManagerRecoveryExecutionProofContract {
|
|
614
|
+
contractId: string;
|
|
615
|
+
directiveId: string;
|
|
616
|
+
surface: string;
|
|
617
|
+
dispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction;
|
|
618
|
+
phase: ResolveIOAIManagerRecoveryExecutionPhase;
|
|
619
|
+
status: ResolveIOAIManagerRecoveryExecutionProofStatus;
|
|
620
|
+
canContinueRun: boolean;
|
|
621
|
+
canRunProductRepair: boolean;
|
|
622
|
+
canRunExpensiveModel: boolean;
|
|
623
|
+
canResetLoopBudget: boolean;
|
|
624
|
+
proofRequiredBeforeContinuation: boolean;
|
|
625
|
+
requiresNewEvidence: boolean;
|
|
626
|
+
newEvidence: boolean;
|
|
627
|
+
materialEvidence: boolean;
|
|
628
|
+
evidenceStrength: ResolveIOAIManagerEvidenceStrength;
|
|
629
|
+
evidenceSignals: string[];
|
|
630
|
+
startingFailureClass: string;
|
|
631
|
+
startingBlockerFingerprint: string;
|
|
632
|
+
startingEvidenceHash: string;
|
|
633
|
+
latestFailureClass: string;
|
|
634
|
+
latestBlockerFingerprint: string;
|
|
635
|
+
latestEvidenceHash: string;
|
|
636
|
+
requiredEvidence: string[];
|
|
637
|
+
missingEvidence: string[];
|
|
638
|
+
artifactPaths: string[];
|
|
639
|
+
changedFiles: string[];
|
|
640
|
+
blockers: string[];
|
|
641
|
+
nextAllowedAction: string;
|
|
642
|
+
forbiddenActions: string[];
|
|
643
|
+
createdAt: string;
|
|
644
|
+
}
|
|
585
645
|
export interface ResolveIOAIManagerRecoveryCheckpointInput {
|
|
586
646
|
plan: ResolveIOAIManagerRecoveryPlan;
|
|
587
647
|
current?: ResolveIOAIManagerFailureRecord;
|
|
@@ -713,6 +773,13 @@ export declare function buildResolveIOAIManagerRecoveryActionPacket(input: Resol
|
|
|
713
773
|
export declare function decideResolveIOAIManagerRecoveryActionDispatch(input: ResolveIOAIManagerRecoveryActionDispatchInput): ResolveIOAIManagerRecoveryActionDispatchDecision;
|
|
714
774
|
export declare function appendResolveIOAIManagerRecoveryActionDispatch(history: ResolveIOAIManagerRecoveryActionDispatchRecord[] | undefined, record: ResolveIOAIManagerRecoveryActionDispatchRecord | undefined, limit?: number): ResolveIOAIManagerRecoveryActionDispatchRecord[];
|
|
715
775
|
export declare function buildResolveIOAIManagerRecoveryExecutionDirective(input: ResolveIOAIManagerRecoveryExecutionDirectiveInput): ResolveIOAIManagerRecoveryExecutionDirective;
|
|
776
|
+
export declare function buildResolveIOAIManagerRecoveryExecutionProofContract(input?: ResolveIOAIManagerRecoveryExecutionProofContractInput): ResolveIOAIManagerRecoveryExecutionProofContract;
|
|
777
|
+
export declare function validateResolveIOAIManagerRecoveryExecutionProofContract(value: any): {
|
|
778
|
+
valid: boolean;
|
|
779
|
+
status: ResolveIOAIManagerRecoveryExecutionProofStatus | 'blocked';
|
|
780
|
+
blockers: string[];
|
|
781
|
+
normalized: ResolveIOAIManagerRecoveryExecutionProofContract;
|
|
782
|
+
};
|
|
716
783
|
export declare function assessResolveIOAIManagerEvidenceChange(previous: (ResolveIOAIManagerFailureRecord | ResolveIOAIManagerRecoveryCheckpoint | undefined), current: ResolveIOAIManagerFailureRecord | undefined, fallbackObjective?: string): ResolveIOAIManagerEvidenceAssessment;
|
|
717
784
|
export declare function decideResolveIOAIManagerRecoveryGate(input: ResolveIOAIManagerRecoveryGateInput): ResolveIOAIManagerRecoveryGateDecision;
|
|
718
785
|
export declare function buildResolveIOAIManagerRecoveryPlan(input?: ResolveIOAIManagerRecoveryPlanInput): ResolveIOAIManagerRecoveryPlan;
|
|
@@ -67,6 +67,8 @@ exports.buildResolveIOAIManagerRecoveryActionPacket = buildResolveIOAIManagerRec
|
|
|
67
67
|
exports.decideResolveIOAIManagerRecoveryActionDispatch = decideResolveIOAIManagerRecoveryActionDispatch;
|
|
68
68
|
exports.appendResolveIOAIManagerRecoveryActionDispatch = appendResolveIOAIManagerRecoveryActionDispatch;
|
|
69
69
|
exports.buildResolveIOAIManagerRecoveryExecutionDirective = buildResolveIOAIManagerRecoveryExecutionDirective;
|
|
70
|
+
exports.buildResolveIOAIManagerRecoveryExecutionProofContract = buildResolveIOAIManagerRecoveryExecutionProofContract;
|
|
71
|
+
exports.validateResolveIOAIManagerRecoveryExecutionProofContract = validateResolveIOAIManagerRecoveryExecutionProofContract;
|
|
70
72
|
exports.assessResolveIOAIManagerEvidenceChange = assessResolveIOAIManagerEvidenceChange;
|
|
71
73
|
exports.decideResolveIOAIManagerRecoveryGate = decideResolveIOAIManagerRecoveryGate;
|
|
72
74
|
exports.buildResolveIOAIManagerRecoveryPlan = buildResolveIOAIManagerRecoveryPlan;
|
|
@@ -910,6 +912,11 @@ function buildResolveIOAIManagerHotfixEvidenceRecord(input) {
|
|
|
910
912
|
var missingFields = requiredFields.filter(function (field) { return !hotfixEvidenceFieldPresent(normalized, field); });
|
|
911
913
|
var recordedAt = cleanDateString(input.now || (normalized === null || normalized === void 0 ? void 0 : normalized.recordedAt) || new Date());
|
|
912
914
|
var githubCommitGuard = validation.githubCommitGuard || evaluateResolveIOAIManagerHotfixGitProof(normalized || merged, channel);
|
|
915
|
+
var commitFirstProtocol = githubCommitGuard.required ? 'commit_first_hotfix' : 'not_required';
|
|
916
|
+
var commitFirstProtocolSatisfied = githubCommitGuard.required ? githubCommitGuard.passed === true : true;
|
|
917
|
+
var liveHotfixBlockedUntilCommit = githubCommitGuard.required === true && commitFirstProtocolSatisfied !== true;
|
|
918
|
+
var liveHotfixAllowed = validation.valid === true && validation.hotfixSatisfied === true && commitFirstProtocolSatisfied === true;
|
|
919
|
+
var readyForContinuation = validation.valid === true && validation.hotfixSatisfied === true && hotfixStatusPassed(normalized === null || normalized === void 0 ? void 0 : normalized.releaseGateStatus);
|
|
913
920
|
return {
|
|
914
921
|
recordId: cleanText(input.recordId, 160) || "hotfix-".concat(fingerprintResolveIOAIManagerBlocker("".concat(channel, ":").concat(githubCommitGuard.sourceCommitSha, ":").concat(recordedAt))),
|
|
915
922
|
recordedAt: recordedAt,
|
|
@@ -934,10 +941,20 @@ function buildResolveIOAIManagerHotfixEvidenceRecord(input) {
|
|
|
934
941
|
githubCommitRequired: githubCommitGuard.required,
|
|
935
942
|
githubCommitProofPassed: githubCommitGuard.passed,
|
|
936
943
|
commitProofStatus: githubCommitGuard.status,
|
|
944
|
+
commitFirstProtocol: commitFirstProtocol,
|
|
945
|
+
commit_first_protocol: commitFirstProtocol,
|
|
946
|
+
commitFirstProtocolSatisfied: commitFirstProtocolSatisfied,
|
|
947
|
+
commit_first_protocol_satisfied: commitFirstProtocolSatisfied,
|
|
948
|
+
liveHotfixBlockedUntilCommit: liveHotfixBlockedUntilCommit,
|
|
949
|
+
live_hotfix_blocked_until_commit: liveHotfixBlockedUntilCommit,
|
|
950
|
+
liveHotfixAllowed: liveHotfixAllowed,
|
|
951
|
+
live_hotfix_allowed: liveHotfixAllowed,
|
|
937
952
|
managerMustCommitBeforeHotfix: githubCommitGuard.managerMustCommitBeforeHotfix,
|
|
938
953
|
githubCommitGuard: githubCommitGuard,
|
|
939
954
|
readyForReleaseGate: validation.valid === true && validation.nextAction === 'rerun_release_gate',
|
|
940
|
-
readyForContinuation:
|
|
955
|
+
readyForContinuation: readyForContinuation,
|
|
956
|
+
managerContinuationAllowed: readyForContinuation,
|
|
957
|
+
manager_continuation_allowed: readyForContinuation
|
|
941
958
|
};
|
|
942
959
|
}
|
|
943
960
|
function pickFirstHotfixText(sources, keys, max, seen) {
|
|
@@ -1040,6 +1057,14 @@ function buildResolveIOAIManagerHotfixDurabilityContract(input) {
|
|
|
1040
1057
|
var sourceShaPassed = isFullGitCommitSha(sourceCommitSha);
|
|
1041
1058
|
var githubUrlSha = extractGithubCommitSha(githubCommitUrl);
|
|
1042
1059
|
var githubUrlPassed = !!githubUrlSha && (!sourceShaPassed || githubUrlSha === sourceCommitSha.toLowerCase());
|
|
1060
|
+
var existingMissingCommitFields = cleanList(existing.missingCommitProofFields || existing.missing_commit_proof_fields, 20, 160);
|
|
1061
|
+
var commitFirstProtocolRequired = githubCommitGuard.required === true
|
|
1062
|
+
|| existing.durabilityProtocol === 'commit_first_hotfix'
|
|
1063
|
+
|| existing.durability_protocol === 'commit_first_hotfix'
|
|
1064
|
+
|| existing.commitFirstProtocolRequired === true
|
|
1065
|
+
|| existing.commit_first_protocol_required === true
|
|
1066
|
+
|| existingMissingCommitFields.some(function (field) { return /sourceCommitSha|githubCommitUrl|gitCommitStatus|gitPushStatus/i.test(field); });
|
|
1067
|
+
var durabilityProtocol = commitFirstProtocolRequired ? 'commit_first_hotfix' : 'not_required';
|
|
1043
1068
|
var missingCommitProofFields = [
|
|
1044
1069
|
sourceShaPassed ? '' : 'sourceCommitSha',
|
|
1045
1070
|
githubUrlPassed ? '' : 'githubCommitUrl',
|
|
@@ -1047,12 +1072,17 @@ function buildResolveIOAIManagerHotfixDurabilityContract(input) {
|
|
|
1047
1072
|
pushPassed ? '' : 'gitPushStatus=passed'
|
|
1048
1073
|
].filter(Boolean);
|
|
1049
1074
|
var commitProofPassed = required ? missingCommitProofFields.length === 0 : githubCommitGuard.passed === true;
|
|
1075
|
+
var commitFirstProtocolSatisfied = commitFirstProtocolRequired ? commitProofPassed === true : true;
|
|
1050
1076
|
var liveHotfixBlockedUntilCommit = required && commitProofPassed !== true;
|
|
1051
1077
|
var releaseGatePassed = input.releaseGatePassed === true
|
|
1052
1078
|
|| hotfixStatusPassed((_e = validation.normalized) === null || _e === void 0 ? void 0 : _e.releaseGateStatus)
|
|
1053
1079
|
|| (continuation === null || continuation === void 0 ? void 0 : continuation.canContinueRun) === true;
|
|
1054
1080
|
var canPrepareHotfixPatch = required && (existing.canPrepareHotfixPatch === true || existing.can_prepare_hotfix_patch === true || actionRequiresHotfix || (continuation === null || continuation === void 0 ? void 0 : continuation.action) === 'record_hotfix_evidence');
|
|
1055
1081
|
var canHotfixBackend = required && commitProofPassed === true && canPrepareHotfixPatch === true;
|
|
1082
|
+
var liveHotfixAllowed = required && commitFirstProtocolSatisfied === true && canPrepareHotfixPatch === true;
|
|
1083
|
+
var managerContinuationAllowed = required
|
|
1084
|
+
? commitFirstProtocolSatisfied === true && validation.valid === true && releaseGatePassed === true
|
|
1085
|
+
: true;
|
|
1056
1086
|
var status = 'not_required';
|
|
1057
1087
|
if (required && liveHotfixBlockedUntilCommit) {
|
|
1058
1088
|
status = 'waiting_for_commit_proof';
|
|
@@ -1143,6 +1173,16 @@ function buildResolveIOAIManagerHotfixDurabilityContract(input) {
|
|
|
1143
1173
|
can_hotfix_backend: canHotfixBackend,
|
|
1144
1174
|
liveHotfixBlockedUntilCommit: liveHotfixBlockedUntilCommit,
|
|
1145
1175
|
live_hotfix_blocked_until_commit: liveHotfixBlockedUntilCommit,
|
|
1176
|
+
durabilityProtocol: durabilityProtocol,
|
|
1177
|
+
durability_protocol: durabilityProtocol,
|
|
1178
|
+
commitFirstProtocolRequired: commitFirstProtocolRequired,
|
|
1179
|
+
commit_first_protocol_required: commitFirstProtocolRequired,
|
|
1180
|
+
commitFirstProtocolSatisfied: commitFirstProtocolSatisfied,
|
|
1181
|
+
commit_first_protocol_satisfied: commitFirstProtocolSatisfied,
|
|
1182
|
+
liveHotfixAllowed: liveHotfixAllowed,
|
|
1183
|
+
live_hotfix_allowed: liveHotfixAllowed,
|
|
1184
|
+
managerContinuationAllowed: managerContinuationAllowed,
|
|
1185
|
+
manager_continuation_allowed: managerContinuationAllowed,
|
|
1146
1186
|
commitProofPassed: commitProofPassed,
|
|
1147
1187
|
commit_proof_passed: commitProofPassed,
|
|
1148
1188
|
commitProofStatus: commitProofPassed ? 'passed' : 'missing',
|
|
@@ -2320,6 +2360,178 @@ function buildResolveIOAIManagerRecoveryExecutionDirective(input) {
|
|
|
2320
2360
|
'Do not run product-code repair from this directive unless canRunProductRepair is true.'
|
|
2321
2361
|
], __read((((_e = action === null || action === void 0 ? void 0 : action.releasePolicy) === null || _e === void 0 ? void 0 : _e.forbiddenActions) || [])), false))).slice(0, 20) }), (dispatchDecision.dispatchRecord ? { dispatchRecord: dispatchDecision.dispatchRecord } : {})), ((action === null || action === void 0 ? void 0 : action.releasePolicy) ? { releasePolicy: action.releasePolicy } : {})), { createdAt: now });
|
|
2322
2362
|
}
|
|
2363
|
+
function failureRecordFromDirectiveStart(directive, previous) {
|
|
2364
|
+
if (previous) {
|
|
2365
|
+
return previous;
|
|
2366
|
+
}
|
|
2367
|
+
var dispatchRecord = directive === null || directive === void 0 ? void 0 : directive.dispatchRecord;
|
|
2368
|
+
return {
|
|
2369
|
+
lane: directive === null || directive === void 0 ? void 0 : directive.lane,
|
|
2370
|
+
stepType: directive === null || directive === void 0 ? void 0 : directive.stepType,
|
|
2371
|
+
failureClass: '',
|
|
2372
|
+
blockerFingerprint: dispatchRecord === null || dispatchRecord === void 0 ? void 0 : dispatchRecord.blockerFingerprint,
|
|
2373
|
+
evidenceHash: dispatchRecord === null || dispatchRecord === void 0 ? void 0 : dispatchRecord.evidenceHash,
|
|
2374
|
+
artifactPaths: (dispatchRecord === null || dispatchRecord === void 0 ? void 0 : dispatchRecord.artifactPaths) || [],
|
|
2375
|
+
recordedAt: (dispatchRecord === null || dispatchRecord === void 0 ? void 0 : dispatchRecord.createdAt) || (directive === null || directive === void 0 ? void 0 : directive.createdAt)
|
|
2376
|
+
};
|
|
2377
|
+
}
|
|
2378
|
+
function recoveryExecutionProofStatus(input) {
|
|
2379
|
+
var directive = input.directive;
|
|
2380
|
+
if (!directive || directive.allowed !== true || directive.dispatchAction === 'park_manual') {
|
|
2381
|
+
return 'manual_handoff';
|
|
2382
|
+
}
|
|
2383
|
+
if (!input.hasCurrent) {
|
|
2384
|
+
return 'waiting_for_execution';
|
|
2385
|
+
}
|
|
2386
|
+
if (directive.requiresNewEvidence === true && input.assessment.changed !== true) {
|
|
2387
|
+
return 'blocked_same_evidence';
|
|
2388
|
+
}
|
|
2389
|
+
if (directive.proofRequiredBeforeContinuation === true && input.assessment.material !== true) {
|
|
2390
|
+
return 'waiting_for_new_evidence';
|
|
2391
|
+
}
|
|
2392
|
+
return 'proof_ready';
|
|
2393
|
+
}
|
|
2394
|
+
function buildResolveIOAIManagerRecoveryExecutionProofContract(input) {
|
|
2395
|
+
if (input === void 0) { input = {}; }
|
|
2396
|
+
var directive = input.directive;
|
|
2397
|
+
var previous = failureRecordFromDirectiveStart(directive, input.previous);
|
|
2398
|
+
var current = input.current || {};
|
|
2399
|
+
var hasCurrent = !!input.current;
|
|
2400
|
+
var assessment = hasCurrent
|
|
2401
|
+
? assessResolveIOAIManagerEvidenceChange(previous, current, directive === null || directive === void 0 ? void 0 : directive.requiredStateTransition)
|
|
2402
|
+
: {
|
|
2403
|
+
changed: false,
|
|
2404
|
+
material: false,
|
|
2405
|
+
strength: 'none',
|
|
2406
|
+
signals: [],
|
|
2407
|
+
evidenceHash: hashResolveIOAIManagerEvidence(previous),
|
|
2408
|
+
blockerFingerprint: resolveResolveIOAIManagerBlockerFingerprint(previous, directive === null || directive === void 0 ? void 0 : directive.requiredStateTransition)
|
|
2409
|
+
};
|
|
2410
|
+
var status = recoveryExecutionProofStatus({ directive: directive, hasCurrent: hasCurrent, assessment: assessment });
|
|
2411
|
+
var canContinueRun = status === 'proof_ready';
|
|
2412
|
+
var requiredEvidence = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], __read(cleanList(input.requiredEvidence, 30, 500)), false), __read(cleanList(directive === null || directive === void 0 ? void 0 : directive.requiredArtifacts, 30, 500)), false), __read(cleanList(directive === null || directive === void 0 ? void 0 : directive.successCriteria, 30, 500)), false).filter(Boolean)));
|
|
2413
|
+
var missingEvidence = (directive === null || directive === void 0 ? void 0 : directive.proofRequiredBeforeContinuation) === true && status !== 'proof_ready'
|
|
2414
|
+
? (requiredEvidence.length ? requiredEvidence : ['new material evidence or passed proof artifact'])
|
|
2415
|
+
: [];
|
|
2416
|
+
var artifactPaths = cleanList(current.artifactPaths || previous.artifactPaths, 80, 500);
|
|
2417
|
+
var changedFiles = cleanList(current.changedFiles, 80, 500);
|
|
2418
|
+
var startingFailureClass = normalizeResolveIOAIManagerFailureClass(previous.failureClass);
|
|
2419
|
+
var latestFailureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass || previous.failureClass);
|
|
2420
|
+
var startingBlockerFingerprint = cleanText(previous.blockerFingerprint, 160)
|
|
2421
|
+
|| resolveResolveIOAIManagerBlockerFingerprint(previous, directive === null || directive === void 0 ? void 0 : directive.requiredStateTransition);
|
|
2422
|
+
var startingEvidenceHash = cleanText(previous.evidenceHash, 160)
|
|
2423
|
+
|| hashResolveIOAIManagerEvidence(previous);
|
|
2424
|
+
var blockers = [
|
|
2425
|
+
status === 'manual_handoff' ? ((directive === null || directive === void 0 ? void 0 : directive.reason) || 'recovery_execution_requires_manual_handoff') : '',
|
|
2426
|
+
status === 'waiting_for_execution' ? 'recovery_execution_waiting_for_current_evidence' : '',
|
|
2427
|
+
status === 'blocked_same_evidence' ? 'recovery_execution_same_evidence_after_dispatch' : '',
|
|
2428
|
+
status === 'waiting_for_new_evidence' ? 'recovery_execution_missing_material_evidence' : ''
|
|
2429
|
+
].filter(Boolean);
|
|
2430
|
+
var createdAt = isoNow(input.now);
|
|
2431
|
+
return {
|
|
2432
|
+
contractId: stableHash('mgr-execution-proof', {
|
|
2433
|
+
directiveId: (directive === null || directive === void 0 ? void 0 : directive.directiveId) || '',
|
|
2434
|
+
dispatchAction: (directive === null || directive === void 0 ? void 0 : directive.dispatchAction) || 'park_manual',
|
|
2435
|
+
status: status,
|
|
2436
|
+
startingEvidenceHash: startingEvidenceHash,
|
|
2437
|
+
latestEvidenceHash: assessment.evidenceHash,
|
|
2438
|
+
createdAt: createdAt.slice(0, 16)
|
|
2439
|
+
}),
|
|
2440
|
+
directiveId: cleanText(directive === null || directive === void 0 ? void 0 : directive.directiveId, 180),
|
|
2441
|
+
surface: cleanText(directive === null || directive === void 0 ? void 0 : directive.surface, 120) || 'runner',
|
|
2442
|
+
dispatchAction: (directive === null || directive === void 0 ? void 0 : directive.dispatchAction) || 'park_manual',
|
|
2443
|
+
phase: (directive === null || directive === void 0 ? void 0 : directive.phase) || 'manual',
|
|
2444
|
+
status: status,
|
|
2445
|
+
canContinueRun: canContinueRun,
|
|
2446
|
+
canRunProductRepair: canContinueRun && (directive === null || directive === void 0 ? void 0 : directive.canRunProductRepair) === true,
|
|
2447
|
+
canRunExpensiveModel: canContinueRun && (directive === null || directive === void 0 ? void 0 : directive.canRunExpensiveModel) === true,
|
|
2448
|
+
canResetLoopBudget: canContinueRun && assessment.material === true,
|
|
2449
|
+
proofRequiredBeforeContinuation: (directive === null || directive === void 0 ? void 0 : directive.proofRequiredBeforeContinuation) === true,
|
|
2450
|
+
requiresNewEvidence: (directive === null || directive === void 0 ? void 0 : directive.requiresNewEvidence) === true,
|
|
2451
|
+
newEvidence: assessment.changed,
|
|
2452
|
+
materialEvidence: assessment.material,
|
|
2453
|
+
evidenceStrength: assessment.strength,
|
|
2454
|
+
evidenceSignals: assessment.signals,
|
|
2455
|
+
startingFailureClass: startingFailureClass,
|
|
2456
|
+
startingBlockerFingerprint: startingBlockerFingerprint,
|
|
2457
|
+
startingEvidenceHash: startingEvidenceHash,
|
|
2458
|
+
latestFailureClass: latestFailureClass,
|
|
2459
|
+
latestBlockerFingerprint: assessment.blockerFingerprint,
|
|
2460
|
+
latestEvidenceHash: assessment.evidenceHash,
|
|
2461
|
+
requiredEvidence: requiredEvidence,
|
|
2462
|
+
missingEvidence: missingEvidence,
|
|
2463
|
+
artifactPaths: artifactPaths,
|
|
2464
|
+
changedFiles: changedFiles,
|
|
2465
|
+
blockers: blockers,
|
|
2466
|
+
nextAllowedAction: canContinueRun ? ((directive === null || directive === void 0 ? void 0 : directive.nextCommands[0]) || 'continue_gate') : 'collect_required_recovery_proof',
|
|
2467
|
+
forbiddenActions: Array.from(new Set(__spreadArray([
|
|
2468
|
+
'Do not continue product-code repair until recovery execution proof is proof_ready.'
|
|
2469
|
+
], __read(cleanList(directive === null || directive === void 0 ? void 0 : directive.forbiddenActions, 30, 500)), false))),
|
|
2470
|
+
createdAt: createdAt
|
|
2471
|
+
};
|
|
2472
|
+
}
|
|
2473
|
+
function validateResolveIOAIManagerRecoveryExecutionProofContract(value) {
|
|
2474
|
+
var source = value || {};
|
|
2475
|
+
var validStatuses = [
|
|
2476
|
+
'proof_ready',
|
|
2477
|
+
'waiting_for_execution',
|
|
2478
|
+
'waiting_for_new_evidence',
|
|
2479
|
+
'blocked_same_evidence',
|
|
2480
|
+
'manual_handoff'
|
|
2481
|
+
];
|
|
2482
|
+
var status = cleanText(source.status, 120);
|
|
2483
|
+
var normalized = {
|
|
2484
|
+
contractId: cleanText(source.contractId || source.contract_id, 180),
|
|
2485
|
+
directiveId: cleanText(source.directiveId || source.directive_id, 180),
|
|
2486
|
+
surface: cleanText(source.surface, 120),
|
|
2487
|
+
dispatchAction: cleanText(source.dispatchAction || source.dispatch_action, 120),
|
|
2488
|
+
phase: cleanText(source.phase, 120),
|
|
2489
|
+
status: validStatuses.includes(status) ? status : 'manual_handoff',
|
|
2490
|
+
canContinueRun: source.canContinueRun === true || source.can_continue_run === true,
|
|
2491
|
+
canRunProductRepair: source.canRunProductRepair === true || source.can_run_product_repair === true,
|
|
2492
|
+
canRunExpensiveModel: source.canRunExpensiveModel === true || source.can_run_expensive_model === true,
|
|
2493
|
+
canResetLoopBudget: source.canResetLoopBudget === true || source.can_reset_loop_budget === true,
|
|
2494
|
+
proofRequiredBeforeContinuation: source.proofRequiredBeforeContinuation === true || source.proof_required_before_continuation === true,
|
|
2495
|
+
requiresNewEvidence: source.requiresNewEvidence === true || source.requires_new_evidence === true,
|
|
2496
|
+
newEvidence: source.newEvidence === true || source.new_evidence === true,
|
|
2497
|
+
materialEvidence: source.materialEvidence === true || source.material_evidence === true,
|
|
2498
|
+
evidenceStrength: cleanText(source.evidenceStrength || source.evidence_strength, 120),
|
|
2499
|
+
evidenceSignals: cleanList(source.evidenceSignals || source.evidence_signals, 30, 200),
|
|
2500
|
+
startingFailureClass: cleanText(source.startingFailureClass || source.starting_failure_class, 120),
|
|
2501
|
+
startingBlockerFingerprint: cleanText(source.startingBlockerFingerprint || source.starting_blocker_fingerprint, 180),
|
|
2502
|
+
startingEvidenceHash: cleanText(source.startingEvidenceHash || source.starting_evidence_hash, 180),
|
|
2503
|
+
latestFailureClass: cleanText(source.latestFailureClass || source.latest_failure_class, 120),
|
|
2504
|
+
latestBlockerFingerprint: cleanText(source.latestBlockerFingerprint || source.latest_blocker_fingerprint, 180),
|
|
2505
|
+
latestEvidenceHash: cleanText(source.latestEvidenceHash || source.latest_evidence_hash, 180),
|
|
2506
|
+
requiredEvidence: cleanList(source.requiredEvidence || source.required_evidence, 30, 500),
|
|
2507
|
+
missingEvidence: cleanList(source.missingEvidence || source.missing_evidence, 30, 500),
|
|
2508
|
+
artifactPaths: cleanList(source.artifactPaths || source.artifact_paths, 80, 500),
|
|
2509
|
+
changedFiles: cleanList(source.changedFiles || source.changed_files, 80, 500),
|
|
2510
|
+
blockers: cleanList(source.blockers, 30, 500),
|
|
2511
|
+
nextAllowedAction: cleanText(source.nextAllowedAction || source.next_allowed_action, 180),
|
|
2512
|
+
forbiddenActions: cleanList(source.forbiddenActions || source.forbidden_actions, 30, 500),
|
|
2513
|
+
createdAt: cleanText(source.createdAt || source.created_at, 120)
|
|
2514
|
+
};
|
|
2515
|
+
var blockers = [
|
|
2516
|
+
normalized.contractId ? '' : 'Recovery execution proof is missing contractId.',
|
|
2517
|
+
normalized.directiveId || normalized.status === 'manual_handoff' ? '' : 'Recovery execution proof is missing directiveId.',
|
|
2518
|
+
normalized.dispatchAction ? '' : 'Recovery execution proof is missing dispatchAction.',
|
|
2519
|
+
validStatuses.includes(status) ? '' : 'Recovery execution proof has an invalid status.',
|
|
2520
|
+
normalized.canContinueRun && normalized.status !== 'proof_ready' ? 'Recovery execution cannot continue unless status=proof_ready.' : '',
|
|
2521
|
+
normalized.status === 'proof_ready' && normalized.proofRequiredBeforeContinuation && !normalized.materialEvidence ? 'Proof-ready recovery requires materialEvidence=true when proof is required.' : '',
|
|
2522
|
+
normalized.status === 'proof_ready' && normalized.requiresNewEvidence && !normalized.newEvidence ? 'Proof-ready recovery requires newEvidence=true when new evidence is required.' : '',
|
|
2523
|
+
normalized.canRunProductRepair && !normalized.canContinueRun ? 'Product repair cannot run before recovery proof can continue.' : '',
|
|
2524
|
+
normalized.canRunExpensiveModel && !normalized.canContinueRun ? 'Expensive model cannot run before recovery proof can continue.' : '',
|
|
2525
|
+
normalized.status !== 'proof_ready' && normalized.missingEvidence.length === 0 && normalized.proofRequiredBeforeContinuation ? 'Blocked recovery proof must list missingEvidence.' : '',
|
|
2526
|
+
normalized.forbiddenActions.length ? '' : 'Recovery execution proof must include forbiddenActions.'
|
|
2527
|
+
].filter(Boolean);
|
|
2528
|
+
return {
|
|
2529
|
+
valid: blockers.length === 0,
|
|
2530
|
+
status: blockers.length ? 'blocked' : normalized.status,
|
|
2531
|
+
blockers: blockers,
|
|
2532
|
+
normalized: normalized
|
|
2533
|
+
};
|
|
2534
|
+
}
|
|
2323
2535
|
function newListEntries(current, previous) {
|
|
2324
2536
|
var existing = new Set(previous.map(function (entry) { return cleanText(entry, 500); }).filter(Boolean));
|
|
2325
2537
|
return current
|