Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

refactor: mcp#94

Merged
christopherwxyz merged 8 commits into
officialunofficial:mainfrom
marthendalnunes:refactor/mcp
Feb 22, 2026
Merged

refactor: mcp#94
christopherwxyz merged 8 commits into
officialunofficial:mainfrom
marthendalnunes:refactor/mcp

Conversation

@marthendalnunes

Copy link
Copy Markdown
Contributor

Description

This PR refactors Waypoint query/business logic out of MCP handlers into a new transport-agnostic WaypointQuery layer (src/query/*).
The MCP layer now acts as a thin protocol adapter (WaypointMcpTools) that handles request parsing, error mapping, and response serialization, while core query behavior lives in reusable query modules. This separation improves maintainability and enables future adapters (e.g., REST/GraphQL) without duplicating business logic.
What Changed

  • Added a modular query core (users, casts, reactions, links, plus shared types, responses, utils, error).
  • Migrated MCP tool/resource handlers to delegate to WaypointQuery.
  • Removed MCP-specific business-logic modules from handlers.
  • Hardened validation and parity behavior (not-found/error handling, reactions/link semantics, conversation and hash handling, backward-compatible conversation fid parsing).
  • Expanded MCP contract compatibility coverage with fixture-based tests.
  • Updated architecture and MCP docs to reflect the new layered design.

Type of change

  • Code refactoring (no functional changes)

@marthendalnunes marthendalnunes changed the title Refactor/mcp refactor: mcp Feb 16, 2026
christopherwxyz and others added 2 commits February 22, 2026 14:25
- Extract extract_fid, fetch_quoted_casts, fetch_participant_profiles,
  extract_cast_text helpers in casts.rs to remove repeated patterns
- Consolidate set_participant_user_field into users::set_user_data_field
- Change get_parent_cast_info to return Option<(Fid, Vec<u8>)> instead
  of tuple-of-options
- Replace current_depth/max_depth with remaining_depth to reduce arg count
- Extract build_target_info helper in reactions.rs
- Add parse_embed_list utility function
- Remove narration comments and dead serde attributes
- Fix misleadingly underscore-prefixed parameters that were actually used
- Net reduction of ~160 lines

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Combine NullDb relocation (from PR officialunofficial#93) with query layer
refactor (PR officialunofficial#94). All imports now use database::NullDb.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@christopherwxyz
christopherwxyz merged commit 8d915b5 into officialunofficial:main Feb 22, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants