Skip to content

feat: scripts + docker-compose for local demo stack - #5

Merged
ADITYA-tp01 merged 15 commits into
mainfrom
feat/scripts-docker
Aug 29, 2026
Merged

feat: scripts + docker-compose for local demo stack#5
ADITYA-tp01 merged 15 commits into
mainfrom
feat/scripts-docker

Conversation

@ADITYA-tp01

@ADITYA-tp01 ADITYA-tp01 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

User description

What

Operational scripts and Docker Compose to run the full MissionControl demo stack with one command.

Components

  • setup.sh / setup.ps1 — cross-platform installers (Docker Compose + npm + guided TrueForge steps)
  • start-all.ps1 — idempotent one-command startup: detects WSL/gateway IPs, starts LiteLLM bridge + TrueForge, re-registers MCP URL inside TrueForge via REST API, rewrites dashboard .env.local, health checks, prints URLs
  • stop-all.ps1 — port-based process cleanup + WSL pkill
  • trigger_incident.py — stdlib CLI chaos injector for CI/automation
  • docker-compose.yml — postgres + redis (TrueForge hosted mode) + demo-infra-mcp with healthchecks; DEMO_INFRA_HOST=0.0.0.0 so containerized sidecar is reachable

Design notes

  • Scripts are idempotent and detect environment (WSL gateway IP) so they work after reboot
  • start-all.ps1 re-registers the MCP server inside TrueForge via TrueForge's REST API (no manual UI steps)
  • DEMO_INFRA_HOST=0.0.0.0 in compose ensures the REST sidecar binds 0.0.0.0 for port mapping; locally it defaults to 127.0.0.1

Next chunks

  • Dashboard lib/components/API routes
  • Dashboard pages + polish
  • README + demo video

CodeAnt-AI Description

Add a local MissionControl demo that visualizes service health, injects simulated failures, and guides operators through agent-assisted recovery

What Changed

  • Added a live dashboard showing service status, error rates, latency, alerts, logs, deployments, incident timelines, and agent sessions.
  • Added Chaos Lab scenarios for error spikes, latency spikes, outages, and cascading failures, with projected impact and hold-to-confirm injection.
  • Added incident consoles with live metric polling, log history, agent chat, investigation triggers, deployment history, and approval-gated rollback controls.
  • Added simulated infrastructure APIs and MCP tools for alert acknowledgement, chaos injection, service restarts, rollbacks, recovery, reset, and session tracking.
  • Added Docker Compose and setup/start/stop scripts for launching the demo stack across local environments, including WSL and legacy Compose support.
  • Added validation and regression tests covering recovery, cascading failures, reset behavior, invalid chaos requests, authentication, and request limits.
  • Invalid chaos requests no longer clear an active incident, and remediation restores all services affected by a cascading failure.

Impact

✅ Faster local incident-response demos
✅ Safer rollback and restart approvals
✅ Clearer service failures and recovery progress
✅ Reliable recovery after cascading failures

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai

codeant-ai Bot commented Aug 27, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed 8aabb1d Aug 29, 2026 · 20:53 20:54
✅ Incremental review completed 8859a7e Aug 29, 2026 · 19:09 19:09
✅ Incremental review completed e165792 Aug 27, 2026 · 20:04 20:04
✅ Incremental review completed 5396f7d Aug 27, 2026 · 18:55 18:56
✅ Reviewed your PR 65ce470 Aug 27, 2026 · 17:48 17:51

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 27, 2026
@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add local demo stack orchestration scripts and Docker Compose

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Adds Docker Compose services for persistent Postgres, Redis, and the demo MCP server.
• Provides cross-platform setup plus idempotent Windows/WSL startup and shutdown orchestration.
• Adds a dependency-free CLI for chaos injection and agent webhook triggering.
Diagram

graph TD
  ORCH["Orchestration scripts"] --> COMPOSE["Docker Compose"] --> STORES[("Postgres + Redis")]
  ORCH --> TF["TrueForge"] --> LLM["LiteLLM"]
  ORCH --> MCP["Demo MCP"]
  ORCH --> DASH["Dashboard"]
  COMPOSE --> MCP
  DASH --> MCP
  DASH --> TF
  TF --> MCP
  CLI["Incident CLI"] --> MCP
  CLI --> DASH
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Full-stack Docker Compose profiles
  • ➕ Removes hard-coded WSL user paths and host process management.
  • ➕ Provides one reproducible lifecycle across supported operating systems.
  • ➕ Centralizes health checks, networking, logs, and shutdown behavior.
  • ➖ Requires container-compatible TrueForge and LiteLLM configuration.
  • ➖ May complicate access to host credentials, models, or WSL-specific tooling.
2. Config-driven task runner
  • ➕ Keeps host-native services while sharing commands and parameters across platforms.
  • ➕ Makes paths, ports, retries, and endpoints configurable instead of machine-specific.
  • ➖ Adds a task-runner dependency or another configuration layer.
  • ➖ Still requires platform-specific process and networking adapters.

Recommendation: Keep Compose for infrastructure and the lightweight setup scripts, but replace machine-specific startup assumptions with configuration immediately. If TrueForge and LiteLLM can run reliably in containers, a full-stack Compose profile is the strongest long-term option because it better matches the one-command, cross-platform goal.

Files changed (6) +405 / -0

Enhancement (3) +226 / -0
setup.ps1Add guided Windows setup workflow +85/-0

Add guided Windows setup workflow

• Checks Docker, Compose, Node, and Python prerequisites; creates the root environment file; starts containerized infrastructure; installs dashboard packages; and launches the dashboard. It then prints the manual TrueForge configuration steps and local service URLs.

scripts/setup.ps1

setup.shAdd guided Linux and macOS setup workflow +75/-0

Add guided Linux and macOS setup workflow

• Provides the shell equivalent of Windows setup, including prerequisite checks, environment initialization, Compose startup, MCP health verification, dashboard installation, and background launch. It concludes with TrueForge onboarding instructions and endpoint details.

scripts/setup.sh

trigger_incident.pyAdd automation-friendly incident trigger CLI +66/-0

Add automation-friendly incident trigger CLI

• Posts a selected chaos scenario to the demo infrastructure API, then optionally notifies the dashboard webhook to initiate agent investigation. The utility uses only Python's standard library and treats dashboard unavailability as non-fatal after successful injection.

scripts/trigger_incident.py

Other (3) +179 / -0
docker-compose.ymlProvision persistent data services and the demo MCP container +0/-0

Provision persistent data services and the demo MCP container

• Defines health-checked Postgres, Redis, and demo-infra MCP services with persistent volumes. The MCP REST sidecar binds to all interfaces and publishes ports 8000 and 8001 for host access.

docker-compose.yml

start-all.ps1Orchestrate idempotent Windows and WSL demo startup +153/-0

Orchestrate idempotent Windows and WSL demo startup

• Detects current WSL and gateway addresses, starts or verifies LiteLLM, TrueForge, the MCP server, and the dashboard, and reports aggregate health. It also repairs TrueForge MCP registration and dashboard environment URLs when reboot-driven WSL addresses change.

scripts/start-all.ps1

stop-all.ps1Stop host and WSL demo processes safely +26/-0

Stop host and WSL demo processes safely

• Finds Python and Node listeners on the dashboard and MCP ports before terminating them. It also stops the TrueForge and LiteLLM processes in WSL without shutting down the WSL VM.

scripts/stop-all.ps1

@qodo-code-review

qodo-code-review Bot commented Aug 27, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Startup uses personal WSL paths ✓ Resolved 🐞 Bug ≡ Correctness
Description
The one-command launcher executes /home/aditya/tf-litellm.sh and /home/aditya/tf-run.sh, neither
of which is supplied by this repository, so LiteLLM and TrueForge fail for every clean checkout and
for WSL users without that exact home setup.
Code

scripts/start-all.ps1[38]

+    wsl -e bash -lc "setsid -f -- /home/aditya/tf-litellm.sh </dev/null > /home/aditya/litellm.log 2>&1"
Evidence
Both launch commands hard-code /home/aditya and reference files absent from the repository, while
the setup instructions document npx @truefoundry/trueforge as the available TrueForge startup
command.

scripts/start-all.ps1[33-43]
scripts/start-all.ps1[46-57]
scripts/setup.ps1[65-75]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Startup depends on scripts and log paths from one developer's WSL home directory.

## Issue Context
Resolve the WSL home dynamically and ship the startup scripts, or invoke documented tools such as TrueForge directly from repository-controlled commands.

## Fix Focus Areas
- scripts/start-all.ps1[38-43]
- scripts/start-all.ps1[50-57]
- scripts/setup.ps1[65-75]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Dashboard package is absent ✗ Dismissed 🐞 Bug ≡ Correctness
Description
Both setup scripts run npm install and npm run dev under apps/dashboard, but that tree has no
package.json or application code, so setup exits during dependency installation and no dashboard
can listen on port 3001.
Code

scripts/setup.sh[R43-44]

+echo "[4/6] Installing dashboard dependencies..."
+(cd apps/dashboard && npm install)
Evidence
The scripts execute npm from apps/dashboard, but the repository contains only
apps/dashboard/app/.gitkeep and no package manifest defining dependencies or a dev script.

scripts/setup.sh[43-49]
scripts/setup.ps1[51-60]
apps/dashboard/app/.gitkeep[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The setup scripts target an empty dashboard directory, causing npm installation and startup to fail.

## Issue Context
Commit the dashboard package and dev script before invoking it, or remove/defer these setup steps until that component exists.

## Fix Focus Areas
- scripts/setup.sh[43-49]
- scripts/setup.ps1[51-59]
- apps/dashboard/app/.gitkeep[1-1]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Launcher starts missing server ✓ Resolved 🐞 Bug ≡ Correctness
Description
start-all.ps1 launches python server.py from mcp-servers/demo-infra, but no such file exists,
so a fresh all-in-one startup cannot bring up ports 8000/8001 and all subsequent MCP/dashboard
health checks fail.
Code

scripts/start-all.ps1[R89-90]

+    Start-Process python -ArgumentList "server.py" -WindowStyle Hidden `
+        -WorkingDirectory (Join-Path $root "mcp-servers\demo-infra")
Evidence
The launcher requires mcp-servers/demo-infra/server.py, whereas the target directory contains only
.gitkeep; the other setup path instead expects a Compose-built service.

scripts/start-all.ps1[84-95]
mcp-servers/demo-infra/.gitkeep[1-1]
scripts/setup.ps1[40-47]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The all-in-one launcher executes an MCP entry point that is not present in the repository.

## Issue Context
Add the intended server implementation or start the Compose service used by the setup scripts instead.

## Fix Focus Areas
- scripts/start-all.ps1[84-95]
- mcp-servers/demo-infra/.gitkeep[1-1]
- docker-compose.yml[30-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (1)
4. Compose build context is empty ✗ Dismissed 🐞 Bug ≡ Correctness
Description
The demo-infra-mcp service builds mcp-servers/demo-infra/Dockerfile, but that directory contains
only .gitkeep, so both setup scripts fail at docker compose up --build and never start the
advertised MCP service.
Code

docker-compose.yml[R31-33]

+    build:
+      context: ./mcp-servers/demo-infra
+      dockerfile: Dockerfile
Evidence
Compose explicitly selects ./mcp-servers/demo-infra/Dockerfile, while the checked-in target
directory has only its placeholder file; the setup scripts invoke this service with --build.

docker-compose.yml[30-42]
mcp-servers/demo-infra/.gitkeep[1-1]
scripts/setup.sh[36-40]
scripts/setup.ps1[40-47]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Compose service references a Dockerfile and application that are absent, so the demo stack cannot build.

## Issue Context
Add the demo-infra implementation and a Dockerfile matching the configured ports and health endpoint, or change the service to use an existing image/build context.

## Fix Focus Areas
- docker-compose.yml[31-33]
- mcp-servers/demo-infra/.gitkeep[1-1]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

5. npm path is hard-coded ✓ Resolved 🐞 Bug ☼ Reliability
Description
start-all.ps1 launches $env:ProgramFiles\nodejs\npm.cmd even though setup accepts node/npm
from PATH, so valid per-user, nvm, or custom Node installations pass setup but fail during
all-in-one dashboard startup.
Code

scripts/start-all.ps1[R128-129]

+    Start-Process "$env:ProgramFiles\nodejs\npm.cmd" -ArgumentList "run","dev" `
+        -WindowStyle Hidden -WorkingDirectory (Join-Path $root "apps\dashboard")
Evidence
The all-in-one script uses a fixed Program Files path in both launch branches, while the setup
script discovers commands through Get-Command and invokes npm from PATH.

scripts/start-all.ps1[121-129]
scripts/setup.ps1[10-19]
scripts/setup.ps1[51-59]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Dashboard startup assumes npm is installed under the machine-wide Program Files location.

## Issue Context
Resolve npm with `Get-Command` and launch the returned executable, matching setup's PATH-based prerequisite behavior.

## Fix Focus Areas
- scripts/start-all.ps1[121-129]
- scripts/setup.ps1[10-19]
- scripts/setup.ps1[51-59]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Cleanup kills unrelated processes ✓ Resolved 🐞 Bug ☼ Reliability
Description
stop-all.ps1 force-terminates any python or node listener on ports 3001, 8000, or 8001 without
verifying that the process belongs to MissionControl, so it can kill unrelated development services
using those ports.
Code

scripts/stop-all.ps1[R14-16]

+                $p = Get-Process -Id $_ -ErrorAction SilentlyContinue
+                if ($p -and $p.ProcessName -in @("python", "node")) {
+                    Stop-Process -Id $_ -Force -ErrorAction SilentlyContinue
Evidence
The stop loop selects solely by listener port and generic process name before issuing `Stop-Process
-Force`; neither startup script persists a project-owned PID for later verification.

scripts/stop-all.ps1[8-20]
scripts/setup.ps1[57-60]
scripts/start-all.ps1[115-130]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Port- and process-name-only cleanup can terminate unrelated user applications.

## Issue Context
Record PIDs when starting local processes and stop those exact PIDs, or verify executable command lines and project working directories before termination.

## Fix Focus Areas
- scripts/stop-all.ps1[8-20]
- scripts/setup.ps1[57-60]
- scripts/start-all.ps1[84-95]
- scripts/start-all.ps1[115-130]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Browser URL remains stale ✓ Resolved 🐞 Bug ≡ Correctness
Description
The .env.local rewrite is gated only on TRUEFORGE_URL, so when that value is current but
NEXT_PUBLIC_TRUEFORGE_URL is stale or missing, the browser-facing URL is never fixed; missing
variables are also never appended by the replacement loop.
Code

scripts/start-all.ps1[R104-107]

+    if ($envTxt -notmatch [regex]::Escape("TRUEFORGE_URL=http://${wslIp}:3000")) {
+        $envTxt = ($envTxt -split "`n" | ForEach-Object {
+            if ($_ -match "^TRUEFORGE_URL=")            { "TRUEFORGE_URL=http://${wslIp}:3000" }
+            elseif ($_ -match "^NEXT_PUBLIC_TRUEFORGE_URL=") { "NEXT_PUBLIC_TRUEFORGE_URL=http://${wslIp}:3000" }
Evidence
The outer condition checks only TRUEFORGE_URL; inside it, replacement occurs only for lines
already present. The environment template defines NEXT_PUBLIC_TRUEFORGE_URL separately as the
browser-side endpoint.

scripts/start-all.ps1[100-113]
.env.example[7-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Environment rewriting can leave the browser-side TrueForge endpoint stale or absent after the WSL IP changes.

## Issue Context
Check and replace each variable independently, append either variable when missing, and restart the dashboard when either value changes.

## Fix Focus Areas
- scripts/start-all.ps1[100-113]
- .env.example[7-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (1)
8. Legacy Compose invocation breaks ✓ Resolved 🐞 Bug ≡ Correctness
Description
When only standalone docker-compose is available, $compose has one element, but the invocation
evaluates $compose[1..0], which includes the command again and effectively invokes `docker-compose
docker-compose up ...` instead of the intended subcommand.
Code

scripts/setup.ps1[R24-25]

+if (docker compose version 2>$null) { $compose = @("docker", "compose") }
+elseif (Test-Command "docker-compose") { $compose = @("docker-compose") }
Evidence
The fallback creates @("docker-compose"), while line 41 always indexes from 1 through Length-1;
for a one-element array PowerShell's 1..0 range includes indices 1 and 0, reintroducing the
executable into the native argument list.

scripts/setup.ps1[24-27]
scripts/setup.ps1[40-42]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The one-element standalone Compose fallback is expanded with an invalid index range and duplicates the executable as an argument.

## Issue Context
Build a complete command/argument list and splat only valid trailing arguments, or branch explicitly between `docker compose` and `docker-compose` invocations.

## Fix Focus Areas
- scripts/setup.ps1[24-27]
- scripts/setup.ps1[40-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 6/18, lines 405/200; both must reach the floor). Router rationale: This is a substantial behavioral change spanning six independent operational paths—cross-platform setup, process lifecycle, WSL networking, REST registration, Compose services, and a CLI injector—with many easy-to-miss integration and environment-specific failure modes.

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread scripts/setup.sh
Comment thread scripts/start-all.ps1 Outdated
Comment thread scripts/start-all.ps1 Outdated
Comment thread scripts/start-all.ps1 Outdated
Comment thread scripts/setup.ps1 Outdated
Comment thread scripts/setup.ps1
Comment on lines +17 to +19
if (-not (Test-Command "node")) { Write-Error "node 18+ is required. Install from nodejs.org."; exit 1 }
$python = if (Test-Command "python") { "python" } elseif (Test-Command "py") { "py" } else { $null }
if (-not $python) { Write-Error "python 3.10+ is required."; exit 1 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The prerequisite checks only verify that node and Python commands exist, despite claiming to require Node 18+ and Python 3.10+. Older interpreters pass this step and can fail later during dependency installation or service startup, so compare the detected versions against the stated minimums before continuing. [api mismatch]

Severity Level: Major ⚠️
- ⚠️ Unsupported Node.js reaches dashboard installation.
- ⚠️ Unsupported Python reaches infrastructure startup.
- ⚠️ Setup diagnostics contradict actual requirements.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** scripts/setup.ps1
**Line:** 17:19
**Comment:**
	*Api Mismatch: The prerequisite checks only verify that `node` and Python commands exist, despite claiming to require Node 18+ and Python 3.10+. Older interpreters pass this step and can fail later during dependency installation or service startup, so compare the detected versions against the stated minimums before continuing.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment thread scripts/setup.sh
echo ""

echo "[3/6] Building and starting demo infrastructure + MCP server..."
$DOCKER_COMPOSE up -d --build postgres redis demo-infra-mcp

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The Compose build is guaranteed to fail on a clean checkout because demo-infra-mcp uses mcp-servers/demo-infra as its build context, but that directory contains no Dockerfile or server implementation. The setup therefore cannot reach the health check or start the documented stack; include the service files in the checkout or use the correct existing build context. [incomplete implementation]

Severity Level: Critical 🚨
- ❌ Clean setup cannot build `demo-infra-mcp`.
- ❌ MCP health check never succeeds.
- ❌ Local incident demo stack cannot start.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** scripts/setup.sh
**Line:** 37:37
**Comment:**
	*Incomplete Implementation: The Compose build is guaranteed to fail on a clean checkout because `demo-infra-mcp` uses `mcp-servers/demo-infra` as its build context, but that directory contains no `Dockerfile` or server implementation. The setup therefore cannot reach the health check or start the documented stack; include the service files in the checkout or use the correct existing build context.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment thread scripts/start-all.ps1 Outdated
$litUp = ($LASTEXITCODE -eq 0)
$out = wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:4000/v1/models --max-time 3"
if ($out -ne "200") {
wsl -e bash -lc "setsid -f -- /home/aditya/tf-litellm.sh </dev/null > /home/aditya/litellm.log 2>&1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: When either service is not already running, this startup path invokes user-specific files under /home/aditya; those files are not part of the repository and will not exist for another Windows user or a clean installation. The script then continues as though startup is supported, so derive these paths from repository configuration or invoke the checked-in setup/runtime commands instead. [api mismatch]

Severity Level: Critical 🚨
- ❌ Other Windows users cannot start LiteLLM.
- ❌ TrueForge startup fails on clean installations.
- ❌ One-command startup is not portable.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** scripts/start-all.ps1
**Line:** 38:38
**Comment:**
	*Api Mismatch: When either service is not already running, this startup path invokes user-specific files under `/home/aditya`; those files are not part of the repository and will not exist for another Windows user or a clean installation. The script then continues as though startup is supported, so derive these paths from repository configuration or invoke the checked-in setup/runtime commands instead.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment thread scripts/start-all.ps1
Comment on lines +57 to +60
if (-not $up) { Write-Host " TrueForge: FAILED (check WSL ~/tf.log)" -ForegroundColor Red }
}
$out = wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3000 --max-time 4"
if ($out -eq "200") { Write-Host " TrueForge: UP" -ForegroundColor Green }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: A failed TrueForge startup only prints an error and does not stop the workflow. The script proceeds through registration and dashboard startup and ultimately prints READY, so callers cannot rely on successful completion to mean the required agent runtime is available; return a failure status when the startup health check never succeeds. [incorrect condition logic]

Severity Level: Major ⚠️
- ❌ Automated callers cannot trust successful completion.
- ⚠️ Dashboard starts without the required agent runtime.
- ⚠️ Users receive a false readiness indication.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** scripts/start-all.ps1
**Line:** 57:60
**Comment:**
	*Incorrect Condition Logic: A failed TrueForge startup only prints an error and does not stop the workflow. The script proceeds through registration and dashboard startup and ultimately prints `READY`, so callers cannot rely on successful completion to mean the required agent runtime is available; return a failure status when the startup health check never succeeds.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment thread scripts/start-all.ps1 Outdated
$needRestart = $false
if (Test-Path $envFile) {
$envTxt = Get-Content $envFile -Raw
if ($envTxt -notmatch [regex]::Escape("TRUEFORGE_URL=http://${wslIp}:3000")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The refresh condition checks only TRUEFORGE_URL, but the update block also owns NEXT_PUBLIC_TRUEFORGE_URL. If the server-side URL is current while the browser-side URL is stale or missing, the condition is false and the browser continues using the wrong endpoint after a WSL IP change. Validate and update both keys independently. [incorrect condition logic]

Severity Level: Major ⚠️
- ❌ Embedded TrueForge chat can target stale WSL IPs.
- ⚠️ Browser configuration diverges from server configuration.
- ⚠️ Reboot recovery can require manual environment edits.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** scripts/start-all.ps1
**Line:** 104:104
**Comment:**
	*Incorrect Condition Logic: The refresh condition checks only `TRUEFORGE_URL`, but the update block also owns `NEXT_PUBLIC_TRUEFORGE_URL`. If the server-side URL is current while the browser-side URL is stale or missing, the condition is false and the browser continues using the wrong endpoint after a WSL IP change. Validate and update both keys independently.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +53 to +62
print("[2/2] Triggering agent investigation via dashboard webhook...")
try:
result = _post(f"{DASHBOARD_URL}/api/webhook", {
"service": service,
"alert_type": chaos_type,
"message": message,
})
print(json.dumps(result, indent=2))
except Exception as exc:
print(f"Warning: could not reach dashboard webhook (is the dashboard running on :3001?): {exc}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The script mutates the demo state before invoking the dashboard webhook, then suppresses webhook failures as a warning. If the dashboard is unavailable or rejects the request, chaos remains injected without an agent investigation trigger, leaving the operation partially completed; either roll back the injection or return a failure status that automation can detect. [incomplete implementation]

Severity Level: Major ⚠️
- ❌ Chaos remains active without agent investigation.
- ⚠️ Automation receives a successful exit status.
- ⚠️ Incident demonstrations become partially completed.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** scripts/trigger_incident.py
**Line:** 53:62
**Comment:**
	*Incomplete Implementation: The script mutates the demo state before invoking the dashboard webhook, then suppresses webhook failures as a warning. If the dashboard is unavailable or rejects the request, chaos remains injected without an agent investigation trigger, leaving the operation partially completed; either roll back the injection or return a failure status that automation can detect.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment thread scripts/stop-all.ps1 Outdated
Comment thread scripts/start-all.ps1 Outdated
@codeant-ai

codeant-ai Bot commented Aug 27, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. Unvalidated CLI values are sent to the chaos API despite documented allowlists.

Api mismatch · scripts/trigger_incident.py:42-47

- npm resolved from PATH instead of hard-coded Program Files path
- stop-all only kills processes verified to be MissionControl (command-line match)
- compose detection + invocation fixed for legacy docker-compose (v2 check, slice-safe)
- READY block computes URL from live IP and warns to refresh stale browser tabs
- Personal WSL paths made configurable via env vars (WSL_USER, TF_RUN_SCRIPT, etc.)
- MCP server started via docker-compose instead of direct python invocation
- Dashboard built with 'npm run build' in setup.sh
- Compose build context populated from MCP branch
- Legacy compose detection fixed in setup.sh (v2 check)
- Personal WSL paths replaced with configurable env vars
- Dashboard package: committed all dashboard files (was missing from branch)
- Personal WSL paths: removed hardcoded defaults, now require explicit env vars
- Browser URL stale: .env.local rewrite now checks/updates each var independently
- Legacy Compose invocation: fixed array slice bug in setup.ps1
- Compose build context: demo-infra files committed
- Launcher starts missing server: uses docker-compose for MCP server
- npm path hard-coded: resolved via PATH lookup
- Cleanup kills unrelated: resolved with command-line verification
@codeant-ai codeant-ai Bot removed the size:L This PR changes 100-499 lines, ignoring generated files label Aug 27, 2026
@ADITYA-tp01

Copy link
Copy Markdown
Owner Author

Fixes pushed (review this commit for a clean re-review)

5396f7d addresses the findings that were still open on this PR:

  1. High — Dashboard package is absent / broken: apps/dashboard/package.json had been committed in a corrupted state (UTF-16 git-error text, unparseable by npm). Reconstructed it from package-lock.json metadata. Verified end-to-end: tsc --noEmit pass, npm run lint clean, next build succeeds (all routes/sizes in output).
  2. High — Startup uses personal WSL paths: reduced the required env contract to WSL_USER only; TF_RUN_SCRIPT, TF_LITELLM_SCRIPT, LITELLM_LOG, TF_LOG now default to /home/<WSL_USER>/... and remain overridable. No hard-coded /home/aditya paths anywhere.
  3. Medium — Legacy Compose invocation breaks: start-all.ps1 had the same one-element-array bug Qodo flagged in setup.ps1. It now builds the command array the same safe way (@("docker","compose") vs @("docker-compose"), splat via & $compose up ...).
  4. Medium — Browser URL remains stale: the .env.local rewrite previously emitted both the new value and the old line (leaving the stale URL active, since dotenv honors the last line). Each of TRUEFORGE_URL / NEXT_PUBLIC_TRUEFORGE_URL is now replaced or appended independently, emitting only the new line.
  5. CodeAnt — Unvalidated CLI args: trigger_incident.py now validates service and chaos_type against the documented allowlists and exits 1 on mismatch.
  6. Cleanup: removed unused $litUp/double-curl in the LiteLLM probe, removed unused $mcpDir, fixed the duplicate [6/6] step label in setup.sh.

Design note (unchanged, intentional): the REST sidecar can still trigger remediation without MCP approval — that is the demo's human kill-switch path, documented in the PR body. Qodo's two remaining "Pending" items on PR #4 are the same intentional design + stale review artifacts; code there is fixed and covered by 14/14 regression tests.

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Aug 27, 2026
@codeant-ai codeant-ai Bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XXL This PR changes 1000+ lines, ignoring generated files labels Aug 27, 2026
@ADITYA-tp01

Copy link
Copy Markdown
Owner Author

Finding "Startup uses personal WSL paths" — now closed (commit e165792)

The complaint was never only about the literal /home/aditya string — it was that the launchers themselves lived only in one developer's WSL home and were absent from the repo. Root-caused and fixed properly:

  • Repo now ships the launchers: scripts/wsl/start-trueforge.sh and scripts/wsl/start-litellm.sh are checked in. A clean clone + setup + start-all works with zero per-developer home scripts.
  • No secrets in the repo: start-trueforge.sh sources OPENAI_API_KEY from the repo .env (created by setup from .env.example) at runtime; the NVIDIA key itself never enters git. start-litellm.sh discovers ~/litenv/bin/litellm, ~/litellm.yaml, and ~/nim.env via $HOME (all overridable with LITELLM_BIN / LITELLM_CONFIG / NIM_ENV) and matches the documented npx @truefoundry/trueforge invocation.
  • Path resolution is dynamic: start-all.ps1 maps the checkout into WSL with wslpath -a -u "<repo>" (handles the space in Mission Control) instead of hard-coding any user, so it works for every WSL user.
  • stop-all.ps1 now matches the new launcher names in addition to the npx trueforge / litellm processes they exec.
  • The earlier env-var contract (WSL_USER, TF_*) was dropped — no environment requirements remain beyond the API key in .env.

Verified locally: PowerShell parse for all scripts, bash -n for both launchers, and wslpath resolves this checkout correctly.

@ADITYA-tp01

Copy link
Copy Markdown
Owner Author

Finding "Dashboard package is absent" — closed

This was from the original first-pass review (commit 65ce470, when the dashboard tree genuinely held only .gitkeep). Since then:

  • The full dashboard was committed in 4defecb (26 files: app/, components/, lib/, configs).
  • apps/dashboard/package.json was found corrupted in 5396f7d (a stray UTF-16 git-error blob that npm could not parse) and was reconstructed from package-lock.json metadata with a dev script:
    "scripts": { "dev": "next dev -p 3001", "build": "next build", "start": "next start -p 3001", "lint": "next lint" }
  • Verified end-to-end just now: npm run dev boots and serves the app on port 3001:
    • HTTP 200, <title>MissionControl - Autonomous Incident Response</title>, 17 KB HTML (plus tsc --noEmit clean, next lint clean, next build succeeds).

So setup.ps1/setup.sh step [4/6] (cd apps/dashboard && npm install) and the :3001 startup both work on a clean checkout.

@ADITYA-tp01

Copy link
Copy Markdown
Owner Author

Requesting Qodo dismissal (with reason on record) for findings #2 and #4

These two findings were generated against the original commit 65ce470, when apps/dashboard and mcp-servers/demo-infra genuinely held only .gitkeep placeholders. Both trees have since been committed as real code, so the finding text is now stale and factually incorrect — the auto-resolve cleared the other 6 findings but these two remain because their analysis was never re-run against the added directories.

Finding #2 — "Dashboard package is absent": claimed "that tree has no package.json or application code". Current state:

  • apps/dashboard/package.json is committed (scripts: dev, build, start, lint) — see commit 5396f7d where it was also repaired from an earlier corruption.
  • apps/dashboard/app/, components/, lib/ are committed; .gitkeep deleted (a033b17).
  • Verified live: npm run dev boots on :3001 → HTTP 200 with <title>MissionControl - Autonomous Incident Response</title> (17 KB HTML); tsc --noEmit, next lint, next build all pass.
  • setup.sh/setup.ps1 now fail fast with a clear message if apps/dashboard/package.json is absent.

Finding #4 — "Compose build context is empty": claimed the infra directory "contains only .gitkeep". Current state:

  • mcp-servers/demo-infra/{Dockerfile,server.py,http_api.py,state.py,requirements.txt,test_state.py} are committed; .gitkeep deleted (a033b17). Regression suite: 14/14 passing.
  • docker compose config validates the build context; the compose file was rewritten as UTF-8 and the obsolete version: attribute removed (0acec7b).
  • setup.sh/setup.ps1 now fail fast if mcp-servers/demo-infra/Dockerfile is absent.

Please dismiss with the reasoning above, or reply @qodo-code-review dismiss to close these two stale artifacts. (Docker daemon was not running on this machine at check time, so a live docker compose build screenshot wasn't captured; the config/build-context check passes and the image was built successfully in the earlier E2E session.)

@qodo-code-review

Copy link
Copy Markdown

Requesting Qodo dismissal (with reason on record) for findings #2 and #4

These two findings were generated against the original commit 65ce470, when apps/dashboard and mcp-servers/demo-infra genuinely held only .gitkeep placeholders. Both trees have since been committed as real code, so the finding text is now stale and factually incorrect — the auto-resolve cleared the other 6 findings but these two remain because their analysis was never re-run against the added directories.

Finding #2 — "Dashboard package is absent": claimed "that tree has no package.json or application code". Current state:

  • apps/dashboard/package.json is committed (scripts: dev, build, start, lint) — see commit 5396f7d where it was also repaired from an earlier corruption.
  • apps/dashboard/app/, components/, lib/ are committed; .gitkeep deleted (a033b17).
  • Verified live: npm run dev boots on :3001 → HTTP 200 with <title>MissionControl - Autonomous Incident Response</title> (17 KB HTML); tsc --noEmit, next lint, next build all pass.
  • setup.sh/setup.ps1 now fail fast with a clear message if apps/dashboard/package.json is absent.

Finding #4 — "Compose build context is empty": claimed the infra directory "contains only .gitkeep". Current state:

  • mcp-servers/demo-infra/{Dockerfile,server.py,http_api.py,state.py,requirements.txt,test_state.py} are committed; .gitkeep deleted (a033b17). Regression suite: 14/14 passing.
  • docker compose config validates the build context; the compose file was rewritten as UTF-8 and the obsolete version: attribute removed (0acec7b).
  • setup.sh/setup.ps1 now fail fast if mcp-servers/demo-infra/Dockerfile is absent.

Please dismiss with the reasoning above, or reply @qodo-code-review dismiss to close these two stale artifacts. (Docker daemon was not running on this machine at check time, so a live docker compose build screenshot wasn't captured; the config/build-context check passes and the image was built successfully in the earlier E2E session.)

Dismissed finding 2 and finding 4 as false_positive, with the reason that both were based on the original placeholder-only directories and are stale against the current committed code.

@codeant-ai

codeant-ai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:XXL This PR changes 1000+ lines, ignoring generated files and removed size:XXL This PR changes 1000+ lines, ignoring generated files labels Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant