Truth File strategy: never seed from latest, calibrate or detect

CheckModpackUpdates:
- Reads .modpack-checker.json Truth File from server filesystem
- Falls back to manifest.json, extracts fileID, writes Truth File
- NEVER seeds current_version from latest API result
- Unknown version → status: pending_calibration (not up_to_date)
- Removed seedCurrentVersion heuristic — replaced with Truth File
- writeTruthFile() helper writes .modpack-checker.json via Wings

ModpackAPIController:
- calibrate() now writes Truth File after DB update
- Persists across server reinstalls and cron runs

wrapper.tsx:
- pending_calibration: shows "Version unknown" + "Identify Version" button
- Ignored servers: muted card with "Resume" button (not hidden)
- Extracted renderCalibrateDropdown() for reuse
- Error state shows message instead of vanishing

Migration:
- Updates existing unknown+detected rows to pending_calibration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude (Chronicler #83 - The Compiler)
2026-04-13 06:09:05 -05:00
parent f39b6d6c67
commit 27b2744786
5 changed files with 453 additions and 64 deletions

View File

@@ -394,6 +394,21 @@ class ModpackAPIController extends Controller
'status' => $updateAvailable ? 'update_available' : 'up_to_date',
]);
// Write Truth File to server filesystem
$modpackId = $cached->modpack_id ?? '';
try {
$this->fileRepository->setServer($server);
$this->fileRepository->putContent('.modpack-checker.json', json_encode([
'extension' => 'modpackchecker',
'project_id' => $modpackId,
'file_id' => $fileId,
'version' => $version,
'calibrated_at' => now()->toIso8601String(),
], JSON_PRETTY_PRINT));
} catch (\Exception $e) {
\Log::warning('[MVC] Could not write Truth File on calibrate: ' . $e->getMessage());
}
return response()->json([
'success' => true,
'current_version' => $version,