Skip to content

fix: Agent.from_dict no status validation — allows invalid states via deserialization #24

Description

@branben

What to build

Agent.from_dict does status=data.get('status', 'idle') but never validates against allowed values ("idle", "working", "sleeping"). A corrupted JSON file creates an Agent that violates the state machine contract.

Add: if status not in VALID_STATUSES: status = "idle".

Acceptance criteria

  • Invalid status values default to "idle"
  • Tests verify corrupt JSON is handled gracefully

Blocked by

None - can start immediately

Parent

Tracks the campus framework v1 code review: #27

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions