Repository navigation
Rank related and trending projects by how long people play, and count visit depth - #78
Merged
Merged
Conversation
Mistium
force-pushed
the
session-depth-api
branch
from
November 15, 2026 04:34
2f1c48a to
9903a65
Compare
… visit depth Related projects now lead with projects that at least three of the same players stayed in, on projects with at least five such players, weighted toward players with fewer plays. Co-played projects fill at most half the list, before the same owner, shared tags and trending. Trending and the daily featured project weight week views by the share of signed-in players with 30 seconds or more of total playtime, smoothed so projects with little playtime sit in the middle. Only plays updated in the last 90 days count. Owners' own plays, banned and shadowbanned players, and players whose recent activity is hidden (minors and students by default) never count, so co-play only draws on activity their profiles already show. The signals are rebuilt from project_playtime under one lock and cached for five minutes, and ties sort by a single comparator so the order is stable. The funnel accepts visit_start (new or returning device) and visit_depth (2, 3, 5 or 10 projects in one visit).
Mistium
force-pushed
the
session-depth-api
branch
from
November 15, 2026 04:48
9903a65 to
c0ebc04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the work to keep people watching projects for longer. In production from Nov 2 to 15, about 95% of project views ended on that project: 117 related-project clicks against 2,542 views, and 1 click on Next project. Half of signed-in plays lasted under 30 seconds.
Related projects
GET /v1/projects/:id/relatednow leads with projects the same players stayed in:Trending and featured
explore?sort=trendingand the daily featured project weight week views by(held + 2) / (players + 4). Projects people stay in rise, projects people bounce off sink, and projects with little playtime sit in the middle.Whose plays count
Owners' own plays never count, and neither do banned or shadowbanned players. Nor do players whose recent activity is hidden, which covers minors and students by default and anyone who switched it off. So co-play only draws on play history that players' profiles already show publicly. Review found that without this, a new project could be used to reveal what a single person had played.
Cost
The signals rebuild from
project_playtimeunder one lock and are cached for five minutes. A failed read caches an empty result instead of retrying on every request.trendingOrderover 5,000 entries takes about 12 ms. Ties sort through a single comparator, becausesortByis not stable past 12 items.Funnel counters
POST /v1/eventsacceptsvisit_start(new|returning) andvisit_depth(2|3|5|10), so Admin → Activity can show returning visitors and how many projects a visit reaches. The site starts sending them in the matching scratch-gui PR.Content update time
Project index entries now include
lastUploadAt, and merging a pull request into a project sets it. The site uses it to show "Updated since you played" and the Updated date only when a project's content changed, not when its thumbnail, title or sharing changed.Checks
osl teston 6.1.1: 61 passed.lsp check,compileand conventions pass.e2e_smoke.pypasses.Version
1.0.1 → 1.1.0 (minor: new ranking and counters, backwards compatible).
No screenshots: backend only. The visible changes come with the scratch-gui PR.