Metadata-Version: 2.4
Name: fastpluggy-ecosystem-status
Version: 0.1.10
Summary: Ecosystem project tracking dashboard for FastPluggy
Author: FastPluggy Team
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: fastpluggy>=0.4.5
Requires-Dist: fastpluggy-claude-monitor>=0.1.0
Requires-Dist: click>=8.0
Requires-Dist: GitPython>=3.1.43
Requires-Dist: loguru
Requires-Dist: markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Provides-Extra: tests
Requires-Dist: pytest>=7.0; extra == "tests"
Requires-Dist: pytest-cov>=4.0; extra == "tests"
Requires-Dist: pytest-asyncio>=0.21; extra == "tests"
Provides-Extra: e2e
Requires-Dist: fastpluggy-cli; extra == "e2e"

# ecosystem_status

![Ecosystem Status](https://img.shields.io/badge/FastPluggy-Ecosystem%20Status-purple)
[![Release](https://gitlab.ggcorp.fr/open/fastpluggy/private_plugins/ecosystem_status/-/badges/release.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/private_plugins/ecosystem_status/-/releases)
[![Pipeline Status](https://gitlab.ggcorp.fr/open/fastpluggy/private_plugins/ecosystem_status/badges/main/pipeline.svg?key_text=CI)](https://gitlab.ggcorp.fr/open/fastpluggy/private_plugins/ecosystem_status/-/pipelines?ignore_skipped=true)
[![Coverage](https://gitlab.ggcorp.fr/open/fastpluggy/private_plugins/ecosystem_status/badges/main/coverage.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/private_plugins/ecosystem_status/-/pipelines)

Ecosystem project tracking dashboard for FastPluggy. Surfaces reports, plans, backlog, repository status, and Claude Code CLI integration through a web UI.

## Features

- **Dashboard** — Summary cards (backlog counts, compliance score, stale plans, plans ready) with links to detailed reports
- **Reports** — View generated markdown reports (backlog stats, compliance matrix, repo status, etc.) rendered as HTML
- **Plans browser** — List all plans with progress tracking, phase breakdowns, and "Implement" button
- **Backlog viewer** — Filterable table of backlog items by priority
- **Repository status** — Git status for all ecosystem repos with real-time pull progress (background task via tasks_worker, per-repo polling)
- **Active Implementations** — Real-time tracking of which plans are being implemented: links running Claude sessions to plan files, shows progress bars, session info (model, turns), and git context (branch, MR). Accessible via the Sessions/Implementations tabs.
- **Command textbox** — Execute Claude Code CLI commands (`/plan`, `/implement`, `/status`, etc.) with real-time output
- **Review & Commit** — Diff preview of wip-ia-code/ changes with commit functionality
- **Deploy Targets** — Configure remote Docker Swarm or Compose hosts with SSH connectivity testing
- **Deploy Wizard** — Build and deploy FastPluggy apps with selected plugins via a 4-step wizard (select plugins → configure → target → deploy)
- **Deployed Apps** — Monitor, update, and remove deployed apps with real-time service status and logs

## Installation

```bash
pip install fastpluggy-ecosystem-status
```

Or for development:
```bash
cd plugins/ecosystem_status
uv venv .venv --python 3.13
uv pip install -e ".[dev]" --python .venv/bin/python
```

## Configuration

| Variable | Default | Description |
|----------|---------|-------------|
| `ECOSYSTEM_ROOT` | `~/PycharmProjects/fp-ecosystem` | Path to the fp-ecosystem root |
| `ECOSYSTEM_GENERATED_DIR` | `{ECOSYSTEM_ROOT}/wip-ia-code/generated` | Generated reports directory |
| `CLAUDE_CLI_PATH` | `claude` | Path to the Claude Code CLI binary |
| `CLAUDE_CLI_CWD` | `{ECOSYSTEM_ROOT}` | Working directory for CLI commands |
| `DEPLOY_TARGETS` | `[]` | JSON array of deploy targets (bootstrap config) |
| `AUTO_FIX_ENABLED` | `false` | Enable scheduled auto-fix CI (detects and fixes failing jobs) |
| `AUTO_FIX_INTERVAL_HOURS` | `6` | Hours between auto-fix dispatch cycles |
| `AUTO_FIX_COOLDOWN_HOURS` | `12` | Hours to wait before re-attempting a repo |
| `AUTO_FIX_SKIP_REPOS` | _(empty)_ | Comma-separated repos to exclude from auto-fix |

## Deployer Setup

The deployer lets you build and deploy FastPluggy apps to remote Docker hosts.

### Plugin Manifests

Plugins can declare infrastructure needs via a `deploy.json` file in their root:

```json
{
  "services": {
    "postgres": {
      "image": "postgres:14-alpine",
      "required": true,
      "env": {"POSTGRES_USER": "fastpluggy", "POSTGRES_DB": "fp_app"},
      "volumes": ["/var/lib/postgresql/data"]
    }
  },
  "env": {
    "DATABASE_URL": {
      "template": "postgresql://{postgres.user}:{postgres.password}@{stack}_db:5432/{postgres.db}",
      "from_service": "postgres"
    }
  },
  "notes": "Requires PostgreSQL for storage"
}
```

When multiple plugins need the same service (e.g. postgres), the deployer merges them into a single shared instance.

### SSH Key Configuration

Deploy targets require file-based SSH keys (no passwords). Configure via the Deploy Targets page or the `DEPLOY_TARGETS` environment variable:

```json
[{"name": "prod", "host": "deploy.example.com", "ssh_user": "deploy", "ssh_key_path": "~/.ssh/id_ed25519"}]
```

Set `compose_mode: true` for Docker Compose targets (local testing) or leave `false` for Docker Swarm.

## Routes

| Route | Description |
|-------|-------------|
| `/` | Dashboard with summary cards |
| `/plans` | Plans list with progress tracking |
| `/plans/{slug}` | Plan detail with phase progress |
| `/backlog` | Backlog table with priority filters |
| `/repos` | Repository git status and pull actions |
| `/command` | Claude Code CLI command execution |
| `/review` | Diff preview and commit interface |
| `/reports/{name}` | Individual report viewer |
| `/deploy/targets` | Manage deployment targets |
| `/deploy` | Deployment wizard |
| `/deploy/apps` | Deployed apps management |

## API Endpoints

| Method | Path | Description |
|--------|------|-------------|
| GET | `/api/health` | Health check |
| POST | `/api/reports/refresh` | Regenerate all reports |
| GET | `/api/repos` | All repo statuses (JSON) |
| POST | `/api/repos/{name}/pull` | Pull a single repo |
| GET | `/api/commands` | List allowed CLI commands |
| POST | `/api/command/run` | Execute a CLI command |
| GET | `/api/command/{task_id}/stream` | SSE stream of command output |
| GET | `/api/command/history` | Recent command history |
| GET | `/api/git/wip-changes` | Changed files in wip-ia-code/ |
| GET | `/api/git/diff` | Diff preview |
| POST | `/api/git/commit` | Commit wip-ia-code/ changes |
| GET | `/api/deploy/targets` | List deploy targets |
| POST | `/api/deploy/targets` | Add a deploy target |
| DELETE | `/api/deploy/targets/{name}` | Remove a deploy target |
| POST | `/api/deploy/targets/{name}/test` | Test SSH connectivity |
| POST | `/api/deploy/preview` | Preview generated stack files |
| POST | `/api/deploy/execute` | Trigger deployment |
| GET | `/api/deploy/{task_id}/status` | Deployment progress |
| GET | `/api/deploy/history` | Recent deployments |
| GET | `/api/deploy/apps` | List deployed apps |
| GET | `/api/deploy/apps/{name}/status` | App service status |
| GET | `/api/deploy/apps/{name}/logs` | App logs |
| POST | `/api/deploy/apps/{name}/update` | Force-update app |
| DELETE | `/api/deploy/apps/{name}` | Remove deployed app |
| GET | `/api/auto-fix/status` | Auto-fix CI status and recent attempts |
| POST | `/api/auto-fix/pause` | Set/clear auto-fix CI pause flag |
| POST | `/api/auto-fix/trigger` | Manually trigger an auto-fix CI cycle |

## Worker topics

The plugin uses dedicated tasks_worker topics for background AI tasks. Each topic runs with `capacity=1` to serialize Claude sessions.

| Topic | Task | Trigger |
|-------|------|---------|
| `auto-implement` | `implement_plan_task` — runs `/implement` on eligible plans | Scheduled (every ~3h) |
| `fix-ci` | `fix_ci_task` — runs `/ci-debug` on failing CI jobs | Scheduled (every ~6h) |
| (default) | `pull_all_repos` — pulls all repos with per-repo progress | UI button ("Pull All") |

Start a worker that handles both topics:

```bash
fastpluggy tasks-worker start --topics auto-implement,fix-ci --beat
```

Or run them on separate workers:

```bash
# Terminal 1: auto-implement only (with scheduler)
fastpluggy tasks-worker start --topics auto-implement --beat

# Terminal 2: fix-ci only
fastpluggy tasks-worker start --topics fix-ci
```

The `--beat` flag starts the task scheduler. Only one worker needs `--beat` to avoid duplicate triggers.

## Development

```bash
# Run tests
.venv/bin/python -m pytest tests/

# Run dev server
fastpluggy start-dev-server --port 8099

# Run e2e tests
cd e2e && npx playwright test
```

## Dependencies

- `FastPluggy>=0.4.5`
- `GitPython>=3.1.43` (optional — graceful degradation if not installed)
- `loguru`
- `markdown`
- `jinja2`
