12 Commits

Author SHA1 Message Date
CI System
1aee8779c7 feat: orchestrator UI, dashboard improvements, and workflow fixes
Orchestrator:
- Add orchestrator chat interface with streaming responses
- MCP server integration for YouTrack queries
- Quick actions for backlog review, triage analysis
- Dynamic suggestions based on conversation context
- Action approval/rejection workflow

Dashboard improvements:
- Add font preloading to prevent FOUC
- CSS spinner for loading state (no icon font dependency)
- Wait for fonts before showing UI
- Fix workflow pipeline alignment
- Fix user message contrast (dark blue background)
- Auto-scroll chat, actions, suggestions panels
- Add keyboard shortcuts system
- Add toast notifications
- Add theme toggle (dark/light mode)
- New pages: orchestrator, repos, system, analytics

Workflow fixes:
- Skip Build state when agent determines no changes needed
- Check branch exists before attempting push
- Include comments in get_issues MCP response
- Simplified orchestrator prompt focused on Backlog management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 15:37:49 -07:00
CI System
70c3c847a9 Merge branch 'issue/CG-62' - block merge when verification output indicates failure
Adds _detect_verification_result() to parse QA agent stdout for failure
markers. Even if the QA agent exits with code 0, the merge will be blocked
if the output contains patterns like "verification failed", "requirements
not met", "not actually implemented", etc.

Also handles merge failures (e.g., conflicts) by moving to Triage.

Resolves: CG-62

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:00:44 -07:00
CI System
876b8789b8 fix: move issue to Triage when merge fails
When verification succeeds but the merge to main fails (e.g., due to
conflicts or filesystem issues), the issue now moves to Triage state
for human intervention instead of continuing to Document state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:59:14 -07:00
CI System
7516776a2e fix: display tool results in stream view, handle null comment bodies
Dashboard:
- Parse tool_result blocks from user messages in stream view
- Display truncated tool results (max 500 chars) instead of "[User message]"
- Add tool_result styling with blue color and scrollable container

Backend:
- Fix null comment body handling in build_prompt (use `or ""` pattern)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:55:49 -07:00
CI System
f287420fe8 fix: skip Build state for repos without CI, fix streaming output
- Return "NO_CI" from _check_build_status for repos without build_type
- Add NO_CI handler in _process_build_items to skip to Verify state
- Add --verbose flag required for stream-json output format
- Sanitize task_id in history filenames (replace : with _)
- Remove agentrunner from build_types (no CI configured)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:52:09 -07:00
ClearGrow Agent
fb99626e7e fix: CG-62 block merge when verification output indicates failure
Add secondary verification check that parses agent stdout for explicit
failure markers before merging to main. This prevents merging when the
QA agent reports "Verification Failed" in its output but exits with code 0.

Changes:
- Add _detect_verification_result() function to parse stdout for pass/fail
  markers using regex patterns
- Modify _on_agent_complete() to check stdout content before calling
  _merge_feature_branch()
- Log verification result (exit_code + stdout_check) before merge decision
- Block merge and add "Merge Blocked" comment when stdout indicates failure
- Move issue to Triage state when merge is blocked

Failure patterns detected:
- "verification failed"
- "requirements not met"
- "was not implemented" / "were not implemented"
- "not actually implemented"
- "none of the changes were implemented"
- "acceptance criteria not met"
- "## Verification Failed" header

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:49:33 -07:00
CI System
dbf118a8f8 feat: add agent history persistence and history view page
- Add AgentHistory class to persist completed agent runs to disk
- Store full message logs in JSON files with index for fast lookups
- Add /api/history and /api/history/{task_id} endpoints
- Create history page in dashboard showing past agent runs
- Add History link to navigation menu
- Update agent detail page to fall back to history for completed runs
- Display status badges (Success/Failed/Timeout) on history cards

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:42:12 -07:00
CI System
3bd1b0eabd feat: add real-time agent output streaming to dashboard
- Add StreamMessage dataclass and streaming output support to AgentTask
- Modify _start_agent to use --output-format stream-json for real-time output
- Add _read_output thread to parse streaming JSON and store messages
- Add get_task_output() method to AgentPool for polling output
- Add GET /api/agents/{task_id}/output endpoint for polling
- Add GET /api/agents/{task_id}/stream SSE endpoint for real-time streaming
- Create agent detail page at /agents/[taskId] with live output view
- Make agent cards clickable to view real-time output
- Add TypeScript types for streaming messages

Users can now click on a running agent in the dashboard to see
a real-time stream of the Claude Code conversation including
tool calls, responses, and results.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:36:04 -07:00
CI System
d218c49b2f fix: resolve API field mismatches and issue count fetching
- Fix PoolStatus.to_dict() field names to match frontend types
  (active_count, active_tasks instead of active, tasks)
- Fix AgentTaskInfo.to_dict() to use start_time instead of started_at
- Fix _get_issues() to use correct YouTrackClient method signature
  (get_issues_by_state takes project and state, not state and limit)
- Fix _get_builds() to use get_running_builds() instead of non-existent
  get_builds() method
- Fix _get_issue_counts() to actually fetch counts from YouTrack API
  instead of returning all zeros

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:18:44 -07:00
CI System
41d751b678 feat: add web dashboard with Gitea OAuth authentication
Implements a full management dashboard for the Agent Runner at
https://agent.cleargrow.io with real-time monitoring and control.

Backend changes:
- Add oauth.py: Gitea OAuth2 authentication with session management
- Add api_server.py: REST API endpoints and static file serving
- Add dashboard_api.py: Data aggregation layer for dashboard
- Modify agent.py: Add kill_task() and get_task() methods
- Modify runner.py: Add event broadcasting and OAuth initialization
- Modify webhook_server.py: Integrate dashboard API handler

Frontend (SvelteKit + TypeScript):
- Dashboard overview with health status, agent pool, issue counts
- Agents page with active task list and kill functionality
- Issues page with state filtering and transitions
- Builds page with Woodpecker CI integration
- Config page for runtime settings

Features:
- Gitea OAuth2 login (same pattern as Woodpecker CI)
- Real-time status updates via polling (5s interval)
- Agent termination from dashboard
- Issue state transitions
- Service health monitoring

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:11:01 -07:00
CI System
c6d18d0b5e docs: fix workflow diagram - merge happens after Verify
The merge to main occurs after the QA verification step succeeds,
not after Review/Done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 21:07:58 -07:00
CI System
5903b69b2d Initial commit: ClearGrow Agent Runner
Automated task orchestration system for YouTrack + Gitea + Woodpecker CI:

- runner.py: Main orchestration engine with state machine workflow
- agent.py: Claude Code subprocess pool management
- youtrack_client.py: YouTrack API wrapper
- gitea_client.py: Gitea API + git CLI operations
- woodpecker_client.py: CI build monitoring
- webhook_server.py: Real-time event handling
- prompts/: Agent prompt templates (developer, qa, librarian)

Workflow: Ready → In Progress → Build → Verify → Document → Review → Done

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 21:05:31 -07:00