Skip to content

Type-hint pass on parley/spec.py #38

Description

@5uper0

parley/spec.py (declarative recipes → the engine) is the largest core module still carrying bare container annotations. Hints only — zero behaviour change.

What is wanted

  • PartySpec.hard: listList[Constraint]; PartySpec.utility: listList[UtilityTerm]
  • DecisionSpec.options: listList[dict]; DecisionSpec.parties: listList[PartySpec]
  • UtilityTerm.score(...) -> tupleTuple[float, float]
  • to_agents() -> listList[Agent]
  • run(...) currently has no return annotation → ConsensusResult (import alongside the existing run_consensus import from .consensus)
  • from_dict(cls, d: dict) params → Dict[str, Any] where the dict shape is JSON-ish

Match the style of the #32 pass (typing.List/Optional imports).

How to verify

.venv/bin/pytest -q tests/test_spec.py tests/test_real_decision_recipes.py
.venv/bin/pytest -q

Identical results as before — annotations only.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions