feat: Add version management, session tracking, and commit linking

Phase 1: Version Management
- Migration 006: Add git_tag, git_sha columns to versions
- New tools: version_add, version_list, version_show, version_update,
  version_release, version_assign_task
- Links versions to git tags for release tracking

Phase 2: Session/Task Activity Tracking
- Migration 007: Create task_activity table
- Track task changes per session (created, updated, status_change, closed)
- Session ID from env/cache file (usage-stats format)
- New tool: session_tasks to query tasks by session

Phase 3: Commit-Task Linking
- Migration 008: Create task_commits junction table
- New tools: task_commit_add, task_commit_remove, task_commits_list,
  task_link_commits (batch parsing)
- Stores SHA references only (Gitea MCP owns full data)
- Commits shown in task_show output

17 new MCP tools total. All migrations applied to docker-host postgres.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-01-10 10:28:21 +02:00
parent e12cccf718
commit 5015b1416f
9 changed files with 930 additions and 0 deletions

View File

@@ -209,6 +209,86 @@ export const toolDefinitions = [
},
},
// Version Tools
{
name: 'version_add',
description: 'Create a new version/release for a project',
inputSchema: {
type: 'object',
properties: {
project: { type: 'string', description: 'Project key (e.g., VPN, ST)' },
version: { type: 'string', description: 'Version number (e.g., 1.0.0, 2.1.0-beta)' },
build_number: { type: 'number', description: 'Optional build number' },
status: { type: 'string', enum: ['planned', 'in_progress', 'released', 'archived'], description: 'Version status (default: planned)' },
release_notes: { type: 'string', description: 'Optional release notes' },
},
required: ['project', 'version'],
},
},
{
name: 'version_list',
description: 'List versions with optional filters',
inputSchema: {
type: 'object',
properties: {
project: { type: 'string', description: 'Filter by project key' },
status: { type: 'string', enum: ['planned', 'in_progress', 'released', 'archived'], description: 'Filter by status' },
limit: { type: 'number', description: 'Max results (default: 20)' },
},
},
},
{
name: 'version_show',
description: 'Show version details with assigned tasks and epics',
inputSchema: {
type: 'object',
properties: {
id: { type: 'string', description: 'Version ID (e.g., VPN-v1.0.0)' },
},
required: ['id'],
},
},
{
name: 'version_update',
description: 'Update version fields (status, git_tag, git_sha, release_notes)',
inputSchema: {
type: 'object',
properties: {
id: { type: 'string', description: 'Version ID to update' },
status: { type: 'string', enum: ['planned', 'in_progress', 'released', 'archived'], description: 'New status' },
git_tag: { type: 'string', description: 'Git tag name (e.g., v1.0.0)' },
git_sha: { type: 'string', description: 'Git commit SHA for this version' },
release_notes: { type: 'string', description: 'Release notes' },
release_date: { type: 'string', description: 'Release date (ISO format)' },
},
required: ['id'],
},
},
{
name: 'version_release',
description: 'Mark a version as released (sets status and release_date)',
inputSchema: {
type: 'object',
properties: {
id: { type: 'string', description: 'Version ID to release' },
git_tag: { type: 'string', description: 'Optional git tag to associate' },
},
required: ['id'],
},
},
{
name: 'version_assign_task',
description: 'Assign a task to a version',
inputSchema: {
type: 'object',
properties: {
task_id: { type: 'string', description: 'Task ID to assign' },
version_id: { type: 'string', description: 'Version ID to assign to' },
},
required: ['task_id', 'version_id'],
},
},
// Delegation Tools
{
name: 'task_delegations',
@@ -234,6 +314,81 @@ export const toolDefinitions = [
},
},
// Commit Tools
{
name: 'task_commit_add',
description: 'Link a git commit to a task (SHA reference only, Gitea MCP has full commit data)',
inputSchema: {
type: 'object',
properties: {
task_id: { type: 'string', description: 'Task ID (e.g., VPN-123)' },
commit_sha: { type: 'string', description: 'Git commit SHA (full or short)' },
repo: { type: 'string', description: 'Repository (e.g., christian/VPN)' },
source: { type: 'string', enum: ['manual', 'parsed', 'pr_merge'], description: 'How the link was created (default: manual)' },
},
required: ['task_id', 'commit_sha', 'repo'],
},
},
{
name: 'task_commit_remove',
description: 'Remove a commit link from a task',
inputSchema: {
type: 'object',
properties: {
task_id: { type: 'string', description: 'Task ID' },
commit_sha: { type: 'string', description: 'Commit SHA to unlink' },
},
required: ['task_id', 'commit_sha'],
},
},
{
name: 'task_commits_list',
description: 'List commits linked to a task',
inputSchema: {
type: 'object',
properties: {
task_id: { type: 'string', description: 'Task ID' },
},
required: ['task_id'],
},
},
{
name: 'task_link_commits',
description: 'Parse commit messages for task references and create links (batch operation)',
inputSchema: {
type: 'object',
properties: {
repo: { type: 'string', description: 'Repository (e.g., christian/VPN)' },
commits: {
type: 'array',
description: 'Array of commits with sha and message',
items: {
type: 'object',
properties: {
sha: { type: 'string' },
message: { type: 'string' },
},
required: ['sha', 'message'],
},
},
dry_run: { type: 'boolean', description: 'Preview without creating links (default: false)' },
},
required: ['repo', 'commits'],
},
},
{
name: 'session_tasks',
description: 'List tasks worked on in a session (from task_activity tracking)',
inputSchema: {
type: 'object',
properties: {
session_id: { type: 'string', description: 'Session ID (supports * wildcard, e.g., session_20260110_*)' },
limit: { type: 'number', description: 'Max results (default: 20)' },
},
required: ['session_id'],
},
},
// Project Lock Tools
{
name: 'project_lock',