Skip to content

feat(wiki): consolidate 5 wiki tools into 2 CQRS tools#36

Merged
polaz merged 3 commits intomainfrom
refactor/#10-wiki-cqrs-consolidation
Jan 19, 2026
Merged

feat(wiki): consolidate 5 wiki tools into 2 CQRS tools#36
polaz merged 3 commits intomainfrom
refactor/#10-wiki-cqrs-consolidation

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Jan 19, 2026

Summary

Consolidates 5 wiki tools into 2 CQRS-aligned tools per Issue #10:

  • browse_wiki (Query): list, get actions
  • manage_wiki (Command): create, update, delete actions

Changes

  • Updated schema-readonly.ts with BrowseWikiSchema using flat object pattern with .refine()
  • Updated schema.ts with ManageWikiSchema using flat object pattern with .refine()
  • Updated registry.ts with 2 consolidated CQRS handlers
  • Updated unit tests (47 tests passing)
  • Updated integration tests with new CQRS tool names

Technical Details

Uses flat z.object() with .refine() instead of z.discriminatedUnion() for Claude API compatibility (no oneOf/allOf/anyOf at JSON Schema root level).

Test plan

  • All 1429 unit tests pass
  • Build successful
  • Lint passes

Closes #10

- browse_wiki (Query): list, get actions
- manage_wiki (Command): create, update, delete actions

Uses flat z.object() with .refine() pattern for Claude API compatibility.
Removes legacy schemas in favor of CQRS-aligned consolidated tools.

Closes #10
Copilot AI review requested due to automatic review settings January 19, 2026 17:58
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 19, 2026

📊 Test Coverage Report

Overall Coverage: 86.53%

Coverage Details

Metric Percentage
Statements 86.53%
Branches 81.21%
Functions 75.49%
Lines 86.98%

Coverage Report: View detailed coverage report

This report was generated automatically from your PR changes.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 97.95918% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/entities/wiki/registry.ts 97.29% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates 5 wiki tools into 2 CQRS-aligned tools to address Issue #10, improving tool organization and reducing tool count while maintaining full functionality.

Changes:

  • Replaced 5 individual wiki tools with 2 CQRS tools using action-based routing
  • Implemented flat schema pattern with .refine() for Claude API compatibility (avoiding oneOf/allOf/anyOf at root level)
  • Updated comprehensive test suite with 47+ unit tests and integration tests

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/entities/wiki/schema-readonly.ts Defines BrowseWikiSchema with "list" and "get" actions for read-only operations
src/entities/wiki/schema.ts Defines ManageWikiSchema with "create", "update", and "delete" actions for write operations
src/entities/wiki/registry.ts Implements 2 CQRS tool handlers with action routing, replaces 5 individual tool handlers
tests/unit/entities/wiki/registry.test.ts Updates unit tests for CQRS tools with comprehensive coverage of all actions and error cases
tests/integration/schemas/wiki.test.ts Updates integration tests for new tool names and validates all action types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@polaz polaz merged commit 578be93 into main Jan 19, 2026
12 checks passed
@polaz polaz deleted the refactor/#10-wiki-cqrs-consolidation branch January 19, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(wiki): CQRS consolidation - 5 tools → 2 tools

2 participants