feat(FN-3816): add merger self-healing for missing workspace and environmen
Implements merger self-healing with a missing workspace entry detector, bootstrap recovery path, and environment fault retry handling, plus supporting tests for merge error recovery and verification utilities, alongside documentation updates. Fusion-Task-Id: FN-3816
This commit is contained in:
@@ -30,6 +30,11 @@ export interface VerificationResult {
|
||||
buildResult?: VerificationCommandResult;
|
||||
allPassed: boolean;
|
||||
failedCommand?: string;
|
||||
environmentFault?: {
|
||||
kind: "missing-workspace-entry";
|
||||
packageName: string;
|
||||
recovered: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
// ── Process group exec ─────────────────────────────────────────────────
|
||||
@@ -173,6 +178,23 @@ export function truncateWithEllipsis(text: string, maxChars: number): string {
|
||||
return `${text.slice(0, maxChars)}\n... (truncated)`;
|
||||
}
|
||||
|
||||
export function detectMissingWorkspaceEntry(stderr: string, stdout?: string): { packageName: string } | null {
|
||||
const pattern = /Failed to resolve entry for package\s+"(@fusion\/[a-z0-9-]+|@fusion-plugin-examples\/[a-z0-9-]+)"/;
|
||||
const stderrMatch = stderr.match(pattern);
|
||||
if (stderrMatch) {
|
||||
return { packageName: stderrMatch[1] };
|
||||
}
|
||||
|
||||
if (stdout) {
|
||||
const stdoutMatch = stdout.match(pattern);
|
||||
if (stdoutMatch) {
|
||||
return { packageName: stdoutMatch[1] };
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function truncateOutput(output: string): string {
|
||||
if (output.length <= VERIFICATION_LOG_MAX_CHARS) return output;
|
||||
return `... output truncated to last ${VERIFICATION_LOG_MAX_CHARS} characters ...\n${output.slice(-VERIFICATION_LOG_MAX_CHARS)}`;
|
||||
|
||||
Reference in New Issue
Block a user