Public: anyone can read this; the crew can change it.

Games: a day after a mod set is installed, the games page says whether it helped, with take-back one tap away #18201

opened this

Merged 3h 13m ago, live in production

A day after a mod set lands on a server, the server's page, its terminal screen and the MCP games list answer say whether it helped. I ran the new and neighbouring tests, tsc and the gate locally; they pass, apart from the gate note and dupes warning below. The forge's full check runs on this push.

Notes

opened this

A day after a mod set lands on a server, the server's page, its terminal screen and the MCP games list answer say whether it helped. I ran the new and neighbouring tests, tsc and the gate locally; they pass, apart from the gate note and dupes warning below. The forge's full check runs on this push.

What changed

  • Install record: commitPlan now notes a set install or take-back as game.mods.set_installed or game.mods.set_taken_back in the existing event log. That event is the baseline's timestamp, so there is no new table and no migration.
  • Verdict module: src/games/set_verdict.ts compares the 24 h after with the 24 h before, read from the game_metric minutes the box already reports.
    • Rules: "helped" is mean tick time down 10% or more with TPS not lower. "hurt" is tick time up 10% or more, or TPS lower. "no change" is neither. "not enough numbers" is fewer than 12 minutes with readings on either side.
    • Players: each window's mean and peak players are in the sentence.
    • Waiting: until the day is over it says "measuring, the verdict comes in N h".
  • Restarts: the 10 minutes after any server start are dropped from both windows, and the day after begins at the restart the install caused.
  • Page and terminal: the server's page shows the sentence under its figures, and the terminal's people tab shows the same sentence.
  • MCP: list adds modSets to a server, with the same sentence.
  • Take-back: on "hurt" the page offers "Preview taking it back" (?undo=set:<name>), then "Take it back and restart" as one commit. mods_remove and the terminal's Mods d take set:<name> too. It removes the set's members and what only they required, and keeps a member that something outside the set requires. Nothing is taken back unless a person commits it.

What I chose not to do

  • Where it shows: the box page's list of servers carries no verdict yet.
  • TPS tolerance: TPS is compared at the tenth, so 19.98 against 20 is not "down".
  • Install timestamp: the baseline starts at the install commit's time, not when the server actually restarted.

Tests and the gate

  • test/set-verdict.test.ts covers each of the four words, the restart case, "measuring", and take-back.
  • test/game-mods.test.ts covers events from real installs, the page, MCP and terminal sentences, and the take-back preview then commit. I moved its mcp helper to file level and made call use it.
  • The gate's both-doors rule wanted a new terminal screen, so I waived it with a No door: line. The terminal side is the existing server screen, and the how-to is docs/features/game-mods.md, both edited. The gate also wanted a look, so I added a No look: line, since the server page needs a signed-in box.
  • The gate still warns that my test mcp helper looks like call in test/game-plugin-config.test.ts, and it notes some comment lines over 100 columns.

To try it Install a set from a Fabric server's Mods block, then open /games/<box>/<service> a day later. Or call games with action: list and read modSets.

Closes #18192

3 earlier comments
commented

A day after a mod set lands on a server, the server's page, its terminal screen and the MCP games list answer say whether it helped. I ran the new and neighbouring tests, tsc and the gate locally; they pass, apart from the gate note and dupes warning below. The forge's full check runs on this push.

What changed

  • Install record: commitPlan now notes a set install or take-back as game.mods.set_installed or game.mods.set_taken_back in the existing event log. That event is the baseline's timestamp, so there is no new table and no migration.
  • Verdict module: src/games/set_verdict.ts compares the 24 h after with the 24 h before, read from the game_metric minutes the box already reports.
    • Rules: "helped" is mean tick time down 10% or more with TPS not lower. "hurt" is tick time up 10% or more, or TPS lower. "no change" is neither. "not enough numbers" is fewer than 12 minutes with readings on either side.
    • Players: each window's mean and peak players are in the sentence.
    • Waiting: until the day is over it says "measuring, the verdict comes in N h".
  • Restarts: the 10 minutes after any server start are dropped from both windows, and the day after begins at the restart the install caused.
  • Page and terminal: the server's page shows the sentence under its figures, and the terminal's people tab shows the same sentence.
  • MCP: list adds modSets to a server, with the same sentence.
  • Take-back: on "hurt" the page offers "Preview taking it back" (?undo=set:<name>), then "Take it back and restart" as one commit. mods_remove and the terminal's Mods d take set:<name> too. It removes the set's members and what only they required, and keeps a member that something outside the set requires. Nothing is taken back unless a person commits it.

What I chose not to do

  • Where it shows: the box page's list of servers carries no verdict yet.
  • TPS tolerance: TPS is compared at the tenth, so 19.98 against 20 is not "down".
  • Install timestamp: the baseline starts at the install commit's time, not when the server actually restarted.

Tests and the gate

  • test/set-verdict.test.ts covers each of the four words, the restart case, "measuring", and take-back.
  • test/game-mods.test.ts covers events from real installs, the page, MCP and terminal sentences, and the take-back preview then commit. I moved its mcp helper to file level and made call use it.
  • The gate's both-doors rule wanted a new terminal screen, so I waived it with a No door: line. The terminal side is the existing server screen, and the how-to is docs/features/game-mods.md, both edited. The gate also wanted a look, so I added a No look: line, since the server page needs a signed-in box.
  • The gate still warns that my test mcp helper looks like call in test/game-plugin-config.test.ts, and it notes some comment lines over 100 columns.

To try it Install a set from a Fabric server's Mods block, then open /games/<box>/<service> a day later. Or call games with action: list and read modSets.

commented

This pull makes the games page, terminal and MCP say a day after a mod set is installed whether it helped, with take-back one action away. This push fixes the failing "every kind the source emits is classified" test.

What changed in the fix

  • noteSet in src/games/set_verdict.ts built the event kind from a template (game.mods.set_${op}). The audience-coverage scan can't read that, so it failed. It now uses two literal kinds, game.mods.set_installed and game.mods.set_taken_back.
  • src/core/event_audience.ts now lists both kinds as admins-only. They were unclassified before, which already meant admins-only. Listing them makes that deliberate.

I didn't touch any test. I ran the audience-coverage and game-mods tests (48 pass) and tsc --noEmit, and the gate raised no new failures. I did not run the full suite, which the forge's check does.

What I left out

  • Readers and guests don't see these events.

How to try it

  • Install a mod set on a game box and look at the games page a day later. test/game-mods.test.ts covers the events, and the verdict is covered the same way.
commented

I merged main into the branch and pushed. The branch merges cleanly again.

Conflicts

  • src/games/mods.ts: main replaced the plan's single config field with a configs list (from #18196's spark change). I kept configs and kept this pull's set field beside it.
  • test/game-mods.test.ts: both sides had added a new describe block at the same spot, "did the set help (#18192)" here and the #18196 slug-ownership one on main. I kept both and closed the first block.

Checks

  • bun x tsc --noEmit is clean.
  • The game-mods and event-audience-coverage tests pass (52 tests).
  • I didn't run the full suite or the gate after the merge. The forge's check runs the full suite on the push.
commented

A day after a mod set is installed, the games page and the box page now say whether it helped. Each server's row in the box's list carries the verdict word and both tick times, for example Admin set: hurt, tick time 30 ms → 45 ms. bun x tsc --noEmit, bun scripts/design-lint.ts and the tests in test/set-verdict.test.ts and test/game-mods.test.ts pass. I did not run the whole suite. The gate's remaining output is one similarity note, between two test helpers, mcp in test/game-mods.test.ts and call in test/game-plugin-config.test.ts. I left it alone. It is not from this change.

What changed

  • Box list: each server's row lists its sets, so the box page shows the verdict for the server without opening it. This is the box 3 the review asked for.
  • Server page: the verdict is now a plain row. The set name is the title and the verdict is a fact: the word plus both tick times. The TPS and player counts sit in the row's meta line. The boxed notice and the sentence "Taking it back is one action." are gone. Preview taking it back is the row's button and still only previews. Nothing is taken back unless a person commits it.
  • Terminal and MCP: they still carry the full sentence, minus the dropped line.
  • Docs: the docs/features/game-mods.md bullet is shorter and now sits above the "All three read and write…" line.
  • Code: src/games/set_verdict.ts now gives each verdict a short and a detail field for the row. The full sentence is built from the same pieces.
  • Tests: they now check the server's row on the box page and the absence of the dropped sentence.

Left out: the terminal's box-level server list does not show the verdict. Only the server's own screen does, as before. The commit message says No door: for this reason. The page's new row has the same sentence on the terminal's server screen, and MCP list already carries it.

Review

[
  {"go": "/games/<box>", "look": "a server that has a mod set installed over a day ago", "expect": "its row shows the set's name with the word and both tick times, e.g. hurt, tick time 30 ms → 45 ms"},
  {"go": "/games/<box>/<server>", "look": "the verdict row under the figures", "expect": "the set name, the word with both tick times, then TPS and players; Preview taking it back appears only on a hurt set"}
]

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs