Skip to content

tech-debt: Add ABC interfaces to agent files during build to prevent integration mismatches #3

@moonrunnerkc

Description

@moonrunnerkc

Context

While building out the 15 agent files in backend/agents/ (Phase 4), the current stubs (or early impls) lack standardized ABC interfaces with method signatures and docstrings. This risks a landmine where individual agent methods (e.g., PerceptionAgent's ingest()) don't align with BEL loop expectations, leading to cascading refactors when orchestrating all 15 in Phase 5.

Steps to Reproduce

  1. During Phase 4: Create a new agent file like perception.py without ABC base class.
  2. Implement async def ingest(...) based on mental spec recall → Slight sig drift (e.g., missing context: dict param).
  3. In Phase 5 stub test: Import and call await perception.ingest(input) in bel/loop.py → TypeError or runtime mismatch.
  4. Repeat x15 → Full orchestration becomes a mismatch nightmare.

Expected vs Actual

  • Expected: Each agent file inherits from a shared AgentABC with @abstractmethod for core methods (e.g., async def ingest(self, raw_input: str, context: dict) -> List[str]: raise NotImplementedError), ensuring consistency as we build.
  • Actual: Ad-hoc impls in new files → Silent drifts until runtime/integration, blocking smooth phased dev.

Logs/Screenshots

  • Hypothetical trace: TypeError: ingest() missing 1 required positional argument: 'context'.

Suggested Fix

As we build each of the 15 agents in Phase 4:

  • Create a shared backend/agents/base.py with AgentABC = ABC and abstract methods per role (e.g., from planned spec: ingest for Perception, create_beliefs for Creator).
  • Have each agent inherit: class PerceptionAgent(AgentABC): ...
  • Prioritize: Add to first 3-5 files now (Perception, Creator, Reinforcement), then apply to remaining as you go.
    Tie this as a Phase 4 milestone—low effort per file, huge payoff for orchestration.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions