Skip to content

Integrate Symphony dev branch#4

Open
omar-elamin wants to merge 8 commits into
mainfrom
dev
Open

Integrate Symphony dev branch#4
omar-elamin wants to merge 8 commits into
mainfrom
dev

Conversation

@omar-elamin

@omar-elamin omar-elamin commented Apr 30, 2026

Copy link
Copy Markdown
Member

Summary

Integrates the two open Symphony branches into one dev branch for review against main:

  • Elixir runtime parity rewrite from codex/elixir-runtime-parity
  • Self-heal/watchdog follow-up from codex/self-heal/20260430T131157-symphony-api-is-unreachable-on-port-8765-error-socket_closed_rem

This leaves dev as the single integration PR path into main.

Validation

  • mix format --check-formatted
  • mix test - 98 tests, 0 failures
  • mix escript.build

Summary by CodeRabbit

Release Notes

  • New Features

    • Complete rewrite in Elixir with improved performance and reliability.
    • Self-healing watchdog system that automatically detects and repairs service issues.
    • Enhanced workflow configuration with rework state tracking and blocked escalation settings.
    • HTTP dashboard for real-time monitoring of automation status.
    • Improved PR review state management and tracking.
  • Documentation

    • Updated installation instructions (mix deps.get + mix escript.build).
    • New comprehensive workflow documentation and configuration guide.
    • Updated run commands to use local binary instead of Python module.

Copilot AI review requested due to automatic review settings April 30, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 44123e39-2eb5-4e33-a399-db5239cbac0a

📥 Commits

Reviewing files that changed from the base of the PR and between 0976b11 and 73f0d9b.

⛔ Files ignored due to path filters (1)
  • mix.lock is excluded by !**/*.lock
📒 Files selected for processing (73)
  • .formatter.exs
  • .gitignore
  • README.md
  • WORKFLOW.linear-mcp.example.md
  • WORKFLOW.md
  • docs/IMPLEMENTATION.md
  • launchd/com.caretta.symphony.local.plist
  • launchd/com.caretta.symphony.watchdog.plist
  • launchd/com.symphony.linear-mcp.example.plist
  • lib/symphony.ex
  • lib/symphony/agent_runner.ex
  • lib/symphony/cli.ex
  • lib/symphony/codex_client.ex
  • lib/symphony/coding_context.ex
  • lib/symphony/config.ex
  • lib/symphony/dashboard_summary.ex
  • lib/symphony/error.ex
  • lib/symphony/http_server.ex
  • lib/symphony/logging.ex
  • lib/symphony/models.ex
  • lib/symphony/orchestrator.ex
  • lib/symphony/repo_planner.ex
  • lib/symphony/review.ex
  • lib/symphony/self_heal.ex
  • lib/symphony/templating.ex
  • lib/symphony/tracker.ex
  • lib/symphony/utils.ex
  • lib/symphony/watchdog.ex
  • lib/symphony/workflow.ex
  • lib/symphony/workspace.ex
  • mix.exs
  • pyproject.toml
  • scripts/symphony-managed.sh
  • symphony/__init__.py
  • symphony/__main__.py
  • symphony/agent_runner.py
  • symphony/cli.py
  • symphony/codex_client.py
  • symphony/coding_context.py
  • symphony/config.py
  • symphony/dashboard_summary.py
  • symphony/errors.py
  • symphony/http_server.py
  • symphony/logging.py
  • symphony/models.py
  • symphony/orchestrator.py
  • symphony/repo_planner.py
  • symphony/review.py
  • symphony/templating.py
  • symphony/tracker.py
  • symphony/utils.py
  • symphony/workflow.py
  • symphony/workspace.py
  • test/agent_runner_test.exs
  • test/cli_test.exs
  • test/codex_client_test.exs
  • test/managed_script_test.exs
  • test/orchestrator_test.exs
  • test/repo_planner_http_test.exs
  • test/review_test.exs
  • test/self_heal_test.exs
  • test/test_helper.exs
  • test/tracker_test.exs
  • test/watchdog_test.exs
  • test/workflow_config_template_test.exs
  • test/workspace_test.exs
  • tests/test_agent_runner.py
  • tests/test_codex_client.py
  • tests/test_orchestrator.py
  • tests/test_review.py
  • tests/test_tracker.py
  • tests/test_workflow_config_template.py
  • tests/test_workspace.py
💤 Files with no reviewable changes (21)
  • symphony/init.py
  • pyproject.toml
  • symphony/templating.py
  • symphony/logging.py
  • symphony/main.py
  • symphony/utils.py
  • symphony/repo_planner.py
  • symphony/errors.py
  • symphony/http_server.py
  • symphony/workspace.py
  • symphony/cli.py
  • symphony/review.py
  • symphony/models.py
  • symphony/tracker.py
  • symphony/config.py
  • symphony/coding_context.py
  • symphony/codex_client.py
  • symphony/orchestrator.py
  • symphony/agent_runner.py
  • symphony/dashboard_summary.py
  • symphony/workflow.py

Walkthrough

This PR rewrites Symphony from Python to Elixir. All Python modules are deleted and replaced with equivalent Elixir implementations, along with new build configuration, launchd service definitions, deployment scripts, and comprehensive test coverage. The architecture and workflows remain conceptually unchanged.

Changes

Cohort / File(s) Summary
Build & Project Configuration
mix.exs, .formatter.exs, .gitignore
Establishes Elixir project structure with escript binary target named symphony, configures code formatting rules, and excludes build artifacts and runtime directories.
Service Launch & Systemd Integration
launchd/com.caretta.symphony.local.plist, launchd/com.caretta.symphony.watchdog.plist, launchd/com.symphony.linear-mcp.example.plist, scripts/symphony-managed.sh
Defines macOS launchd jobs for the main service and watchdog polling loops; introduces a shell wrapper script that resolves Symphony binary from multiple fallback locations and dispatches to run, watchdog, restart, or self-heal-once modes.
Documentation & Workflow Configuration
README.md, WORKFLOW.md, WORKFLOW.linear-mcp.example.md, docs/IMPLEMENTATION.md
Updates README from Python to Elixir with revised build/test instructions and self-healing watchdog documentation; introduces formal workflow specifications including tracker state mappings, operational contract, credential handling, and Linear/GitHub integration rules.
Core Orchestration & Issue Processing
lib/symphony/orchestrator.ex, lib/symphony/agent_runner.ex, lib/symphony/codex_client.ex
Implements lifecycle management for issue automation (polling, dispatch, retry scheduling, review reconciliation), end-to-end agent execution with turn loops and prompt augmentation, and external Codex app-server communication via OS ports with JSONL-RPC and dynamic tool handling.
Configuration & State Management
lib/symphony/config.ex, lib/symphony/models.ex, lib/symphony/workflow.ex
Adds complete configuration schema with environment-variable resolution and mtime-based reload semantics, domain model definitions for issues/repos/runtime state with serializers, and workflow markdown parsing including YAML front matter extraction.
Integration Layers
lib/symphony/tracker.ex, lib/symphony/review.ex, lib/symphony/coding_context.ex, lib/symphony/repo_planner.ex
Implements Linear GraphQL and MCP-based issue fetching with normalization, GitHub PR inspection and merge-readiness analysis with dependency traversal, coding-context classification via rules or LLM, and repository-plan generation with fallback strategies.
Utilities & Helpers
lib/symphony/utils.ex, lib/symphony/logging.ex, lib/symphony/templating.ex, lib/symphony/error.ex
Provides datetime formatting/parsing, path safety checks, string truncation and field redaction, structured event logging, prompt templating with variable substitution, and unified exception type with machine-readable codes.
Self-Healing & Watchdog
lib/symphony/self_heal.ex, lib/symphony/watchdog.ex
Implements automatic repair workflow (worktree isolation, patch reapplication, Codex-driven validation/deployment/restart, GitHub PR creation/merge), and periodic state polling that triggers self-heal when service degrades or stalls.
HTTP & Dashboard
lib/symphony/http_server.ex, lib/symphony/dashboard_summary.ex
Adds TCP-based HTTP server with manual request parsing, browser dashboard and JSON API endpoints for state inspection/refresh, and activity-summarization generation via Codex turns.
Entrypoints & Application
lib/symphony.ex, lib/symphony/cli.ex, lib/symphony/workspace.ex
Defines top-level module with version metadata, CLI argument parsing and dispatch (single-run, watchdog, self-heal-once, restart modes), and workspace directory management with multi-repo materialisation and git hook installation.
Python Codebase Removal
symphony/, pyproject.toml, symphony/__init__.py, symphony/__main__.py, symphony/agent_runner.py, symphony/cli.py, symphony/codex_client.py, symphony/coding_context.py, symphony/config.py, symphony/dashboard_summary.py, symphony/errors.py, symphony/http_server.py, symphony/logging.py, symphony/models.py, symphony/orchestrator.py, symphony/repo_planner.py, symphony/review.py, symphony/templating.py, symphony/tracker.py, symphony/utils.py, symphony/workflow.py, symphony/workspace.py
Complete deletion of all Python implementation files and package configuration, replaced entirely by Elixir equivalents.
Test Coverage
test/agent_runner_test.exs, test/cli_test.exs, test/codex_client_test.exs, test/managed_script_test.exs, test/orchestrator_test.exs
Introduces comprehensive ExUnit test suites validating orchestrator dispatch/retry/review logic, agent runner control flow, Codex protocol handling with fake servers, CLI error paths, managed script invocation, and state persistence across restarts.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

This is a complete language migration spanning 20+ modules with heterogeneous logic density. Each Elixir module requires fresh reasoning around concurrency patterns (GenServer, ports, ETS), configuration management, error handling strategy, and state persistence semantics. The orchestrator alone (~2800 lines) and codex-client (~640 lines) contain intricate protocol handling and stateful lifecycle management. Whilst many modules follow a straightforward translation from Python, the interaction patterns differ substantially—particularly around port-based IPC, pattern matching, and supervisor tree initialization. The test suite validates end-to-end scenarios with Python fake servers, introducing additional cross-language coordination to verify. No single refactor pattern applies uniformly; each module demands independent verification of correctness.

Possibly related PRs

  • Rewrite README for clarity #1: Both PRs substantially modify README.md with overlapping documentation changes for workflow configuration, self-healing behaviour, and build instructions.

Suggested reviewers

  • pmarkesinis

Poem

From Python's loops to Elixir's light,
Pattern matching sets things right,
Ports and processes, GenServers run,
The migration's done—one symphony begun. 🎼

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title refers to a genuine aspect of the changeset—consolidating dev branches—but substantially understates the scope, which involves a complete rewrite from Python to Elixir across 20+ files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants