Skip to content

Conversation

@daveey
Copy link
Contributor

@daveey daveey commented Jan 17, 2026

Add comprehensive tests for:

  • periodic() and once() helper functions
  • ObjectTypeFilter and HasTag helper
  • CollectiveFilter and BelongsToCollective helper
  • BoundaryFilter and AtBoundary helper
  • AlignToCollectiveMutation and AlignToCollective helper
  • StatsMutation and LogStat helper
  • EventConfig creation, serialization, and deserialization
  • Events integration in GameConfig and MettaGridConfig
  • Filter and mutation polymorphism (discriminated unions)

33 tests covering all new event system configuration.

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.

@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from d5e1d6f to 2c99288 Compare January 17, 2026 04:30
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa branch from 873027b to bed664d Compare January 17, 2026 04:30
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from 2c99288 to 14af069 Compare January 17, 2026 04:37
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa branch from bed664d to 54094ca Compare January 17, 2026 04:37
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from 14af069 to c021ee3 Compare January 17, 2026 04:42
@daveey daveey changed the base branch from 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa to graphite-base/4960 January 17, 2026 04:59
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from c021ee3 to d9e98da Compare January 17, 2026 05:01
@daveey daveey force-pushed the graphite-base/4960 branch from 17ab37e to aba6974 Compare January 17, 2026 05:01
@daveey daveey changed the base branch from graphite-base/4960 to 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa January 17, 2026 05:01
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from d9e98da to ec1e62d Compare January 17, 2026 05:07
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa branch 2 times, most recently from a671ff1 to 817e45c Compare January 17, 2026 05:17
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch 2 times, most recently from 6dba163 to bc0a399 Compare January 17, 2026 05:19
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa branch from 12a5ea7 to aafa6cf Compare January 17, 2026 05:25
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from bc0a399 to 7b74ef1 Compare January 17, 2026 05:25
@daveey daveey marked this pull request as ready for review January 17, 2026 05:38
@daveey daveey force-pushed the 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa branch from aafa6cf to c6c113e Compare January 17, 2026 05:43
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from 7b74ef1 to 3058df0 Compare January 17, 2026 05:43
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: 7b74ef1bdf

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


from typing import TYPE_CHECKING

from .base import GameMechanic

Choose a reason for hiding this comment

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

P1 Badge Add the missing GameMechanic module/export

This file imports GameMechanic from .base, but the commit does not add mechanics/base.py (nor an __init__.py that re-exports it). As a result, importing metta.cogworks.curriculum.mechanics.registry (and therefore get_mechanics or MechanicCurriculumAlgorithm) raises ModuleNotFoundError, so the new curriculum/tests cannot even import. Define the class in mechanics/base.py and expose it, or point the import at an existing module.

Useful? React with 👍 / 👎.

Comment on lines 34 to 37
return CurriculumConfig(
task_generator=SingleTaskGenerator.Config(env=arena_env),
algorithm_config=MechanicCurriculumConfig(
batch_size=batch_size,

Choose a reason for hiding this comment

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

P1 Badge Register MechanicCurriculumConfig in CurriculumConfig

This demo constructs CurriculumConfig(algorithm_config=MechanicCurriculumConfig(...)), but CurriculumConfig.algorithm_config is currently a union of DiscreteRandom/LearningProgress/PrioritizedRegret/RegretLearningProgress configs (see curriculum.py). Pydantic will reject MechanicCurriculumConfig with a validation error, so make_curriculum() fails at runtime until the union is extended or the field type is widened.

Useful? React with 👍 / 👎.

Comment on lines 196 to 197
if stats is None:
return

Choose a reason for hiding this comment

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

P2 Badge Don’t drop updates when stats are absent

In the normal training flow, Curriculum.update_task_performance/CurriculumEnv.step only pass score and never provide stats. Because this method returns immediately when stats is None, mechanics will never update or graduate when used via the standard curriculum pipeline, leaving scaffolding permanently on. Consider sourcing stats from the env, or using score/a default when stats are missing instead of early-returning.

Useful? React with 👍 / 👎.

@daveey daveey force-pushed the 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa branch from c6c113e to 924a56d Compare January 17, 2026 07:04
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from 3058df0 to 3e0f4d2 Compare January 17, 2026 07:04
@@ -0,0 +1,1455 @@
# Mechanic-Based Curriculum Implementation Plan
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove file

@@ -0,0 +1,298 @@
"""Mechanic-based curriculum algorithm.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove

@daveey daveey changed the base branch from 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa to graphite-base/4960 January 18, 2026 06:02
@daveey daveey force-pushed the graphite-base/4960 branch from 924a56d to 1958dbd Compare January 18, 2026 06:06
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from 3e0f4d2 to 7a26195 Compare January 18, 2026 06:06
@daveey daveey changed the base branch from graphite-base/4960 to 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa January 18, 2026 06:06
Add comprehensive tests for:
- periodic() and once() helper functions
- ObjectTypeFilter and HasTag helper
- CollectiveFilter and BelongsToCollective helper
- BoundaryFilter and AtBoundary helper
- AlignToCollectiveMutation and AlignToCollective helper
- StatsMutation and LogStat helper
- EventConfig creation, serialization, and deserialization
- Events integration in GameConfig and MettaGridConfig
- Filter and mutation polymorphism (discriminated unions)

33 tests covering all new event system configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@daveey daveey changed the base branch from 01-16-feat_mettagrid_add_boundaryfilter_for_filtering_objects_at_collective_boundaries_add_boundaryfilter_that_checks_if_target_is_at_the_boundary_between_two_collectives._this_is_the_python_config_side_c_adjacency_tracking_implementa to graphite-base/4960 January 19, 2026 01:13
@daveey daveey force-pushed the graphite-base/4960 branch from 1958dbd to 232df60 Compare January 19, 2026 01:13
@daveey daveey force-pushed the 01-16-test_mettagrid_add_integration_tests_for_events_system branch from 7a26195 to 1a85a4d Compare January 19, 2026 01:13
@daveey daveey changed the base branch from graphite-base/4960 to 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 January 19, 2026 01:13
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.

2 participants