Skip to content

Conversation

@daveey
Copy link
Contributor

@daveey daveey commented Jan 17, 2026

Add StatsMutation that logs a stat with a specified delta.
Useful for events to track when they fire or record custom metrics.

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Copy link
Contributor Author

daveey commented Jan 17, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • add-to-merge-queue - adds this PR to the back of the merge queue
  • add-to-merge-queue-as-hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@blacksmith-sh

This comment has been minimized.

@datadog-official

This comment has been minimized.

@daveey daveey marked this pull request as ready for review January 17, 2026 04:11
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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: ab88892947

ℹ️ 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".

@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch from b509f8f to a79ebd0 Compare January 17, 2026 04:30
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch from ab88892 to 40b8869 Compare January 17, 2026 04:30
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch from a79ebd0 to 4a8d25d Compare January 17, 2026 04:37
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch 2 times, most recently from cfd9196 to 717b742 Compare January 17, 2026 04:42
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch from 4a8d25d to 04ce093 Compare January 17, 2026 04:42
@daveey daveey changed the base branch from 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all to graphite-base/4958 January 17, 2026 04:52
@daveey daveey force-pushed the graphite-base/4958 branch from 04ce093 to 22299ef Compare January 17, 2026 04:54
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch from 717b742 to 14d48ae Compare January 17, 2026 04:55
@daveey daveey changed the base branch from graphite-base/4958 to 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all January 17, 2026 04:55
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch from 22299ef to 0403df0 Compare January 17, 2026 05:07
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch from 14d48ae to cb22d29 Compare January 17, 2026 05:07
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch from 0403df0 to fb85dab Compare January 17, 2026 05:17
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch 2 times, most recently from 46a0e5c to 32c29a2 Compare January 17, 2026 05:19
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch 2 times, most recently from 139a420 to 6c3fee4 Compare January 17, 2026 05:25
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch from 32c29a2 to a64686c Compare January 17, 2026 05:25
@daveey daveey requested a review from sasmith January 17, 2026 05:38
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch from 6c3fee4 to 59c2983 Compare January 17, 2026 05:43
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch 2 times, most recently from 6c64e32 to 110061e Compare January 17, 2026 07:04
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all branch from 59c2983 to 731c8af Compare January 17, 2026 07:04
}

// Log the stat to the collective's stats tracker
coll->stats.add(_config.stat_name, _config.delta);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to specify if it's game, agent, or collective stat. And handle those

@daveey daveey changed the base branch from 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all to graphite-base/4958 January 18, 2026 05:41
Add StatsMutation that logs a stat with a specified delta.
Useful for events to track when they fire or record custom metrics.

Python:
- StatsMutationConfig with mutation_type="stats", stat field and delta field
- LogStat() helper function with optional delta (default 1)
- Added to AnyMutation union

C++:
- StatsMutationConfig struct in handler_config.hpp
- StatsMutation class in mutation.hpp (logs to target's collective StatsTracker)
- Added to MutationConfig variant

Tests:
- test_stats_mutation.py with creation, helper, default delta, serialization tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@daveey daveey force-pushed the graphite-base/4958 branch from 731c8af to 15bac33 Compare January 18, 2026 06:01
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_statsmutation_for_logging_stats_add_statsmutation_that_logs_a_stat_with_a_specified_delta._useful_for_events_to_track_when_they_fire_or_record_custom_metrics._co-authored-by_claude_opus_4.5_noreply_anthropic.c branch from 110061e to 232df60 Compare January 18, 2026 06:01
@daveey daveey changed the base branch from graphite-base/4958 to 01-16-feat_mettagrid_add_aligntocollectivemutation_for_direct_collective_alignment_add_aligntocollectivemutation_that_aligns_target_to_a_specific_collective_by_name._unlike_alignmentmutation_which_aligns_to_actor_s_collective_this_all January 18, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants