Restrict SCML player protocol#111
Open
Muhtasham wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
OneShotAgentsubmissions with a restricteddecide(observation)policy functionmax_policy_errorsfallback disablingDesign Choice For Review
This intentionally makes SCML more CodeClash-controlled than a native simulator-agent submission.
Instead of letting submitted code subclass SCML
OneShotAgentdirectly, the arena exposes only a plain policy callback:The trusted runtime owns the actual SCML agents and converts policy decisions into validated negotiation intents:
{"offer": [quantity, time, unit_price]}{"response": "accept" | "reject" | "end"}{}orNone: use the trusted greedy fallbackThe tradeoff is deliberate:
OneShotAgentsubmissions@john-b-yang could you sanity-check whether this restricted policy interface is the right CodeClash-compatible shape for SCML, or whether you would rather expose native SCML agent classes for more expressivity?
Verification
uv run ruff check codeclash/arenas/scml/scml.py codeclash/arenas/scml/runtime/run_scml.py tests/arenas/test_scml.pyuv run pytest -q tests/arenas/test_scml.py-> 10 passeduv run pytest -q tests/arenas-> 190 passeduv run pre-commit run --files codeclash/arenas/scml/scml.py codeclash/arenas/scml/runtime/README.md codeclash/arenas/scml/runtime/scml_agent.py codeclash/arenas/scml/runtime/run_scml.py configs/examples/SCML__dummy__r1__s2.yaml docs/reference/arenas/scml.md tests/arenas/test_scml.pydocker build -t codeclash/scml -f codeclash/arenas/scml/SCML.Dockerfile .decisions, zeropolicy_errors, zeroinvalid_decisions, and zerodisabled_policiesinvalid_decisions, and the world completed using trusted fallback behaviormax_policy_errors, and the world completed using trusted fallback behavioruv run python main.py configs/examples/SCML__dummy__r1__s2.yaml -o /private/tmp/codeclash-scml-protocol.sFesGl-> two launcher rounds completed, both players validated, details had active policy decisions and zero policy errorscodeclash/scmland reranconfigs/examples/SCML__dummy__r1__s2.yaml; both launcher rounds completed withpolicy_errors_total: 0andinvalid_decisions_total: 0uv run pytest -q-> 192 passed