Skip to content

Add params/get inspection and runtime-editable game master state - #396

Closed
concordia-claw wants to merge 2 commits into
google-deepmind:mainfrom
concordia-claw:feat/editor-params-get-dynamic-state
Closed

concordia-claw wants to merge 2 commits into
google-deepmind:mainfrom
concordia-claw:feat/editor-params-get-dynamic-state

Conversation

@concordia-claw

@concordia-claw concordia-claw commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This adds read-only params and get commands to the shared editor/CLI grammar. It also makes the situated game master's state editable at runtime, and fixes the contrib simultaneous game master. I found these gaps while making a tutorial for the project editor and concordia-session.

  • params and get.
    • params ID lists an instance's prefab parameters with value, default, type and the exact set command.
    • params ID COMPONENT lists a built component's class, constructor parameters, editable state and other state fields.
    • params simulation lists premise and max_steps.
    • get ID FIELD reads one value, using the same paths as set.
    • get ID COMPONENT FIELD reads one component state field from the preview, or from the runtime after view runtime.
    • Both commands work in the browser terminal and in concordia-session. They never change the draft and are allowed while a run is active.
  • Constructor parameters in component info. generic.Simulation now reports each component's constructor signature (parameters). For example, params narrator generative_clock shows that the situated game master passes clock_description and start_time to GenerativeClock as prompt and start_time.
  • Editable game master state. GenerativeClock (time), Locations (entity_locations) and WorldState (state) now implement get_dynamic_state. Their set_state rejects badly typed values. A paused run can therefore move the clock or a character, for example edit narrator generative_clock time '"11:45 AM"'.
  • contrib GameMasterSimultaneous fixes.
    • FixedIncrementClock now calls super().__init__(). Before, building the prefab failed with an AttributeError on _logging_channel.
    • The default start_time was None, which crashed strptime with a TypeError. It now defaults to a parseable date, and the fallback also catches TypeError.
    • New use_variable_increments parameter: False makes every step exactly time_period_minutes long.
    • New call_to_action parameter: it replaces the default request for a 10-sentence plan, for example "How many fish does {name} catch this round?".
  • Docs. editor-commands.md and the CLI README document the new commands and editable state. They also explain that structured logs are compressed: repeated content is stored once and referenced by hash, so grep on a raw log undercounts. In one tutorial run, a phrase had 725 raw matches but 1,584 after concordia-log dump.

An observation that this PR does not change: SimultaneousNarrativeEventResolution asks for max(400, 25 × time_period_minutes) words per step. A one-day step (1440 minutes) therefore demands a 36,000-word narrative, with retries. The pond example in the editor uses 15-minute rounds for this reason.

Test plan

  • pytest concordia: 1,091 passed, including new tests in session_commands_test.py, world_state_test.py and simultaneous_resolution_gm_test.py.
  • pyrefly check concordia (1.2.0, as pinned in requirements.txt) and pylint --errors-only concordia are clean. The second commit fixes the read-only Mapping assignments in the new world-state tests that CI flagged.
  • The project-editor example from concordia-claw's feat/android-project-editor-demo-001 branch passes on top of this branch (79 tests).
  • Live runs with DeepSeek V4.1 Flash on Together AI:
    • a situated game with a clock edited mid-run;
    • a three-round commons dilemma on the simultaneous game master;
    • an asynchronous forum.

🤖 Generated with Claude Code

- New shared editor/CLI commands: `params ID [COMPONENT]` lists an
  instance's prefab parameters (value, default, type and the matching
  `set` command) or a built component's constructor parameters and
  editable state; `get ID FIELD` and `get ID COMPONENT FIELD` read one
  value. Both are read-only and work while a run is active.
- The generic simulation's component info now reports each component's
  constructor parameters, so `params narrator generative_clock` shows how
  prefab parameters reach a component.
- GenerativeClock (`time`), Locations (`entity_locations`) and WorldState
  (`state`) advertise editable dynamic state; `set_state` validates the
  edited values.
- contrib GameMasterSimultaneous: FixedIncrementClock initializes its
  base class (it previously failed on `_logging_channel`), the default
  start time now parses, and new `use_variable_increments` and
  `call_to_action` parameters allow fixed-length rounds and short custom
  player prompts.
- Docs: editor-commands.md and the CLI README cover params/get, editable
  game master state, and the fact that structured logs are compressed,
  so grep on a raw log undercounts; use the log tools or dump first.
@google-cla

google-cla Bot commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

jzleibo
jzleibo previously approved these changes Oct 6, 2026
copybara-service Bot pushed a commit that referenced this pull request Oct 6, 2026
--
fa1a56e by concordia-claw <concordia-claw@users.noreply.github.com>:

Add params/get inspection and runtime-editable game master state

- New shared editor/CLI commands: `params ID [COMPONENT]` lists an
  instance's prefab parameters (value, default, type and the matching
  `set` command) or a built component's constructor parameters and
  editable state; `get ID FIELD` and `get ID COMPONENT FIELD` read one
  value. Both are read-only and work while a run is active.
- The generic simulation's component info now reports each component's
  constructor parameters, so `params narrator generative_clock` shows how
  prefab parameters reach a component.
- GenerativeClock (`time`), Locations (`entity_locations`) and WorldState
  (`state`) advertise editable dynamic state; `set_state` validates the
  edited values.
- contrib GameMasterSimultaneous: FixedIncrementClock initializes its
  base class (it previously failed on `_logging_channel`), the default
  start time now parses, and new `use_variable_increments` and
  `call_to_action` parameters allow fixed-length rounds and short custom
  player prompts.
- Docs: editor-commands.md and the CLI README cover params/get, editable
  game master state, and the fact that structured logs are compressed,
  so grep on a raw log undercounts; use the log tools or dump first.

COPYBARA_INTEGRATE_REVIEW=#396 from concordia-claw:feat/editor-params-get-dynamic-state fa1a56e
PiperOrigin-RevId: 994463500
Change-Id: Ibb1f50f5176cdecaca5e119f979a33b1d7117f9f
get_state() returns a read-only Mapping; pyrefly rejected the item
assignments in the new dynamic-state tests.
@jzleibo

jzleibo commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Closing this pull request as the changes have already been merged into main via commit 12e9634.

@jzleibo jzleibo closed this Oct 7, 2026
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