Skip to content

feat: tool-registry pattern + example echo_tool (demonstrates layering) #20

@constk

Description

@constk

Problem

The import-linter contract depends on src/tools/ being a real layer. With no tools, the contract is vacuous and the pattern isn't demonstrated for users.

Proposed solution

Add src/tools/registry.py (dict-based tool dispatcher with type-checked registration). Add an echo_tool whose input/output are StrictModels. Add src/tools/__init__.py. The registry imports only from src/data/ and src/observability/ (consistent with the layer contract).

Acceptance criteria

  • src/tools/registry.py exposes a Registry class with register() and dispatch() methods.
  • echo_tool is registered at module load and dispatches successfully via the registry.
  • Unit tests cover happy path, unknown-tool dispatch, and bad-input rejection.
  • lint-imports confirms tools imports nothing from api/ or agent/.

Priority rationale

Medium: not a quality gate itself, but it makes the tool-registry pattern concrete for future LLM coders.

Depends on

#18

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendPython + FastAPI backend scaffoldenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions