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:
6
migrations/006_version_git_tag.sql
Normal file
6
migrations/006_version_git_tag.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- Migration 006: Add git_tag and git_sha columns to versions table
|
||||
-- Links versions to git tags/releases
|
||||
|
||||
ALTER TABLE versions ADD COLUMN IF NOT EXISTS git_tag TEXT;
|
||||
ALTER TABLE versions ADD COLUMN IF NOT EXISTS git_sha TEXT;
|
||||
CREATE INDEX IF NOT EXISTS idx_versions_git_tag ON versions(git_tag);
|
||||
16
migrations/007_task_activity.sql
Normal file
16
migrations/007_task_activity.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- Migration 007: Task activity tracking for session integration
|
||||
-- Tracks which tasks were touched per session for audit trail
|
||||
|
||||
CREATE TABLE IF NOT EXISTS task_activity (
|
||||
id SERIAL PRIMARY KEY,
|
||||
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
||||
session_id TEXT NOT NULL,
|
||||
activity_type TEXT NOT NULL CHECK (activity_type IN ('created', 'updated', 'status_change', 'closed')),
|
||||
old_value TEXT,
|
||||
new_value TEXT,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_task_activity_session ON task_activity(session_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_task_activity_task ON task_activity(task_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_task_activity_time ON task_activity(created_at DESC);
|
||||
16
migrations/008_task_commits.sql
Normal file
16
migrations/008_task_commits.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- Migration 008: Task-commit linking
|
||||
-- Links tasks to git commits via SHA references (Gitea MCP owns full commit data)
|
||||
|
||||
CREATE TABLE IF NOT EXISTS task_commits (
|
||||
id SERIAL PRIMARY KEY,
|
||||
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
||||
commit_sha TEXT NOT NULL,
|
||||
repo TEXT NOT NULL,
|
||||
source TEXT DEFAULT 'manual' CHECK (source IN ('manual', 'parsed', 'pr_merge')),
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
UNIQUE(task_id, commit_sha)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_task_commits_task ON task_commits(task_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_task_commits_sha ON task_commits(commit_sha);
|
||||
CREATE INDEX IF NOT EXISTS idx_task_commits_repo ON task_commits(repo);
|
||||
Reference in New Issue
Block a user