cogames-agents 0.0.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cogames_agents-0.0.0.7/.gitignore +2 -0
- cogames_agents-0.0.0.7/.nim-version +1 -0
- cogames_agents-0.0.0.7/.nimby-version +1 -0
- cogames_agents-0.0.0.7/MANIFEST.in +9 -0
- cogames_agents-0.0.0.7/PKG-INFO +98 -0
- cogames_agents-0.0.0.7/README.co-gas.md +47 -0
- cogames_agents-0.0.0.7/README.md +76 -0
- cogames_agents-0.0.0.7/docs/0018-tribal-village-temple-roles.md +130 -0
- cogames_agents-0.0.0.7/docs/aligned_junction_held_investigation.md +466 -0
- cogames_agents-0.0.0.7/docs/app-backend-eval-pipeline.md +68 -0
- cogames_agents-0.0.0.7/docs/aws-sso-on-mettabox.md +98 -0
- cogames_agents-0.0.0.7/docs/cogames-eval-internals.md +211 -0
- cogames_agents-0.0.0.7/docs/cogas-agent-design.md +374 -0
- cogames_agents-0.0.0.7/docs/cogsguard-mechanics-deep-dive.md +458 -0
- cogames_agents-0.0.0.7/docs/creating-scripted-agents.md +545 -0
- cogames_agents-0.0.0.7/docs/eval-results-log.md +149 -0
- cogames_agents-0.0.0.7/docs/evolution-system-architecture.md +367 -0
- cogames_agents-0.0.0.7/docs/leaderboard-submission-process.md +430 -0
- cogames_agents-0.0.0.7/docs/machina1-agent-analysis.md +357 -0
- cogames_agents-0.0.0.7/docs/metta-cogames-overview.md +346 -0
- cogames_agents-0.0.0.7/docs/mettaboxes.md +226 -0
- cogames_agents-0.0.0.7/docs/nim-vs-python-agents-comparison.md +197 -0
- cogames_agents-0.0.0.7/docs/role-distribution-analysis.md +426 -0
- cogames_agents-0.0.0.7/docs/scripted-agent-registry.md +42 -0
- cogames_agents-0.0.0.7/docs/training-and-submission-guide.md +501 -0
- cogames_agents-0.0.0.7/docs/wandb-analysis-cogsguard-training.md +189 -0
- cogames_agents-0.0.0.7/pyproject.toml +75 -0
- cogames_agents-0.0.0.7/scripts/README.md +105 -0
- cogames_agents-0.0.0.7/scripts/benchmark_agents.sh +151 -0
- cogames_agents-0.0.0.7/scripts/ci_eval.sh +225 -0
- cogames_agents-0.0.0.7/scripts/compare_agents.py +169 -0
- cogames_agents-0.0.0.7/scripts/enrich_eval_output.py +237 -0
- cogames_agents-0.0.0.7/scripts/eval_cogas.sh +177 -0
- cogames_agents-0.0.0.7/scripts/quick_eval.sh +93 -0
- cogames_agents-0.0.0.7/scripts/regression_check.py +260 -0
- cogames_agents-0.0.0.7/scripts/run_cogsguard_instrumented_audit.py +215 -0
- cogames_agents-0.0.0.7/scripts/run_cogsguard_parity.py +158 -0
- cogames_agents-0.0.0.7/scripts/run_cogsguard_rollout.py +560 -0
- cogames_agents-0.0.0.7/scripts/tune_cogas.sh +194 -0
- cogames_agents-0.0.0.7/setup.cfg +4 -0
- cogames_agents-0.0.0.7/setup.py +128 -0
- cogames_agents-0.0.0.7/src/cogames_agents/__init__.py +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents/evals/__init__.py +5 -0
- cogames_agents-0.0.0.7/src/cogames_agents/evals/planky_evals.py +415 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/__init__.py +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/evolution/__init__.py +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/evolution/cogsguard/__init__.py +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/evolution/cogsguard/evolution.py +695 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/evolution/cogsguard/evolutionary_coordinator.py +540 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/__init__.py +20 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/agents.py +98 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/cogsguard_agents.nim +555 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/cogsguard_align_all_agents.nim +569 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/common.nim +1054 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/install.sh +1 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/ladybug_agent.nim +954 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/nim_agents.nim +68 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/nim_agents.nims +14 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/nimby.lock +3 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/racecar_agents.nim +844 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/random_agents.nim +68 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/test_agents.py +53 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/thinky_agents.nim +677 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/nim_agents/thinky_eval.py +230 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/README.md +360 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/__init__.py +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/baseline_agent.py +1031 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/__init__.py +5 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/context.py +68 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/entity_map.py +152 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goal.py +115 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/__init__.py +27 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/aligner.py +160 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/gear.py +197 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/miner.py +441 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/scout.py +40 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/scrambler.py +174 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/shared.py +160 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/stem.py +60 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/goals/survive.py +100 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/navigator.py +401 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/obs_parser.py +238 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/policy.py +525 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogas/trace.py +69 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/CLAUDE.md +517 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/README.md +252 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/__init__.py +74 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/aligned_junction_held_investigation.md +152 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/aligner.py +333 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/behavior_hooks.py +44 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/control_agent.py +323 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/debug_agent.py +533 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/miner.py +589 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/options.py +67 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/parity_metrics.py +36 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/policy.py +1967 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/prereq_trace.py +33 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/role_trace.py +50 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/roles.py +31 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/rollout_trace.py +40 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/scout.py +69 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/scrambler.py +350 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/targeted_agent.py +418 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/teacher.py +224 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/types.py +381 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/cogsguard/v2_agent.py +49 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/common/__init__.py +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/common/geometry.py +24 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/common/roles.py +34 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/common/tag_utils.py +48 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/demo_policy.py +242 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pathfinding.py +126 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/DESIGN.md +317 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/__init__.py +5 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/behaviors/__init__.py +17 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/behaviors/aligner.py +400 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/behaviors/base.py +119 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/behaviors/miner.py +632 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/behaviors/scout.py +138 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/behaviors/scrambler.py +433 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/policy.py +570 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/services/__init__.py +7 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/services/map_tracker.py +808 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/services/navigator.py +864 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/services/safety.py +189 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/state.py +299 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/pinky/types.py +138 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/CLAUDE.md +124 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/IMPROVEMENTS.md +160 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/NOTES.md +153 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/PLAN.md +254 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/README.md +214 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/STRATEGY.md +100 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/__init__.py +5 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/context.py +68 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/entity_map.py +152 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goal.py +107 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/__init__.py +27 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/aligner.py +168 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/gear.py +179 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/miner.py +416 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/scout.py +40 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/scrambler.py +174 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/shared.py +160 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/stem.py +49 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/goals/survive.py +96 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/navigator.py +388 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/obs_parser.py +238 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/policy.py +485 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/__init__.py +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/conftest.py +66 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/helpers.py +152 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/test_aligner.py +24 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/test_miner.py +30 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/test_scout.py +15 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/test_scrambler.py +29 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/tests/test_stem.py +36 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/planky/trace.py +69 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/types.py +239 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/unclipping_agent.py +461 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_agent/utils.py +381 -0
- cogames_agents-0.0.0.7/src/cogames_agents/policy/scripted_registry.py +80 -0
- cogames_agents-0.0.0.7/src/cogames_agents/py.typed +0 -0
- cogames_agents-0.0.0.7/src/cogames_agents.egg-info/PKG-INFO +98 -0
- cogames_agents-0.0.0.7/src/cogames_agents.egg-info/SOURCES.txt +204 -0
- cogames_agents-0.0.0.7/src/cogames_agents.egg-info/dependency_links.txt +1 -0
- cogames_agents-0.0.0.7/src/cogames_agents.egg-info/requires.txt +8 -0
- cogames_agents-0.0.0.7/src/cogames_agents.egg-info/top_level.txt +1 -0
- cogames_agents-0.0.0.7/tests/conftest.py +119 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_aligner_test.map +26 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_all_gear_stations.map +28 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_exploration_memory.map +34 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_gear_miner.map +26 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_gear_scout.map +26 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_maze_navigation.map +30 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_miner_bump_extractor.map +16 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_miner_extract.map +26 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_miner_full_cycle.map +28 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_multi_extractors.map +29 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_navigation_obstacles.map +29 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_retreat_test.map +26 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_scout_explore.map +30 -0
- cogames_agents-0.0.0.7/tests/pinky_evals/pinky_scrambler_test.map +26 -0
- cogames_agents-0.0.0.7/tests/test_agent_benchmarks.py +213 -0
- cogames_agents-0.0.0.7/tests/test_cogsguard_action_timing.py +53 -0
- cogames_agents-0.0.0.7/tests/test_cogsguard_miner_danger_radius.py +67 -0
- cogames_agents-0.0.0.7/tests/test_cogsguard_roles.py +159 -0
- cogames_agents-0.0.0.7/tests/test_eval_metrics.py +324 -0
- cogames_agents-0.0.0.7/tests/test_evolution.py +492 -0
- cogames_agents-0.0.0.7/tests/test_evolution_integration.py +319 -0
- cogames_agents-0.0.0.7/tests/test_evolutionary_coordinator.py +296 -0
- cogames_agents-0.0.0.7/tests/test_parity_metrics.py +36 -0
- cogames_agents-0.0.0.7/tests/test_pinky_behaviors.py +360 -0
- cogames_agents-0.0.0.7/tests/test_pinky_navigation.py +904 -0
- cogames_agents-0.0.0.7/tests/test_planky_behaviors.py +556 -0
- cogames_agents-0.0.0.7/tests/test_prereq_trace.py +37 -0
- cogames_agents-0.0.0.7/tests/test_role_distributions.py +205 -0
- cogames_agents-0.0.0.7/tests/test_role_trace.py +53 -0
- cogames_agents-0.0.0.7/tests/test_rollout_trace.py +32 -0
- cogames_agents-0.0.0.7/tests/test_scripted_agent_tags.py +23 -0
- cogames_agents-0.0.0.7/tests/test_scripted_agent_type_tags.py +19 -0
- cogames_agents-0.0.0.7/tests/test_scripted_policies.py +155 -0
- cogames_agents-0.0.0.7/tests/test_scripted_registry.py +37 -0
- cogames_agents-0.0.0.7/tutorials/cogsguard_make_policy.ipynb +204 -0
- cogames_agents-0.0.0.7/tutorials/cogsguard_make_policy.md +96 -0
- cogames_agents-0.0.0.7/tutorials/cogsguard_make_policy.py +135 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.17
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Include Nim source files for building from source distribution
|
|
2
|
+
recursive-include src/cogames_agents/policy/nim_agents *.nim *.nims
|
|
3
|
+
include src/cogames_agents/policy/nim_agents/nimby.lock
|
|
4
|
+
include .nim-version
|
|
5
|
+
include .nimby-version
|
|
6
|
+
|
|
7
|
+
# Exclude build artifacts
|
|
8
|
+
prune src/cogames_agents/policy/nim_agents/nimbledeps
|
|
9
|
+
prune src/cogames_agents/policy/nim_agents/bindings/generated
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cogames-agents
|
|
3
|
+
Version: 0.0.0.7
|
|
4
|
+
Summary: Optional agent policies for CoGames
|
|
5
|
+
Author: Metta AI
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Metta-AI/metta/tree/main/packages/cogames-agents
|
|
8
|
+
Project-URL: Repository, https://github.com/Metta-AI/metta
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Requires-Python: <3.13,>=3.12
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
Requires-Dist: cogames==0.3.64
|
|
16
|
+
Requires-Dist: mettagrid==0.2.0.74
|
|
17
|
+
Requires-Dist: numpy>=2.0.0
|
|
18
|
+
Provides-Extra: test
|
|
19
|
+
Requires-Dist: pytest; extra == "test"
|
|
20
|
+
Requires-Dist: pytest-xdist; extra == "test"
|
|
21
|
+
Requires-Dist: ruff; extra == "test"
|
|
22
|
+
|
|
23
|
+
# cogames-agents
|
|
24
|
+
|
|
25
|
+
Optional scripted policies for CoGames. Use them for quick baselines, play/eval smoke tests, or as teacher policies.
|
|
26
|
+
|
|
27
|
+
## Scripted policy registry
|
|
28
|
+
|
|
29
|
+
The registry at `cogames_agents.policy.scripted_registry` maps policy `short_names` to `metta://policy/...` URIs.
|
|
30
|
+
Scripted agents and teachers share these identifiers, so the same name works for evaluation, play, and
|
|
31
|
+
`TeacherConfig.policy_uri`.
|
|
32
|
+
|
|
33
|
+
To list the current names:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
python -c "from cogames_agents.policy.scripted_registry import list_scripted_agent_names; print(list_scripted_agent_names())"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Common scripted policy names include:
|
|
40
|
+
|
|
41
|
+
- Baselines: `baseline`, `tiny_baseline`, `ladybug_py`
|
|
42
|
+
- Nim baselines: `thinky`, `race_car`, `ladybug`, `nim_random`
|
|
43
|
+
- CogsGuard core: `role`, `role_py`, `wombo`
|
|
44
|
+
- CogsGuard variants: `alignall`, `cogsguard_control`, `cogsguard_targeted`, `cogsguard_v2`
|
|
45
|
+
- CogsGuard roles: `miner`, `scout`, `aligner`, `scrambler`
|
|
46
|
+
- Teacher: `teacher`
|
|
47
|
+
- Pinky: `pinky`
|
|
48
|
+
|
|
49
|
+
For the full registry snapshot, see `docs/scripted-agent-registry.md`.
|
|
50
|
+
|
|
51
|
+
Role-specific policies are exposed via role names (miner/scout/aligner/scrambler). For the teacher policy, you can pass
|
|
52
|
+
`role_vibes` as a comma-separated list:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
metta://policy/teacher?role_vibes=miner,scout
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Fixed-role mixes and explicit orderings are configured via `role_py` parameters:
|
|
59
|
+
|
|
60
|
+
Examples:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
metta://policy/role_py?role_cycle=aligner,miner,scrambler,scout
|
|
64
|
+
metta://policy/role_py?role_order=aligner,miner,aligner,miner,scout
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Pinky role counts are applied in a different order than CogsGuard:
|
|
68
|
+
|
|
69
|
+
- Pinky order: miner -> scout -> aligner -> scrambler, and any remaining agents stay default/noop.
|
|
70
|
+
- CogsGuard order: scrambler -> aligner -> miner -> scout, then fills remaining agents with gear.
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
metta://policy/pinky?miner=4&aligner=2&scrambler=4
|
|
76
|
+
metta://policy/pinky?miner=2&scout=2&aligner=1&scrambler=1&debug=1
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Recipe usage
|
|
80
|
+
|
|
81
|
+
The `recipes.experiment.scripted_agents` recipe accepts the same scripted policy names:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
./tools/run.py recipes.experiment.scripted_agents.play agent=thinky suite=cvc_arena
|
|
85
|
+
./tools/run.py recipes.experiment.scripted_agents.play agent=miner suite=cogsguard
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Included policies
|
|
89
|
+
|
|
90
|
+
- Short names map to the fastest implementation (Nim when available, otherwise Python).
|
|
91
|
+
- `_nim` aliases exist when there is a Nim implementation alongside Python.
|
|
92
|
+
- See `docs/scripted-agent-registry.md` for the canonical short-name list.
|
|
93
|
+
- Teacher wrapper: `teacher` (`teacher_nim`) forces an initial role/vibe, then delegates to the Nim policy.
|
|
94
|
+
|
|
95
|
+
## Docs
|
|
96
|
+
|
|
97
|
+
- `docs/mettaboxes.md` (mettabox usage guide)
|
|
98
|
+
- `docs/aws-sso-on-mettabox.md` (AWS SSO login from inside mettabox containers)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# co_gas
|
|
2
|
+
|
|
3
|
+
**Mission: Get to the top of the Beta-CogsGuard leaderboard.**
|
|
4
|
+
|
|
5
|
+
We build competitive CogsGuard agents — scripted baselines, trained policies, and optimized submissions — all aimed at
|
|
6
|
+
ranking #1.
|
|
7
|
+
|
|
8
|
+
## Approach
|
|
9
|
+
|
|
10
|
+
1. **Scripted agent baselines** — hand-coded strategies in `cogames-agents/` covering guard and intruder roles
|
|
11
|
+
2. **Behavioral cloning (BC)** — train neural policies from scripted agent demonstrations
|
|
12
|
+
3. **PPO optimization** — fine-tune trained policies with reinforcement learning
|
|
13
|
+
4. **Leaderboard submission** — evaluate and submit top-performing agents
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Play a scripted agent locally
|
|
19
|
+
cogames play --mission CogsGuard
|
|
20
|
+
|
|
21
|
+
# Train a policy via BC or PPO
|
|
22
|
+
cogames train --mission CogsGuard
|
|
23
|
+
|
|
24
|
+
# Run a scrimmage between agents
|
|
25
|
+
cogames scrimmage --mission CogsGuard
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Repository Structure
|
|
29
|
+
|
|
30
|
+
- `cogames-agents/` — scripted agents, evolution system, and training workflows
|
|
31
|
+
- `cogames-agents/docs/` — detailed documentation (see index below)
|
|
32
|
+
|
|
33
|
+
## Docs Index
|
|
34
|
+
|
|
35
|
+
See [`cogames-agents/docs/`](cogames-agents/docs/) for full documentation:
|
|
36
|
+
|
|
37
|
+
- [Creating Scripted Agents](cogames-agents/docs/creating-scripted-agents.md)
|
|
38
|
+
- [Evolution System Architecture](cogames-agents/docs/evolution-system-architecture.md)
|
|
39
|
+
- [Training & Submission Guide](cogames-agents/docs/training-and-submission-guide.md)
|
|
40
|
+
- [Scripted Agent Registry](cogames-agents/docs/scripted-agent-registry.md)
|
|
41
|
+
- [Nim vs Python Agents Comparison](cogames-agents/docs/nim-vs-python-agents-comparison.md)
|
|
42
|
+
- [Mettaboxes](cogames-agents/docs/mettaboxes.md)
|
|
43
|
+
- [W&B Analysis](cogames-agents/docs/wandb-analysis-cogsguard-training.md)
|
|
44
|
+
|
|
45
|
+
## Team
|
|
46
|
+
|
|
47
|
+
Rig: `co_gas/polecats/rust`
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# cogames-agents
|
|
2
|
+
|
|
3
|
+
Optional scripted policies for CoGames. Use them for quick baselines, play/eval smoke tests, or as teacher policies.
|
|
4
|
+
|
|
5
|
+
## Scripted policy registry
|
|
6
|
+
|
|
7
|
+
The registry at `cogames_agents.policy.scripted_registry` maps policy `short_names` to `metta://policy/...` URIs.
|
|
8
|
+
Scripted agents and teachers share these identifiers, so the same name works for evaluation, play, and
|
|
9
|
+
`TeacherConfig.policy_uri`.
|
|
10
|
+
|
|
11
|
+
To list the current names:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
python -c "from cogames_agents.policy.scripted_registry import list_scripted_agent_names; print(list_scripted_agent_names())"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Common scripted policy names include:
|
|
18
|
+
|
|
19
|
+
- Baselines: `baseline`, `tiny_baseline`, `ladybug_py`
|
|
20
|
+
- Nim baselines: `thinky`, `race_car`, `ladybug`, `nim_random`
|
|
21
|
+
- CogsGuard core: `role`, `role_py`, `wombo`
|
|
22
|
+
- CogsGuard variants: `alignall`, `cogsguard_control`, `cogsguard_targeted`, `cogsguard_v2`
|
|
23
|
+
- CogsGuard roles: `miner`, `scout`, `aligner`, `scrambler`
|
|
24
|
+
- Teacher: `teacher`
|
|
25
|
+
- Pinky: `pinky`
|
|
26
|
+
|
|
27
|
+
For the full registry snapshot, see `docs/scripted-agent-registry.md`.
|
|
28
|
+
|
|
29
|
+
Role-specific policies are exposed via role names (miner/scout/aligner/scrambler). For the teacher policy, you can pass
|
|
30
|
+
`role_vibes` as a comma-separated list:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
metta://policy/teacher?role_vibes=miner,scout
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Fixed-role mixes and explicit orderings are configured via `role_py` parameters:
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
metta://policy/role_py?role_cycle=aligner,miner,scrambler,scout
|
|
42
|
+
metta://policy/role_py?role_order=aligner,miner,aligner,miner,scout
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Pinky role counts are applied in a different order than CogsGuard:
|
|
46
|
+
|
|
47
|
+
- Pinky order: miner -> scout -> aligner -> scrambler, and any remaining agents stay default/noop.
|
|
48
|
+
- CogsGuard order: scrambler -> aligner -> miner -> scout, then fills remaining agents with gear.
|
|
49
|
+
|
|
50
|
+
Examples:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
metta://policy/pinky?miner=4&aligner=2&scrambler=4
|
|
54
|
+
metta://policy/pinky?miner=2&scout=2&aligner=1&scrambler=1&debug=1
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Recipe usage
|
|
58
|
+
|
|
59
|
+
The `recipes.experiment.scripted_agents` recipe accepts the same scripted policy names:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
./tools/run.py recipes.experiment.scripted_agents.play agent=thinky suite=cvc_arena
|
|
63
|
+
./tools/run.py recipes.experiment.scripted_agents.play agent=miner suite=cogsguard
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Included policies
|
|
67
|
+
|
|
68
|
+
- Short names map to the fastest implementation (Nim when available, otherwise Python).
|
|
69
|
+
- `_nim` aliases exist when there is a Nim implementation alongside Python.
|
|
70
|
+
- See `docs/scripted-agent-registry.md` for the canonical short-name list.
|
|
71
|
+
- Teacher wrapper: `teacher` (`teacher_nim`) forces an initial role/vibe, then delegates to the Nim policy.
|
|
72
|
+
|
|
73
|
+
## Docs
|
|
74
|
+
|
|
75
|
+
- `docs/mettaboxes.md` (mettabox usage guide)
|
|
76
|
+
- `docs/aws-sso-on-mettabox.md` (AWS SSO login from inside mettabox containers)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Tribal Village Temple Role System (Notes)
|
|
2
|
+
|
|
3
|
+
This doc summarizes the role-mixing system in `tribal-village` so we can port a homologous evolution system into
|
|
4
|
+
`richard-evolution`. We are not bringing the temple building itself; the focus is on the role catalog, recombination,
|
|
5
|
+
and mutation mechanics. It is descriptive, not a proposal.
|
|
6
|
+
|
|
7
|
+
## Where it lives (tribal-village)
|
|
8
|
+
|
|
9
|
+
- `src/scripted/ai_defaults.nim`: role assignment, role pool, temple hybrid flow.
|
|
10
|
+
- `src/scripted/roles.nim`: role/behavior catalog, tiers, materialization.
|
|
11
|
+
- `src/scripted/evolution.nim`: sampling, recombination, mutation, scoring.
|
|
12
|
+
- `src/step.nim`: temple spawn that triggers hybrid requests.
|
|
13
|
+
- `src/types.nim`: `TempleHybridRequest` definition.
|
|
14
|
+
|
|
15
|
+
## Core model
|
|
16
|
+
|
|
17
|
+
- **BehaviorDef**: wraps an `OptionDef` plus fitness, games, uses.
|
|
18
|
+
- **RoleDef**: list of tiers (`RoleTier`), origin, kind (Gatherer/Builder/Fighter/Scripted), fitness and win tracking,
|
|
19
|
+
optional name lock.
|
|
20
|
+
- **RoleTier**: ordered behavior IDs with a selection mode:
|
|
21
|
+
- fixed: use given order
|
|
22
|
+
- shuffle: randomize per materialization
|
|
23
|
+
- weighted: weighted shuffle using tier weights
|
|
24
|
+
- **RoleCatalog**: holds behavior and role registries and can serialize history to `data/role_history.json`.
|
|
25
|
+
|
|
26
|
+
## Option execution (behavior list)
|
|
27
|
+
|
|
28
|
+
Roles are materialized into `OptionDef` sequences (`materializeRoleOptions`) and executed by `runOptions` (in
|
|
29
|
+
`options.nim`): the active option runs until it terminates or returns 0, otherwise higher-priority options can pre-empt
|
|
30
|
+
if they are marked interruptible.
|
|
31
|
+
|
|
32
|
+
## Role pool + assignment
|
|
33
|
+
|
|
34
|
+
- Core roles are built from Gatherer/Builder/Fighter option lists.
|
|
35
|
+
- A role pool is built from all non-core roles; if none exist, core roles are used as a fallback pool.
|
|
36
|
+
- Scripted agents can either explore (generate a new role) or sample a role from the pool weighted by role fitness.
|
|
37
|
+
- `ScriptedRoleExplorationChance` = 0.08, `ScriptedRoleMutationChance` = 0.25, `ScriptedGeneratedRoleCount` = 16.
|
|
38
|
+
|
|
39
|
+
## Evolution and scoring
|
|
40
|
+
|
|
41
|
+
- `sampleRole` builds N tiers (2-4) with 1-3 behaviors per tier, chosen with weights based on behavior fitness.
|
|
42
|
+
- `recombineRoles` splices tier ranges from two parents at random cut points.
|
|
43
|
+
- `mutateRole` can replace behavior IDs and flip tier selection modes.
|
|
44
|
+
- `applyScriptedScoring` scores roles and behaviors using territory share at `ScriptedScoreStep` (5000), updating EMA
|
|
45
|
+
fitness and persisting history.
|
|
46
|
+
- `lockRoleNameIfFit` freezes names once fitness crosses 0.7.
|
|
47
|
+
|
|
48
|
+
## Temple hybrid flow
|
|
49
|
+
|
|
50
|
+
1. **Spawn trigger** (`src/step.nim`): when two adjacent agents of the same team stand next to a Temple and an altar
|
|
51
|
+
heart is available, a child agent is spawned. A `TempleHybridRequest(parentA, parentB, childId, teamId, pos)` is
|
|
52
|
+
queued.
|
|
53
|
+
2. **Processing** (`processTempleHybridRequests` in `ai_defaults.nim`):
|
|
54
|
+
- Lookup each parent's current role.
|
|
55
|
+
- `recombineRoles` to build a hybrid role.
|
|
56
|
+
- Optional mutation and an extra behavior injection (35% chance) into the first tier (`injectBehavior`).
|
|
57
|
+
- Mark role origin as `"temple"` and register it in the catalog.
|
|
58
|
+
- Add to role pool and mark `pendingHybridRoles[childId]`.
|
|
59
|
+
- Reset the child agent init flag so the hybrid is applied next tick.
|
|
60
|
+
3. **Assignment** (`assignScriptedRole`): if a pending hybrid is set, the child is assigned the new role immediately
|
|
61
|
+
before any other selection.
|
|
62
|
+
|
|
63
|
+
## Metta adaptation (no temple building)
|
|
64
|
+
|
|
65
|
+
- We want the same role catalog, tier recombination, and mutation mechanics.
|
|
66
|
+
- The trigger is **not** a temple spawn. It can be end-of-episode, a fixed cadence, or an external coordinator signal.
|
|
67
|
+
- Hybrid roles are still generated by recombining two parent roles, then optionally mutating/injecting a behavior.
|
|
68
|
+
|
|
69
|
+
## What this implies for our port
|
|
70
|
+
|
|
71
|
+
- We need a **role catalog** that can compose option lists from behaviors and persist fitness history.
|
|
72
|
+
- The **temple trigger** is an environment event (spawn/interaction) that queues a hybrid request, not an agent
|
|
73
|
+
decision.
|
|
74
|
+
- Hybridization is **tier-based recombination** with optional mutation and behavior injection, then assignment to the
|
|
75
|
+
newborn agent.
|
|
76
|
+
- The system is light-weight: it relies on option lists rather than training.
|
|
77
|
+
|
|
78
|
+
## Current richard-evolution implementation
|
|
79
|
+
|
|
80
|
+
- Core evolution logic: `packages/cogames-agents/src/cogames_agents/policy/evolution/cogsguard/evolution.py`.
|
|
81
|
+
- Coordinator and role selection:
|
|
82
|
+
`packages/cogames-agents/src/cogames_agents/policy/evolution/cogsguard/evolutionary_coordinator.py`.
|
|
83
|
+
- Trigger today is **coordinator-driven** (games per generation), not an environment event.
|
|
84
|
+
- `CogsguardPolicy` can opt into evolutionary role selection via URI flags (`evolution=1`, `evolutionary=1`, or
|
|
85
|
+
`evolve=1`).
|
|
86
|
+
- Behavior hooks are wired up for integration (see
|
|
87
|
+
`packages/cogames-agents/src/cogames_agents/policy/scripted_agent/cogsguard/behavior_hooks.py`): the coordinator can
|
|
88
|
+
call real role behaviors when hooks are provided, but live execution still uses vibe-based roles.
|
|
89
|
+
|
|
90
|
+
## Gaps vs an across-episode evolution loop
|
|
91
|
+
|
|
92
|
+
- **No episode trigger wired yet.** `record_agent_performance` and `end_game` exist but are not called from the policy,
|
|
93
|
+
so fitness stays at defaults and selection is effectively uniform.
|
|
94
|
+
- **Evolved roles don’t drive behavior.** Roles are mapped back to base vibes, so recombination/mutation does not change
|
|
95
|
+
the actual action ordering or per-step decisions.
|
|
96
|
+
- **No persistence.** Role/behavior history isn’t saved or loaded (no `role_history.json` analog), so evolution resets
|
|
97
|
+
per run.
|
|
98
|
+
|
|
99
|
+
## Suggested wiring (future work)
|
|
100
|
+
|
|
101
|
+
1. **Episode completion → scoring**
|
|
102
|
+
- Pick a stable signal (team score, win/loss, hearts/influence delta, territory control).
|
|
103
|
+
- Call `record_agent_performance(agent_id, score, won)` per agent at episode end.
|
|
104
|
+
- Call `end_game(won)` to advance generations after `games_per_generation`.
|
|
105
|
+
|
|
106
|
+
2. **Role execution path**
|
|
107
|
+
- Decide whether evolved roles should execute **behavior lists** (preferred) or keep mapping to base vibes.
|
|
108
|
+
- If using lists, materialize behaviors and run them via `run_options` (interruptible, priority tiers).
|
|
109
|
+
- Map behavior names to real role actions via `behavior_hooks` (already available).
|
|
110
|
+
|
|
111
|
+
3. **Persistence**
|
|
112
|
+
- Serialize `RoleCatalog` fitness + usage into a JSON file under `data/` (or run output dir).
|
|
113
|
+
- Load history at coordinator init (matching tribal-village’s `role_history.json` pattern).
|
|
114
|
+
|
|
115
|
+
4. **Coordinator integration**
|
|
116
|
+
- Keep `SmartRoleCoordinator` as fallback when evolution is disabled.
|
|
117
|
+
- For `evolution=1`, use the evolutionary coordinator for **gear** decisions and optionally replace smart-role
|
|
118
|
+
reassignment logic in `_maybe_switch_smart_role`.
|
|
119
|
+
|
|
120
|
+
5. **Testing additions**
|
|
121
|
+
- Add unit tests for persistence (save/load round-trip, fitness continuity).
|
|
122
|
+
- Add integration tests for scoring triggers (episode end increments generation).
|
|
123
|
+
- Add behavior-execution tests to ensure evolved tiers change option order.
|
|
124
|
+
|
|
125
|
+
## Open questions to resolve
|
|
126
|
+
|
|
127
|
+
- What is the authoritative “score” for a role? (team win/loss, territory share, resource throughput, alignment control)
|
|
128
|
+
- Should evolution be per-team or global across teams? (fitness updates per team vs pooled)
|
|
129
|
+
- What cadence should evolve roles? (fixed games, fixed steps, external evaluation)
|
|
130
|
+
- How much variance is acceptable before locking names / freezing roles?
|