Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: clear recovered historical preservation diagnoses (#13267)
Adam Eivya2ddb721a22c
diff --git a/server/services/heldCheckoutRecovery.test.js b/server/services/heldCheckoutRecovery.test.jsindex eb31d6dff5..8b077a7344 100644--- a/server/services/heldCheckoutRecovery.test.js+++ b/server/services/heldCheckoutRecovery.test.js@@ -139,6 +139,21 @@ describe.skipIf(SKIP_HEAVY_INTEGRATION)('held checkout recovery (real git)', ()expect(recreated.retirementObligations[0].preservationEvidence.archives).toContainEqual({ archiveDir: saved.archiveDir, reason: 'archive-generation-mismatch' });});+ it.each([false, true])('clears the historical diagnosis after recovery retries, with other holds=%s', async otherHolds => {+ const { saved } = await historicalArchive();+ const unavailable = join(PATHS.cos, 'temporarily-unavailable-archive');+ await rename(saved.archiveDir, unavailable);+ const remaining = otherHolds ? [{ branch: 'feature/other', reason: 'worktree-locked' }] : [];+ const unresolved = await recordBranchReconcileOutcome('app-1', { status: 'incomplete', remaining });+ expect(unresolved.reason).toBe('historical-preservation-unresolved');+ await rename(unavailable, saved.archiveDir);+ const recovered = await recoverMissingCheckoutPreservations({ appId: 'app-1', repoPath: repo, outcome: unresolved });+ expect(recovered.retirementObligations).toEqual([]);+ expect(recovered.remaining).toEqual(remaining);+ expect(recovered).toMatchObject({ status: 'incomplete', reason: otherHolds ? 'remaining-holds' : 'preservation-recovered' });+ expect(recovered.nextAction).not.toContain('backup');+ });+it.each(['missing', 'wrong-repository', 'wrong-path', 'wrong-head', 'changed-file', 'changed-patch', 'legacy-dirty', 'legacy-corrupt-bundle', 'partial-original'])('retains an actionable historical obligation for %s preservation evidence', async failure => {const { release, saved } = await historicalArchive();diff --git a/server/services/taskSchedule.js b/server/services/taskSchedule.jsindex 8659c8518b..7c65be8420 100644--- a/server/services/taskSchedule.js+++ b/server/services/taskSchedule.js@@ -827,8 +827,17 @@ export async function recordRecoveredCheckoutPreservations(appId, expected, obsereturn diagnosedRow ? retirementObligations.filter(release => sameRetirementCheckout(release, diagnosedRow)) : [row];});const historical = retirementObligations.find(row => row.preservationEvidence);+ // Recovery proves preservation, not repository convergence. Retire the old+ // diagnosis and let the next sweep establish the aggregate completion state.+ const diagnosis = historical+ ? { status: 'incomplete', reason: 'historical-preservation-unresolved', nextAction: historical.preservationEvidence.nextAction }+ : outcome.reason === 'historical-preservation-unresolved'+ ? { status: 'incomplete', reason: remaining.length ? 'remaining-holds' : 'preservation-recovered',+ nextAction: remaining.length ? 'Resolve the remaining holds, then run branch reconciliation again.'+ : 'Historical preservation verified; run branch reconciliation again to confirm repository completion.' }+ : {};record.branchReconcileOutcome = { ...outcome, retirementObligations, recoveredPreservations, remaining, updatedAt: now,- ...(historical ? { status: 'incomplete', reason: 'historical-preservation-unresolved', nextAction: historical.preservationEvidence.nextAction } : {}),+ ...diagnosis,};return { result: record.branchReconcileOutcome, changed: true };});