Skip to content

feat(core): add todos tools and CQRS consolidation (#4, #16)#21

Merged
polaz merged 7 commits intomainfrom
feat/#4-#16-todos-and-cqrs-core-consolidation
Jan 19, 2026
Merged

feat(core): add todos tools and CQRS consolidation (#4, #16)#21
polaz merged 7 commits intomainfrom
feat/#4-#16-todos-and-cqrs-core-consolidation

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Jan 19, 2026

Summary

CQRS Consolidation (Issue #16)

New Tool Consolidates Actions
browse_projects search_repositories, list_projects, get_project search, list, get
browse_namespaces list_namespaces, get_namespace, verify_namespace list, get, verify
browse_commits list_commits, get_commit, get_commit_diff list, get, diff
browse_events list_events, get_project_events user, project
manage_repository create_repository, fork_repository create, fork

Todos Tools (Issue #4)

  • list_todos: Filter by state/action/type with pagination
  • manage_todos: mark_done, mark_all_done, restore actions

Test Plan

  • yarn lint - 0 errors
  • yarn build - successful
  • yarn test:unit - 1337 tests passing
  • URL encoding edge cases tested (spaces, special characters like +)
  • Todos tools comprehensive tests (filters, pagination, error handling)

Closes #4
Closes #16

FEATURE: Todos Management Tools (Issue #4)
- Add list_todos tool: filter by state/action/type with pagination
- Add manage_todos tool: mark_done, mark_all_done, restore actions

FEATURE: CQRS Consolidation (Issue #16)
Reduce 18 core tools to 10 by consolidating related operations:
- browse_projects: search/list/get projects (was 3 tools)
- browse_namespaces: list/get/verify namespaces (was 3 tools)
- browse_commits: list/get/diff commits (was 3 tools)
- browse_events: user/project events (was 2 tools)
- manage_repository: create/fork repos (was 2 tools)

FIX: URL encoding in browse_projects
- Fix double-encoding bug where spaces became %2B instead of +
- URLSearchParams now handles encoding correctly

CI: Add semantic-release job permissions
- contents:write, issues:write, pull-requests:write, id-token:write

TEST: Comprehensive unit tests (1337 passing)
- Full coverage for consolidated tools with edge cases
- Todos tools tests: filters, pagination, error handling
- URL encoding tests: spaces, special characters like +
Copilot AI review requested due to automatic review settings January 19, 2026 08:32
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 19, 2026

📊 Test Coverage Report

Overall Coverage: 84.84%

Coverage Details

Metric Percentage
Statements $(cat coverage/lcov-report/index.html
Branches $(cat coverage/lcov-report/index.html
Functions $(cat coverage/lcov-report/index.html
Lines $(cat coverage/lcov-report/index.html

📈 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 85.18519% with 64 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/entities/core/registry.ts 83.79% 26 Missing and 38 partials ⚠️

📢 Thoughts on this report? Let us know!

Improve tool descriptions to help agents decide WHEN to use each action:
- browse_projects: clarify search vs list vs get use cases
- browse_namespaces: explain when to verify vs get vs list
- browse_commits: describe list/get/diff scenarios
- browse_events: distinguish user vs project activity feeds
- manage_repository: explain create vs fork purposes
- list_todos: describe todo sources and filter options
- manage_todos: clarify mark_done vs mark_all_done vs restore

Follows CLAUDE.md "Agentic Tool Description Standards" - focus on
WHAT and WHEN, not HOW (no implementation details).
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 implements CQRS consolidation reducing 18 core tools to 10, adds 2 new todos management tools (total 12), fixes URL encoding for spaces in project search, and adds CI permissions for semantic-release.

Changes:

  • Consolidates 13 read tools into 5 CQRS-style tools (browse_projects, browse_namespaces, browse_commits, browse_events, manage_repository)
  • Adds list_todos and manage_todos for GitLab task management
  • Fixes space encoding in search queries (prevents double-encoding)

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/entities/core/registry.ts Implements consolidated tool handlers with action-based routing
src/entities/core/schema.ts Adds ManageRepositorySchema and ManageTodosSchema with action discriminators
src/entities/core/schema-readonly.ts Adds 4 consolidated browse schemas; keeps deprecated schemas for compatibility
tests/unit/entities/core/registry.test.ts Updates tests for consolidated tools and new todos features
tests/unit/entities/core/handlers.test.ts Comprehensive handler tests for all actions and edge cases
.github/workflows/ci-cd.yml Adds required permissions for semantic-release job

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

polaz added 2 commits January 19, 2026 10:41
Addressed review comments:
- Improve error messages with format guidance (project_id examples)
- Fix URL encoding comment: spaces become '+' not '%20'
- Add .int().positive() validation to ManageTodosSchema id field
- Document fork_name/fork_path naming rationale (avoids schema conflict)

Deferred to future:
- Discriminated unions for action-specific validation (significant refactor)
- Deprecated schema simplification (needed for backward compatibility)
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


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

… feedback

TODOS INTEGRATION TESTING:
- Add todos helper methods to registry-helper.ts (listTodos, markTodoDone, etc.)
- Add Step 6.5 to data-lifecycle.test.ts for todos infrastructure testing
- Tests: list pending todos, filter by type, mark_done/restore, mark_all_done

COPILOT REVIEW FIXES:
- Document fork_name/fork_path rationale (distinct from create's name for schema)
- Clarify manage_todos response types in description (object vs success status)
- Clarify q vs search parameter distinction in BrowseProjectsSchema
- Improve handler code with explicit destructuring per action

OAUTH TEST COVERAGE:
- Add callback.test.ts for OAuth callback endpoint
- Add gitlab-device-flow.test.ts for device flow operations
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

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.


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

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

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


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

Add 24 unit tests covering previously untested handlers:
- browse_namespaces: list, get, verify actions with all parameters
- browse_commits: list, get, diff actions with filters
- browse_events: user and project scoped events
- get_users: non-smart search path with filters
- list_project_members: basic and query filter operations
- list_group_iterations: iterations with state/search filters
- download_attachment: success, missing content-type, errors
- create_branch: branch creation from refs
- create_group: full parameter coverage
- manage_repository: fork edge cases, namespace resolution
- manage_todos: additional error handling paths

Coverage improvement for registry.ts:
- Statements: 67.84% -> 91.54% (+23.7%)
- Branches: 67.49% -> 82.33% (+14.8%)
- Lines: 84.12% -> 94.42% (+10.3%)
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

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


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

@polaz polaz merged commit 0abbf3b into main Jan 19, 2026
26 checks passed
polaz added a commit that referenced this pull request Jan 19, 2026
…-app-token

fix(ci): use GitHub App token for semantic-release
@polaz polaz deleted the feat/#4-#16-todos-and-cqrs-core-consolidation branch January 19, 2026 14:55
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(core): CQRS consolidation - 18 tools → 10 tools feat(core): Add Todos Management Tools

2 participants