Skip to content

Enforce strict type checking and remove suppressions#212

Open
BeathovenGala wants to merge 1 commit into
google-deepmind:mainfrom
BeathovenGala:refactor/strict-typing
Open

Enforce strict type checking and remove suppressions#212
BeathovenGala wants to merge 1 commit into
google-deepmind:mainfrom
BeathovenGala:refactor/strict-typing

Conversation

@BeathovenGala

Copy link
Copy Markdown

Issue

Enable strict type checking and resolve pytype workarounds #206

Description:

This PR enforces strict type checking by removing the lenient configuration and cleaning up explicit suppressions in the codebase.

Changes:

  1. Strict Configuration:

    • Updated pyproject.toml to remove keep_going = true. This ensures pytype fails immediately on errors, enforcing a "zero tolerance" policy for new type violations.
  2. Engine Interface Fix:

    • Widened the return type of Engine.next_acting in concordia/environment/engine.py to correctly support parallel engines that return lists of entities instead of just single tuples.
    • Old signature: tuple[Entity, ActionSpec]
    • New signature: tuple[...] | Sequence[Entity] | tuple[Sequence[Entity], ...]
  3. Removed Suppressions:

    • Removed pytype: disable=signature-mismatch from 3 engine implementations (parallel_questionnaire.py, sequential_questionnaire.py, simultaneous.py) as they now comply with the widened base class interface.
    • Removed pytype: disable=override-error from entity_agent.py and simple_llm_agent.py.

Verification:

Ran full test suite (pytest --pyargs concordia). All tests passed,(Will work with the tempory fix from #211 or in some time ) confirming that the interface widening did not introduce runtime regressions.

@BeathovenGala BeathovenGala force-pushed the refactor/strict-typing branch from 1dae756 to 802a444 Compare February 4, 2026 18:39
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.

1 participant