GeezerVison is showing github.com — feat(id): F11.7 slice 1 — host metrics core + world stats surfacing (#553) by dezren39 · Pull Request #1437 · developing-today/code
Conversation
dezren39
commented
Oct 27, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
F11.7 slice 1 — host metrics core (queue task 1305)
Implements slice 1 of #553 per the triage decomposition (queue task 1261). Slices 2 (Prometheus endpoint) and 3 (tracing spans) are follow-up queue tasks against #553.
- New
WorldMetrics registry (world/metrics.rs): atomic counters + fixed-bucket histograms — actor queue depth (+max), command latency, journal append latency (fsync included), checkpoint duration, frame bytes; session count supplied at snapshot time. No allocation or locking on hot paths.
- Instrumented at the actor dequeue/handle loop, journal append + checkpoint paths (
world_store), and every session send (send_json meters frame bytes).
- Surfaced two ways:
id world stats JSON gains a metrics object, and a capability-authorized metrics session frame (client + server frames added to the shell contract and its exhaustive frame tests).
- Tests: scripted-session test reads back every metric after a session; durable-world test counts journal appends on a journaled world.
This resume's completion work
The branch had lapsed mid-verification with 18 compile errors: run_session_with's pre-lease sends referenced a nonexistent service, the first-frame match had no Metrics arm, and the shell contract lacked the new frames. Fixed by metering pre-lease/hub sends into a throwaway registry (they belong to no world), routing post-lease sends via lease.service(), routing Metrics first-frames to the query session, adding the contract frames, and rustfmt. Merged current main (one conflict in world_store.rs tests — both new tests kept).
Verification (laptop, per CI-first policy local runs are on the laptop)
cargo check --all-targets — pass
cargo test --lib -- metrics shell_contract world_session world_store — 85 passed post-merge (170 passed across the wider targeted set pre-merge)
- Note:
cli::tests::test_cli_parse_world_new_and_stats stack-overflows under the default test-thread stack in this environment; cli.rs is untouched by this PR and the test passes with RUST_MIN_STACK=16777216 — pre-existing stack-size sensitivity, not a regression here.
Refs #553
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
… mid-verification, resume from here
Metrics registry (world/metrics.rs, atomics + fixed-bucket histograms)
shared by actor/handle/session; actor records command latency, queue
depth, journal append latency (in persist), checkpoint duration (in
compact_if_due); session layer meters frame bytes in send_json;
Metrics actor command + handle.metrics(); metrics session frame
(pre-join and joined, capability-authorized like info); client
WorldClient::metrics; id world stats gains a metrics object.
Tests: metrics unit test, session scripted-session metrics test,
durable journal-append metrics test.
Verification state at handoff: cargo check --lib showed the Histogram
Default error (fixed after that run) plus two 'service not in scope'
errors in the meter threading to locate; cargo check --tests was still
compiling. Next: cargo check --no-default-features --tests, fix any
remaining meter scope sites, run the three metrics tests, then PR.
…view (queue task 1305 resume)
Both functions take &WorldHandle, not &WorldService, so the WIP's
service.frame_meter() calls there do not resolve. Add a meter:
&WorldMetrics parameter (the send_delegation pattern) and pass
service.frame_meter() at all 9 call sites.
… 1305)
Pre-lease frames in run_session_with referenced a nonexistent service: meter hub-level/pre-lease sends into a throwaway WorldMetrics and post-lease isolation/policy sends via lease.service(). Route first-frame Metrics to query_session, add metrics client+server frames to the shell contract and its exhaustive test list, and rustfmt the branch. cargo check --all-targets passes; 170 targeted tests pass on the laptop.
…s-core
# Conflicts:
# pkgs/id/src/world_store.rs
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 2 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7e008ad3-1377-422c-a354-55f22bf73fa5
Commits
-
Reviewing files that changed from the base of the PR and between 95cd41f and 6e0639b.
Files selected for processing: 12
-
pkgs/id/contract/shell-contract.v1.json
pkgs/id/src/commands/world.rs
pkgs/id/src/shell_contract/tests.rs
pkgs/id/src/world/actor.rs
pkgs/id/src/world/handle.rs
pkgs/id/src/world/metrics.rs
pkgs/id/src/world/mod.rs
pkgs/id/src/world_net.rs
pkgs/id/src/world_session/mod.rs
pkgs/id/src/world_session/tests.rs
pkgs/id/src/world_session/types.rs
pkgs/id/src/world_store.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-27T15:41:20.362679Z |
6e0639b |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e0639bade
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
}
|
|
|
// Like `info`, the joined phase may read the world's metrics with
|
|
|
// the session's own capability.
|
|
|
ClientFrame::Metrics { .. } => match world.metrics().await {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reauthorize the joined capability before reporting metrics
If a client joins before its capability expires and keeps the session open on an idle world, this branch continues returning metrics after expiration because world.metrics() does not validate the session token. The joined loop has no expiration timer, so authorization at join time is insufficient. Both the query-phase metrics handler and the adjacent joined-phase Info handler validate through snapshot(token), which checks capability and ancestor expiration. Revalidate the session capability here before returning the metrics snapshot.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 29, 2026
This was referenced Nov 21, 2026
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|