Skip to content

Conversation

@daveey
Copy link
Contributor

@daveey daveey commented Dec 29, 2025

TL;DR

Added GitHub integration instructions and support for built-in policy URIs.

What changed?

  • Added a section to CLAUDE.md about GitHub integration, recommending the use of Graphite ("gt") for creating PRs and providing branch naming conventions
  • Enhanced the policy_spec_from_uri function to handle metta://policy/<builtin> URIs for built-in policies
  • Implemented logic to resolve policy identifiers from the policy registry or interpret them as full class paths

How to test?

  1. Verify that metta://policy/some_registered_policy URIs correctly resolve to the appropriate policy class
  2. Test with both registered short names and full class paths (containing dots)
  3. Ensure the policy registry is properly populated via discover_and_register_policies()

Why make this change?

This change improves developer workflow by documenting GitHub integration practices and enhances the URI resolution system to support built-in policies through a convenient URI scheme. The metta://policy/ URI format provides a standardized way to reference built-in policies without needing to specify full file paths.

Copy link
Contributor Author

daveey commented Dec 29, 2025

@daveey daveey force-pushed the 12-29-feat_support_metta__policy__short_name_or_class_path_uris_for_built-in_policies branch from 21c74a8 to eb226cf Compare December 29, 2025 20:48
@daveey daveey marked this pull request as ready for review December 29, 2025 20:49
@daveey daveey requested review from nishu-builder and relh December 29, 2025 20:49
@daveey daveey force-pushed the 12-29-feat_support_metta__policy__short_name_or_class_path_uris_for_built-in_policies branch from eb226cf to d20f566 Compare December 29, 2025 20:51
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.

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

Comment on lines +273 to +284
# Handle metta://policy/<builtin> URIs for built-in policies
if uri.startswith("metta://policy/"):
from mettagrid.policy.loader import discover_and_register_policies
from mettagrid.policy.policy_registry import get_policy_registry

identifier = uri[len("metta://policy/") :]
discover_and_register_policies()
registry = get_policy_registry()

# Check if it's a registered short name
if identifier in registry:
return PolicySpec(class_path=registry[identifier])

Choose a reason for hiding this comment

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

P1 Badge Avoid shadowing metta:// policy names with built-ins

This new early return for metta://policy/<identifier> intercepts all such URIs before the MettaSchemeResolver path can resolve policies from the stats server. If a stats-server policy is named the same as a built‑in short name (e.g. random, stateless, lstm, mpt), metta://policy/random will now load the built‑in policy instead of the registered policy version, silently changing evaluation/training behavior. This is a regression from the previous flow where resolve_uri would route metta://policy/* through MettaSchemeResolver. Consider only treating built‑ins when explicitly namespaced (or after a failed stats lookup) so stats policies aren’t shadowed.

Useful? React with 👍 / 👎.

@daveey daveey changed the base branch from main to graphite-base/4561 December 29, 2025 21:27
@daveey daveey changed the base branch from graphite-base/4561 to main December 29, 2025 21:27
@daveey daveey changed the base branch from main to graphite-base/4561 December 29, 2025 21:28
@daveey daveey changed the base branch from graphite-base/4561 to main December 29, 2025 21:28
@daveey daveey force-pushed the 12-29-feat_support_metta__policy__short_name_or_class_path_uris_for_built-in_policies branch from d20f566 to 24a4af1 Compare December 29, 2025 21:28
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 29, 2025

Merge activity

  • Dec 29, 9:29 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Dec 29, 9:34 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@daveey daveey changed the base branch from main to graphite-base/4561 December 29, 2025 21:29
@daveey daveey changed the base branch from graphite-base/4561 to main December 29, 2025 21:30
@daveey daveey changed the base branch from main to graphite-base/4561 December 29, 2025 21:32
@daveey daveey changed the base branch from graphite-base/4561 to main December 29, 2025 21:32
@daveey daveey changed the base branch from main to graphite-base/4561 December 29, 2025 21:33
@daveey daveey force-pushed the 12-29-feat_support_metta__policy__short_name_or_class_path_uris_for_built-in_policies branch 2 times, most recently from 42b3e9a to 24a4af1 Compare December 29, 2025 21:33
@daveey daveey force-pushed the graphite-base/4561 branch from ea84228 to fe699c6 Compare December 29, 2025 21:33
@daveey daveey changed the base branch from graphite-base/4561 to daveey-decay December 29, 2025 21:34
@datadog-official
Copy link

datadog-official bot commented Dec 29, 2025

⚠️ Tests

⚠️ Warnings

🧪 1 Test failed

test_launch_two_token_syntax from test_launch.py (Datadog)
Expected exit code 0, got 1
  stderr: 
assert 1 == 0
 +  where 1 = <Result SystemExit(1)>.exit_code

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 24a4af1 | Docs | Was this helpful? Give us feedback!

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