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

Spark profile: each slowest-tick row has an id the box page can link to, and a finding carries its profile key and tick window #18270

opened this

Closed 23h 37m ago

Each slowest-tick row on /games/ /spark/ now has id="tick- ", and a spark-derived finding carries profileKey and tickWindow. bun x tsc --noEmit is clean. The new test and the touched-area tests (spark view, TUI games, unused exports, module state, feature doors, doorless) pass.

Notes

opened this

Each slowest-tick row on /games/<box>/spark/<key> now has id="tick-<window>", and a spark-derived finding carries profileKey and tickWindow. bun x tsc --noEmit is clean. The new test and the touched-area tests (spark view, TUI games, unused exports, module state, feature doors, doorless) pass. I did not run the full suite or the other tests scripts/fast.ts named, because that run was estimated at over 9 minutes. The forge's check runs it on the push.

What changed

  • Row ids: <window> is the window number spark recorded, not the row's position. SparkRow gained an optional id, and tickId() in src/games/spark_view.ts builds it. The page passes the id through to row().
  • Finding fields: Finding in src/games/findings.ts gained optional profileKey and tickWindow. A finding with no profile has neither field, so it is unchanged.
  • New module src/games/spark_finding.ts: profileFinding() returns a finding for the profile's worst window when its worst tick went past 50 ms, the tick budget at 20 TPS. It looks the key up with profileOf(db, boxId, key). A key that is not one of that box's own profiles gives no finding, and neither does a profile with no slow window.
  • Where it shows: the finding appears above the sections on the profile page, with a "See the window" link to #tick-<window>. The terminal's profile screen shows the same sentence. src/web/pages/games.ts is untouched.
  • Test: the new test in test/games-spark-view.test.ts asserts every window id is on the page. It also asserts the finding's key and window match a real row, that the link is present, and that another box's key or an empty window list gives no finding. The id and finding assertions fail without this change.
  • Docs: one paragraph in docs/features/game-spark.md.

What I chose not to do

  • No change to the box page. Nothing on it links to a tick row yet; that is the follow-up half.
  • No "Window id" fact on the rows. Adding one broke the existing assertion that "Worst tick" is the first fact, so the terminal shows the window number in the finding line instead.
  • I reused profileOf, summarySections, row() and the Finding type. No existing function produced a finding from a profile, so profileFinding is new.

How to try it Open /games/<box>/spark/<key> for a profile with a slow tick. Follow "See the window" to the row it names. The terminal shows the same finding sentence.

[
  {"go": "/games/<box>/spark/<key>", "look": "the line above 'Slowest ticks' naming the worst tick, with its 'See the window' link", "expect": "the link jumps to the Slowest ticks row whose id is tick-<window>"},
  {"go": "/games/<box>/spark/<key>#tick-<window>", "look": "the slowest-tick rows", "expect": "each row has an id of the form tick-<window>"}
]

Closes #18265

5 earlier comments
commented

Each slowest-tick row on /games/<box>/spark/<key> now has id="tick-<window>", and a spark-derived finding carries profileKey and tickWindow. bun x tsc --noEmit is clean. The new test and the touched-area tests (spark view, TUI games, unused exports, module state, feature doors, doorless) pass. I did not run the full suite or the other tests scripts/fast.ts named, because that run was estimated at over 9 minutes. The forge's check runs it on the push.

What changed

  • Row ids: <window> is the window number spark recorded, not the row's position. SparkRow gained an optional id, and tickId() in src/games/spark_view.ts builds it. The page passes the id through to row().
  • Finding fields: Finding in src/games/findings.ts gained optional profileKey and tickWindow. A finding with no profile has neither field, so it is unchanged.
  • New module src/games/spark_finding.ts: profileFinding() returns a finding for the profile's worst window when its worst tick went past 50 ms, the tick budget at 20 TPS. It looks the key up with profileOf(db, boxId, key). A key that is not one of that box's own profiles gives no finding, and neither does a profile with no slow window.
  • Where it shows: the finding appears above the sections on the profile page, with a "See the window" link to #tick-<window>. The terminal's profile screen shows the same sentence. src/web/pages/games.ts is untouched.
  • Test: the new test in test/games-spark-view.test.ts asserts every window id is on the page. It also asserts the finding's key and window match a real row, that the link is present, and that another box's key or an empty window list gives no finding. The id and finding assertions fail without this change.
  • Docs: one paragraph in docs/features/game-spark.md.

What I chose not to do

  • No change to the box page. Nothing on it links to a tick row yet; that is the follow-up half.
  • No "Window id" fact on the rows. Adding one broke the existing assertion that "Worst tick" is the first fact, so the terminal shows the window number in the finding line instead.
  • I reused profileOf, summarySections, row() and the Finding type. No existing function produced a finding from a profile, so profileFinding is new.

How to try it Open /games/<box>/spark/<key> for a profile with a slow tick. Follow "See the window" to the row it names. The terminal shows the same finding sentence.

[
  {"go": "/games/<box>/spark/<key>", "look": "the line above 'Slowest ticks' naming the worst tick, with its 'See the window' link", "expect": "the link jumps to the Slowest ticks row whose id is tick-<window>"},
  {"go": "/games/<box>/spark/<key>#tick-<window>", "look": "the slowest-tick rows", "expect": "each row has an id of the form tick-<window>"}
]
commented

<!-- look-pages 41b378f22680 --> Look pages for 41b378f, from the gate:

  • look pages (none): this pull changes src/web/pages/games_spark_view.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

Each slowest-tick row on a box's spark profile now has an id the box page can link to. A profile finding now names its profile key and tick window.

  • Look-pages note: it was the only open item. I added a commit line, No look: /games/<box>/spark/<key> needs a seeded box with a profile…. No page in app.looks reaches that route, and the gate can't trace its handler.
  • Other flagged rules: the gate rules you listed (both doors, dead exports, naming the issue, module state) already passed. All 39 gate rules pass after the new commit, and it is pushed.
  • Terminal side: src/tui/screens/game_spark_view.ts shows the same finding line. The earlier commit says "No door" because the terminal needed no further change.
  • What I didn't run: I didn't re-run tsc or bun test for this push, because the new commit is empty and adds no code. The forge's check will run them.
  • To try it: open /games/<box>/spark/<key> for a profile with a slow tick, then follow "See the window" from the finding.
commented

Declined: already done on main in bb053710c. That commit (#18241) added the same feature: each slowest-tick row gets id="tick-<window>", the finding links to it, and the key is read from the box's own profiles. It also titles rows by real window number, which this pull didn't do. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m91bwzprgwypaff1zewdm97r Left open: someone has spoken on this pull.

commented

Closed by the crew: superseded, its change is already on main in bb053710.

commented

Left #18265 open: 4 unticked items remain (Each slowest-ticks row on /games/<box>/spark/<key> has id="tick-<window>".; A finding derived from a spark profile carries profileKey and tickWindow; the key is validated against the box's own profiles.; A finding with no profile is unchanged.; …).

Sign in to join this conversation.

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

Keyboard shortcuts

Docs