Skip to content

Commit 9b4dfa1

Browse files
committed
chore: snapshot current WIP before consolidation
2 parents 66bd803 + 23b4cbe commit 9b4dfa1

221 files changed

Lines changed: 25751 additions & 2136 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/app-manifest.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# GitHub App Manifest for CodeFlow Engine
2+
# This manifest defines the GitHub App configuration for automatic setup
3+
# See: https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest
4+
#
5+
# NOTE: Before creating your GitHub App, replace 'your-app.azurewebsites.net'
6+
# with your actual deployment URL in the webhook and callback URLs below.
7+
8+
name: CodeFlow Engine Setup
9+
url: https://github.com/JustAGhosT/codeflow-engine
10+
hook_attributes:
11+
url: https://your-app.azurewebsites.net/api/github-app/webhook
12+
active: true
13+
redirect_url: https://your-app.azurewebsites.net/api/github-app/callback
14+
description: Automated setup for CodeFlow Engine - GitHub Workflow Automation
15+
public: false
16+
17+
default_permissions:
18+
# Repository permissions
19+
actions: write
20+
contents: read
21+
metadata: read
22+
secrets: write
23+
workflows: write
24+
25+
default_events:
26+
- installation
27+
- installation_repositories
28+
- workflow_run
29+
- push
30+
- pull_request

.github/workflows/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ The monorepo uses a combination of engine-specific workflows, path-aware compone
1919
| `release-website.yml` | Website release build | Tags, manual |
2020
| `release-vscode-extension.yml` | VS Code extension release packaging | Tags, manual |
2121
| `release-orchestration-utils.yml` | Shared utility package release build | Tags, manual |
22+
| `deploy-autopr-engine.yml` | Engine container build and Azure deployment | Push to `master`, PR, manual |
2223

2324
## Workflow Details
2425

2526
### Key conventions
2627

2728
- Engine workflows run from [engine](engine) via `working-directory`.
2829
- Component workflows use path filters so unrelated changes do not trigger full builds.
29-
- Release workflows use component-specific tag prefixes such as `engine-v1.2.3` and `desktop-v1.2.3`.
30+
- Release workflows use component-specific tag prefixes such as `engine-v0.2.0-alpha.1` and `desktop-v0.2.0-alpha.1`.
3031
- Infrastructure for the website and engine is sourced from [orchestration](orchestration).
32+
- The engine deployment workflow still uses the filename [deploy-autopr-engine.yml](.github/workflows/deploy-autopr-engine.yml) for backward compatibility, but it deploys the current CodeFlow Engine.
3133

3234
### Archival follow-up
3335

@@ -40,7 +42,7 @@ Before archiving the legacy repositories, update their README files with the red
4042
- `Quality Feedback` runs (detailed feedback)
4143
- `CI` runs (comprehensive checks)
4244

43-
2. **Push to Main/Develop:**
45+
2. **Push to master:**
4446
- `CI` runs with full volume settings
4547

4648
3. **Manual/Scheduled:**

.github/workflows/deploy-autopr-engine.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Deploy CodeFlow Engine
1+
name: Build and Deploy CodeFlow Engine
22

33
on:
44
push:
@@ -36,16 +36,16 @@ jobs:
3636
run: |
3737
echo "Validating GitHub App manifest..."
3838
python3 -c "import yaml; yaml.safe_load(open('.github/app-manifest.yml'))"
39-
echo "✅ app-manifest.yml is valid YAML"
39+
echo "[OK] app-manifest.yml is valid YAML"
4040
4141
- name: Validate .codeflow.yml config
4242
run: |
4343
if [ -f ".codeflow.yml" ]; then
4444
echo "Validating .codeflow.yml..."
4545
python3 -c "import yaml; yaml.safe_load(open('.codeflow.yml'))"
46-
echo "✅ .codeflow.yml is valid YAML"
46+
echo "[OK] .codeflow.yml is valid YAML"
4747
else
48-
echo "⚠️ .codeflow.yml not found (optional)"
48+
echo "[!] .codeflow.yml not found (optional)"
4949
fi
5050
5151
- name: Set up Docker Buildx
@@ -64,7 +64,7 @@ jobs:
6464
RUN_TESTS=false
6565
6666
- name: Validate build
67-
run: echo "✅ Docker image built successfully for PR validation"
67+
run: echo "[OK] Docker image built successfully for PR validation"
6868

6969
build-and-push:
7070
name: Build and Push Container Image
@@ -190,7 +190,7 @@ jobs:
190190
ENV_NAME="prod-codeflow-san-env"
191191
CUSTOM_DOMAIN="app.codeflow.io"
192192
193-
echo "🔍 Checking for existing managed certificates for domain: $CUSTOM_DOMAIN"
193+
echo "[*] Checking for existing managed certificates for domain: $CUSTOM_DOMAIN"
194194
195195
# Check if environment exists
196196
if az containerapp env show -n $ENV_NAME -g $RESOURCE_GROUP &>/dev/null; then
@@ -207,10 +207,10 @@ jobs:
207207
'.[] | select(.properties.subjectName == $domain and .type == "Microsoft.App/managedEnvironments/managedCertificates") | .name')
208208
209209
if [ -n "$DUPLICATE_CERTS" ]; then
210-
echo "⚠️ Found duplicate managed certificate(s) for domain $CUSTOM_DOMAIN:"
210+
echo "[!] Found duplicate managed certificate(s) for domain $CUSTOM_DOMAIN:"
211211
echo "$DUPLICATE_CERTS"
212212
echo ""
213-
echo "🗑️ Removing duplicate certificates to prevent deployment conflicts..."
213+
echo "[*] Removing duplicate certificates to prevent deployment conflicts..."
214214
215215
while IFS= read -r cert_name; do
216216
if [ -n "$cert_name" ]; then
@@ -219,23 +219,23 @@ jobs:
219219
--name $ENV_NAME \
220220
--resource-group $RESOURCE_GROUP \
221221
--certificate "$cert_name" \
222-
--yes || echo "⚠️ Failed to delete certificate $cert_name (may not exist or be in use)"
222+
--yes || echo "[!] Failed to delete certificate $cert_name (may not exist or be in use)"
223223
fi
224224
done <<< "$DUPLICATE_CERTS"
225225
226-
echo "✅ Cleanup completed"
226+
echo "[OK] Cleanup completed"
227227
else
228-
echo "✅ No duplicate certificates found for $CUSTOM_DOMAIN"
228+
echo "[OK] No duplicate certificates found for $CUSTOM_DOMAIN"
229229
fi
230230
else
231-
echo "ℹ️ Environment does not exist yet, skipping certificate cleanup"
231+
echo "[i] Environment does not exist yet, skipping certificate cleanup"
232232
fi
233233
echo ""
234234
235235
- name: Deploy Bicep Template
236236
run: |
237-
echo "ℹ️ Note: SSL certificates are automatically managed by Azure. No certificate upload needed!"
238-
echo "📖 See orchestration/infrastructure/bicep/FAQ.md for certificate details"
237+
echo "[i] Note: SSL certificates are automatically managed by Azure. No certificate upload needed!"
238+
echo "[*] See orchestration/infrastructure/bicep/FAQ.md for certificate details"
239239
echo ""
240240
az deployment group create \
241241
--name codeflow-engine \
@@ -267,18 +267,18 @@ jobs:
267267
268268
- name: Display deployment info
269269
run: |
270-
echo "✅ Deployment successful!"
270+
echo "[OK] Deployment successful!"
271271
echo "Container App URL: ${{ steps.outputs.outputs.container_app_url }}"
272272
echo "Custom Domain: ${{ steps.outputs.outputs.custom_domain }}"
273273
echo "PostgreSQL FQDN: ${{ steps.outputs.outputs.postgres_fqdn }}"
274274
echo "Redis Host: ${{ steps.outputs.outputs.redis_host }}"
275275
echo ""
276-
echo "🔒 SSL Certificate: Automatically managed by Azure (no action needed)"
276+
echo "[*] SSL Certificate: Automatically managed by Azure (no action needed)"
277277
echo ""
278-
echo "⚠️ Next steps:"
278+
echo "[!] Next steps:"
279279
echo "1. Add DNS CNAME record: ${{ steps.outputs.outputs.custom_domain }} -> Container App FQDN"
280280
echo "2. Wait for DNS propagation (typically 15-30 minutes)"
281281
echo "3. Azure will automatically provision and bind the SSL certificate (5-15 minutes)"
282282
echo ""
283-
echo "📖 For troubleshooting, see: infrastructure/bicep/FAQ.md"
283+
echo "[*] For troubleshooting, see: infrastructure/bicep/FAQ.md"
284284
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
"""
2+
CodeFlow Engine - AI Actions
3+
4+
Actions for AI/LLM-powered features including AutoGen, memory systems, and summarization.
5+
"""
6+
7+
from typing import Any
8+
9+
# Import with error handling for optional dependencies
10+
AutoGenImplementation: type[Any] | None = None
11+
try:
12+
from codeflow_engine.actions.ai_actions.autogen_implementation import AutoGenImplementation
13+
except ImportError:
14+
pass
15+
16+
AutoGenAgentSystem: type[Any] | None = None
17+
try:
18+
from codeflow_engine.actions.ai_actions.autogen_multi_agent import AutoGenAgentSystem
19+
except ImportError:
20+
pass
21+
22+
Mem0MemoryManager: type[Any] | None = None
23+
try:
24+
from codeflow_engine.actions.ai_actions.mem0_memory_integration import Mem0MemoryManager
25+
except ImportError:
26+
pass
27+
28+
LearningMemorySystem: type[Any] | None = None
29+
try:
30+
from codeflow_engine.actions.ai_actions.learning_memory_system import LearningMemorySystem
31+
except ImportError:
32+
pass
33+
34+
ConfigurableLLMProvider: type[Any] | None = None
35+
try:
36+
from codeflow_engine.actions.ai_actions.configurable_llm_provider import ConfigurableLLMProvider
37+
except ImportError:
38+
pass
39+
40+
# Submodule exports with guarded imports
41+
autogen = None
42+
try:
43+
from codeflow_engine.actions.ai_actions import autogen
44+
except (ImportError, OSError):
45+
pass
46+
47+
llm = None
48+
try:
49+
from codeflow_engine.actions.ai_actions import llm
50+
except (ImportError, OSError):
51+
pass
52+
53+
__all__ = [
54+
"AutoGenAgentSystem",
55+
"AutoGenImplementation",
56+
"ConfigurableLLMProvider",
57+
"LearningMemorySystem",
58+
"Mem0MemoryManager",
59+
"autogen",
60+
"llm",
61+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
AutoGen Actions Module
3+
4+
Multi-agent collaboration and automation using AutoGen.
5+
"""
6+
7+
from .agents import AutoGenAgentFactory
8+
from .models import AutoGenInputs, AutoGenOutputs
9+
from .system import AutoGenAgentSystem
10+
11+
__all__ = [
12+
"AutoGenInputs",
13+
"AutoGenOutputs",
14+
"AutoGenAgentFactory",
15+
"AutoGenAgentSystem"
16+
]
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
"""
2+
AutoGen Agents
3+
4+
Specialized agents for different tasks in the AutoGen system.
5+
"""
6+
7+
from typing import Any, Dict, List, Optional
8+
9+
try:
10+
from autogen import ConversableAgent # type: ignore
11+
AUTOGEN_AVAILABLE = True
12+
except ImportError:
13+
AUTOGEN_AVAILABLE = False
14+
# Create dummy class for type annotations
15+
class ConversableAgentDummy:
16+
def __init__(self, *args: Any, **kwargs: Any) -> None: pass
17+
def initiate_chat(self, *args: Any, **kwargs: Any) -> List[Dict[str, Any]]:
18+
return []
19+
20+
ConversableAgent = ConversableAgentDummy
21+
22+
23+
class AutoGenAgentFactory:
24+
"""Factory for creating specialized AutoGen agents."""
25+
26+
@staticmethod
27+
def create_code_analyzer(llm_config: Dict[str, Any]) -> ConversableAgent:
28+
"""Create a code analyzer agent."""
29+
if not AUTOGEN_AVAILABLE:
30+
raise ImportError("AutoGen not installed. Install with: pip install pyautogen")
31+
32+
return ConversableAgent(
33+
name="code_analyzer",
34+
system_message="""You are a senior code analyzer. Your role is to:
35+
1. Analyze code comments and identify the specific issue or request
36+
2. Understand the context and scope of the problem
37+
3. Classify the type of fix needed (syntax, logic, style, security, performance)
38+
4. Provide detailed analysis with confidence scores
39+
40+
Always provide structured analysis with clear reasoning.""",
41+
llm_config=llm_config,
42+
human_input_mode="NEVER",
43+
)
44+
45+
@staticmethod
46+
def create_code_fixer(llm_config: Dict[str, Any]) -> ConversableAgent:
47+
"""Create a code fixer agent."""
48+
if not AUTOGEN_AVAILABLE:
49+
raise ImportError("AutoGen not installed. Install with: pip install pyautogen")
50+
51+
return ConversableAgent(
52+
name="code_fixer",
53+
system_message="""You are an expert code fixer. Your role is to:
54+
1. Take analysis from the code analyzer
55+
2. Generate precise, minimal code fixes
56+
3. Ensure fixes follow best practices and project conventions
57+
4. Provide multiple solution options when appropriate""",
58+
llm_config=llm_config,
59+
human_input_mode="NEVER",
60+
)
61+
62+
@staticmethod
63+
def create_security_auditor(llm_config: Dict[str, Any]) -> ConversableAgent:
64+
"""Create a security auditor agent."""
65+
if not AUTOGEN_AVAILABLE:
66+
raise ImportError("AutoGen not installed. Install with: pip install pyautogen")
67+
68+
return ConversableAgent(
69+
name="security_auditor",
70+
system_message="""You are a security expert. Your role is to:
71+
1. Identify potential security vulnerabilities
72+
2. Assess code for security best practices
73+
3. Provide security-focused recommendations
74+
4. Ensure compliance with security standards""",
75+
llm_config=llm_config,
76+
human_input_mode="NEVER",
77+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
AutoGen Models
3+
4+
Data models for AutoGen multi-agent integration.
5+
"""
6+
7+
from typing import Any, Dict, List, Optional
8+
9+
from pydantic import BaseModel, Field
10+
11+
12+
class AutoGenInputs(BaseModel):
13+
"""Inputs for AutoGen multi-agent processing."""
14+
comment_body: str
15+
file_path: Optional[str] = None
16+
file_content: Optional[str] = None
17+
pr_context: Dict[str, Any] = Field(default_factory=dict)
18+
task_type: str = (
19+
"analyze_and_fix" # "analyzeAnd_fix", "code_review", "security_audit"
20+
)
21+
agents_config: Dict[str, Any] = Field(default_factory=dict)
22+
23+
24+
class AutoGenOutputs(BaseModel):
25+
"""Outputs from AutoGen multi-agent processing."""
26+
success: bool
27+
analysis: Dict[str, Any] = Field(default_factory=dict)
28+
recommendations: List[str] = Field(default_factory=list)
29+
fix_code: Optional[str] = None
30+
agent_conversations: List[Dict[str, str]] = Field(default_factory=list)
31+
consensus: Optional[str] = None
32+
error_message: Optional[str] = None

0 commit comments

Comments
 (0)