Skip to content

Add typed config loader and validation for safe defaults #19

Description

@Aggredicus

Add typed config loader and validation for safe defaults

Purpose

Create a typed configuration layer so config.example.yaml and runtime behavior stay aligned and dangerous settings are validated before use.

The project already documents safe defaults such as summon-only public behavior and no automatic multi-packet replies. This issue turns those expectations into validated config behavior.

Scope

Add or design:

src/permanet_agent/config.py

Use Pydantic or another existing dependency already in the project to validate config.

Validate fields such as:

  • summon phrases
  • radio adapter
  • public channel mode
  • max response chars
  • cooldown seconds
  • allow automatic multipacket replies
  • AI backend
  • storage path

Safety requirements

Defaults must remain safe:

radio.adapter = mock
policy.public_requires_summon = true
policy.allow_automatic_multipacket_replies = false

Dangerous or unsupported values should fail clearly.

Non-goals

Do not add live radio behavior.
Do not add private group routing.
Do not implement full Issue #1 response behavior unless needed for config tests.

Acceptance criteria

  • Typed config models exist.
  • Config can be loaded from YAML.
  • config.example.yaml validates successfully.
  • Unsafe values fail with clear errors.
  • Tests cover valid config and unsafe config.
  • Docs explain config validation and safe defaults.

Rollback plan

Keep config loading isolated so it can be reverted without changing routing behavior.

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