Repository navigation
LOCAL: serve the TeamClaude day leaderboard over teamclaude.leaderboard - #68
Merged
Merged
Conversation
…nt seam Shared surface for the sidebar leaderboard: the snapshot the runtime host serves from the coordinator's existing /teamclaude/status, and the renderer client the sidebar calls. The client returns null until the service lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime host reads its coordinator's existing GET /teamclaude/status with the wrapper's operator key, pinned to the single online tailnet peer the Tailscale netmap binds to the configured *.ts.net name, under one 10 s deadline. Only the ranked board leaves the main process: minidev-<person><n> clients fold into one person, sixthman-* hosts are excluded, and ranking uses fresh (non-cache-read) tokens with shared ranks for ties. Reads happen on demand, at most once per refresh interval, with concurrent callers sharing one read. A failed refresh keeps the last good board marked stale; without one the method reports why it is unavailable. The renderer client returns null for runtimes without the method or callers refused it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
ELI5
This is the data behind #67's leaderboard. On a minidev with TeamClaude, Orca asks the TeamClaude coordinator for everyone's token use today, merges each person's VMs into one score, ranks them and hands the sidebar a small, safe board. It never sends the key or the coordinator's raw data to the UI.
What Changed
The runtime host (the minidev's Orca main process) gains a TeamClaude leaderboard service,
src/main/teamclaude-leaderboard/, exposed as the read-only runtime RPCteamclaude.leaderboard. The renderer client (runtime-teamclaude-leaderboard-client.ts) now implements the seam #67 builds against.Reading the coordinator
GET /teamclaude/status, read with the wrapper's operator key from$XDG_CONFIG_HOME/teamclaude/wrappers.json. Nothing on the coordinator changes.*.ts.netname. No DNS lookup, proxy or redirects; a 32 MiB cap; one 10s deadline.teamclaude_usage.py.Ranking
minidev-<person><n>clients fold into one person, so several minidevs add up to one score.sixthman-*automation hosts are excluded.teamclaude wrappers status --json→client.Reads and failures
TEAMCLAUDE_LEADERBOARD_REFRESH_MS(60s), and concurrent callers share one read. A slower, older read can't overwrite a newer one.unavailableand says why. A missing config, or Windows, reportsnot-configured.What crosses the process boundary
nullfor runtimes that don't have the method, such as older or upstream builds.Why
It serves the operator's leaderboard request, with three constraints: existing endpoints only, nothing changed on devservices1, and one person's minidevs combined into one score. Running on the runtime host keeps the operator key on the machine that already holds it. A request/response RPC rather than a new subscription keeps the fork's footprint small.
Linked Issue
N/A: operator request in session. This pairs with #67, the sidebar UI. Both carry the shared commit
20990ec7a6, so they merge in either order.Visual Proof
N/A: no UI in this PR. #67 renders the board. An integrated-app capture follows once both are on one branch.
Testing
New unit tests (5 files): coordinator status transport and validation, wrapper config resolution, ranking (folding, exclusion, ties, self across two minidevs) and the service (sharing, staleness, the out-of-order guard).
pnpm check:changed --maxWorkers=2 --base=refs/remotes/swaplabs/swaplabs/main: the worker's latest run is in progress. An earlier run stalled invitest related, which pulls in most of the runtime suite throughrpc/methods/index.ts, and was stopped to relieve host memory. Results will be posted here.A live smoke run against the coordinator is pending and will be posted here.
I manually tested these changes locally (live smoke pending)
Automated tests added/updated, or explained why not below
AI Disclosure
Prepared by Claude Code (Claude Opus 5.5) at the operator's request.
Review
Opened at the operator's request to "open PRs asap and run tests after". The local review and coordinator test runs follow.
Agent skill upstream boundary
Notes
GET /teamclaude/statusis ever called.not-configuredwithout spawning anything.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred): thecheck:changedrun is in progress🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.