The import statement was incorrectly placed inside a function body, which is invalid Python syntax. Moved to module-level imports. Also updated requirements to include difflib (part of stdlib, no pip install needed). Refs: #11
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
"""
|
|
title: Gitea Coder - Workflow Role with Scope Enforcement
|
|
author: Jeff Smith + Claude + minimax
|
|
version: 1.0.1
|
|
license: MIT
|
|
description: High-level workflow role for LLM-based code generation with scope gating and quality gates
|
|
requirements: pydantic, httpx
|
|
changelog:
|
|
1.0.1:
|
|
- Fixed: moved difflib import to module level (was incorrectly inside function)
|
|
- difflib is Python stdlib, no pip install required
|
|
1.0.0:
|
|
- Initial implementation of gitea_coder role
|
|
- Branch creation with scope gating (prevents main pushes)
|
|
- Enforces branch naming conventions (feature/, fix/, refactor/, etc.)
|
|
- Generates detailed commit messages with ticket references
|
|
- Creates PRs from branches
|
|
- Reads ticket requirements from issues
|
|
- Unified file operations workflow
|
|
- Added diff-based updates with apply_diff()
|
|
- Added size delta gating in commit_changes() for quality control
|
|
"""
|
|
|
|
from typing import Optional, Callable, Any, Dict, List, Tuple
|
|
from pydantic import BaseModel, Field
|
|
import re
|
|
import time
|
|
import base64
|
|
import difflib
|
|
import httpx
|