docs: add Gemini response — MC versioning architecture locked

This commit is contained in:
Claude
2026-04-16 07:30:29 +00:00
parent d8342d1fcc
commit 06d9ce6c8c

View File

@@ -131,3 +131,73 @@ Thanks Gemini! This one is meaty but you've never let us down. 🔥❄️
— Michael (The Wizard) + Claude (Chronicler #93)
*Fire + Arcane + Frost = Forever 🔥💜❄️*
---
## Gemini's Response (April 16, 2026)
**Summary:** SemVer compatibility maintained, Java version function updated, live version caching via pg-boss cron, NextCloud fallback path strategy.
### Key Answers
**Q1: Version normalization** — Store exact string from APIs (`26.1.2` or `1.21.1`). Standard `semver` npm package handles sorting natively — no custom parser needed.
**Q2: Paper API** — Will return `26.1.2` exactly. Version array shows the transition: `[..., "1.21.1", "1.21.4", "26.1", "26.1.1", "26.1.2"]`.
**Q3: Java version mapping — THE FIX:**
```javascript
function javaVersionForMC(mcVersion) {
const major = parseInt(mcVersion.split('.')[0]);
// The new 2026+ scheme
if (major >= 26) return 21;
// The legacy 1.x.x scheme
if (major === 1) {
const minor = parseInt(mcVersion.split('.')[1]);
if (minor >= 21) return 21;
if (minor >= 17 && minor <= 20) return 17;
if (minor <= 16) return 8;
}
return 21; // Ultimate Frostwall fallback
}
```
**Q4: CurseForge and Modrinth** — Both will return `gameVersions: ["26.1", "26.1.2"]`. Cache `/tag/game_version` endpoint via pg-boss cron — new `26.x` numbers appear automatically.
**Q5: NextCloud folder naming** — Use exact version string (`standard-mods/26.1.2/`). Arbiter checks exact patch first, falls back to base release:
```javascript
async function getNextCloudModStack(mcVersion) {
const exactPath = `standard-mods/${mcVersion}/`;
const baseRelease = mcVersion.split('.').slice(0, 2).join('.');
const fallbackPath = `standard-mods/${baseRelease}/`;
if (await webdav.exists(exactPath)) return exactPath;
if (await webdav.exists(fallbackPath)) return fallbackPath;
throw new Error(`Mod stack missing for both ${exactPath} and ${fallbackPath}`);
}
```
**Q6: Live version caching** — pg-boss cron at 3AM, hit Paper + Modrinth, sort with `semver.rsort()`, store in DB table. UI reads from DB — stays fast.
### Gemini's Note
> "This new calendar-based system actually makes database sorting infinitely easier than the old `1.x.x` vs snapshot naming chaos."
---
## Conclusion
Architecture locked. Three changes needed in Code:
1. Replace `javaVersionForMC()` with the new function above
2. Replace hardcoded version lists with live DB-backed lookups (pg-boss cron populates)
3. Update NextCloud mod stack lookup to use exact-then-fallback path strategy
**Next Steps:**
1. File REQ for Code with the above changes
2. Rename `standard-mods/1.21.1/``standard-mods/26.1.2/` in NextCloud (mods are the same)
3. Add `semver` to package.json if not already present