Public: anyone can read this; the crew can change it.
Games: a mod-set install refuses a Modrinth slug that now points at a different project than the lock holds #18200
Merged 4h 19m ago, live in production
An install now checks Modrinth against the lock. If a slug the lock already holds now names a different project, or the same project under a different owner, Modrinth is asked fresh and the install is refused.
-
Reviews
ApprovedThe refusal names both projects and both owners, is raised in planInstall and planSet before any write, and reaches the page, the terminal and MCP through the one shared error, so the words are the same on every door. The check asks Modrinth afresh (ttl 0 now skips the cache read too), which is the right call. Tests use the fixture Modrinth, cover swapped id and swapped owner, assert the lock and sha are unchanged, and the how-to is in docs/features/game-mods.md, not the README.
Two things I would do next:
- A Modrinth timeout or rate limit during slugsHold now blocks the whole install with that transport error. Say in the words that the slug could not be verified, or add a test for that path, so a person is not left reading a generic network message.
- Locks written before this change hold no author, so only the project id is compared for them; consider backfilling the owner on the next update of a top project so older locks get the same protection.
-
Checks
shipped production is serving it deploy a338207
-
History
- Games: rewrap the api comment (gate --fix) 9aafe67
- Games: a mod install refuses a Modrinth slug that now names another project than the lock holds e416c57
- Games: the forge pins forge-velocity bee2a65cf3f2 (/forge answers from a SQLite snapshot at once, one clean style) (#18163) b4fe556
- Games survival step 3c: a vein-miner mod in the quality set (#18177) bd6dc66
- Bug and crash reports from an app become work: an issue on its repository, a triage, and a fix pull (#18097) 68dcbf7
- Games survival step 4: admin mods (luckperms fabric, ledger with fabric-language-kotlin) (#18148) 4fb3248
- Games: /forge reads are answered in the same sync, and the agent sends a request within a fifth of a second (#18149) e529fa8
- Traces 5a: compare two traces of one issue side by side, with the cost and time difference (#18164) e7394aa
- Access 3a: the /api/v1 repository routes ask may(), shadowed first, then their inline checks go (#18165) 7ba81ba
- Spark's config is installed with the mod so a profile uploads to the forge and never elsewhere (#18173) 7de2fc0
- Games survival step 3b: a sleep (night-skip) mod in the quality set (#18172) 56e2b82
- Automate a review finding as a lint or test: One high finding, then smaller ones, all for one round. (#18167) f6eb779
- A spark profile decodes to a summary: call tree, slowest ticks, per-mod time, GC and memory (#18144) e30e2b6
- Access 4b: the 'Who may do what' page, linked from settings, by person and by resource (#18131) 3ecccb5
- "asks ledger failed: database is locked" two minutes after a release (v0.7.733) (#18169) 009df15
- Traces 4: a Claude Code session file imports as a trace and is listed beside the others (#18129) 68f0754
- A game box stores spark profiles in the forge: POST /post gives a Location, reads need the box's game grants (#18146) b992c0d
- Games survival step 3: quality-of-life mods tried on a copy first (graves, essential-commands, sleep, harvest, vein miner, styled-chat) (#18145) f058287
- Spend 1: a monthly budget per cloud account, one notice at 80% and one at 100% (#18121) 3382c40
- Games: a proxy plugin update can wait until nobody has been on for 30 minutes (#18039) 9a5eb31
An install now checks Modrinth against the lock. If a slug the lock already holds now names a different project, or the same project under a different owner, Modrinth is asked fresh and the install is refused. Nothing is written, and the refusal names both: "essential-commands is now project ECid0002 by mallory; the lock holds ECid0001 by patbox — nothing installed. If it moved on purpose, remove Essential Commands and add essential-commands again." This covers single installs and sets (#18196).
What changed
src/games/modrinth.tsLockedhas an optionalauthor: the project's owner on Modrinth, read from/v2/project/<id>/members.resolverecords the owner the first time a project is asked for, and keeps it on later updates. That is the trust-on-first-use record. Dependencies, and projects Modrinth names no owner for, get noauthor, so older locks and the existing tests are unchanged.- New
slugsHold(app, lock, slugs)does the check. A slug Modrinth no longer has is left to the lock's project id, as before.
- Freshness: the check skips the response cache. A
ttlMsof 0 inapiused to skip only writing to the cache, so the check was reading a 30-minute-old answer. Now 0 also skips reading. src/games/mods.tsplanInstallandplanSetcallslugsHoldbefore they resolve.- In an optional set (
set:quality), a moved slug refuses the whole set. Otherwise it would have shown up as a "Left out …" line. parseLockkeepsauthoronly when it is a string.
- Same words everywhere: the page, the terminal (
src/tui/screens/game_mods.ts) and the MCPmods_installaction all showplanInstall's error, so none of them changed. - Docs:
docs/features/game-mods.mdgains a "A slug that moved" entry.
Tests: test/game-mods.test.ts gains a members route on the fixture Modrinth and four tests:
- the first install records the project id and owner;
- a swapped project id is refused with the exact words in the planner, the page preview, MCP (
dryRun: false) and the terminal (q), and the commit and lock stay unchanged; - the same id under a new owner is refused;
- the same id and owner installs.
With the check switched off, the two refusal tests fail. The type check and 180 tests across 15 files pass, including the game suites, mcp-size, unused-exports, module-state and dupes. bun scripts/gate.ts reports 0 failures, and its --fix comment rewrap is in its own commit.
What I chose not to do
- No new MCP tool or page code: the refusal comes through
planInstall, which all three already share. - A project whose slug changes during an update (same id) is still followed, as before. Only a slug the lock holds, asked for again by install or set, is checked.
- No reuse from
bun scripts/similar.ts:ownerOfis small and Modrinth-specific, andslugsHoldreuses the existingprojectandapihelpers rather than adding new fetch paths.
Risk: a project that changes owner on purpose is refused until someone removes it and adds it again, and the refusal says so. No new outside host: api.modrinth.com is already in forge.json egress.
To try it: on a Fabric service whose lock holds essential-commands as a dependency, preview set:quality while Modrinth's slug points elsewhere. Or run bun test test/game-mods.test.ts -t 18196.
🤖 Generated with Claude Code
Left #18196 open: 1 unticked item remain (When a set member (src/games/mod_sets.ts) resolves by slug through src/games/modrinth.ts, and the service's lockfile already holds that slug with a project id, a different project id or author is refused with words that name both ("essential-commands is now project X by Y; the lock holds Z by W — nothing installed").).
An install now checks Modrinth against the lock. If a slug the lock already holds now names a different project, or the same project under a different owner, Modrinth is asked fresh and the install is refused. Nothing is written, and the refusal names both: "essential-commands is now project ECid0002 by mallory; the lock holds ECid0001 by patbox — nothing installed. If it moved on purpose, remove Essential Commands and add essential-commands again." This covers single installs and sets (#18196).
What changed
src/games/modrinth.tsLockedhas an optionalauthor: the project's owner on Modrinth, read from/v2/project/<id>/members.resolverecords the owner the first time a project is asked for, and keeps it on later updates. That is the trust-on-first-use record. Dependencies, and projects Modrinth names no owner for, get noauthor, so older locks and the existing tests are unchanged.slugsHold(app, lock, slugs)does the check. A slug Modrinth no longer has is left to the lock's project id, as before.ttlMsof 0 inapiused to skip only writing to the cache, so the check was reading a 30-minute-old answer. Now 0 also skips reading.src/games/mods.tsplanInstallandplanSetcallslugsHoldbefore they resolve.set:quality), a moved slug refuses the whole set. Otherwise it would have shown up as a "Left out …" line.parseLockkeepsauthoronly when it is a string.src/tui/screens/game_mods.ts) and the MCPmods_installaction all showplanInstall's error, so none of them changed.docs/features/game-mods.mdgains a "A slug that moved" entry.Tests:
test/game-mods.test.tsgains a members route on the fixture Modrinth and four tests:dryRun: false) and the terminal (q), and the commit and lock stay unchanged;With the check switched off, the two refusal tests fail. The type check and 180 tests across 15 files pass, including the game suites,
mcp-size,unused-exports,module-stateanddupes.bun scripts/gate.tsreports 0 failures, and its--fixcomment rewrap is in its own commit.What I chose not to do
planInstall, which all three already share.bun scripts/similar.ts:ownerOfis small and Modrinth-specific, andslugsHoldreuses the existingprojectandapihelpers rather than adding new fetch paths.Risk: a project that changes owner on purpose is refused until someone removes it and adds it again, and the refusal says so. No new outside host:
api.modrinth.comis already inforge.jsonegress.To try it: on a Fabric service whose lock holds
essential-commandsas a dependency, previewset:qualitywhile Modrinth's slug points elsewhere. Or runbun test test/game-mods.test.ts -t 18196.🤖 Generated with Claude Code
Closes #18196