# trenchplanet/mogfield — AlpLab Radar Static Code Audit

- Ring: `trial`
- Category: `media`
- Overall score: `3.3/5`
- Implementation check: `verified`
- Maturity: `early`
- Audited commit: `de5dad8511de` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-11-30T12:43:25Z
- Repository: https://github.com/trenchplanet/mogfield
- Radar entry: https://radar.alplab.co/#repo/trenchplanet/mogfield
- License: `MIT`
- CI workflows: `.github/workflows`
- Tags: `comfyui`, `video-generation`, `character-swap`, `react`, `hono`, `ffmpeg`

## Summary

Vite+React front end and Hono server that run curated ComfyUI workflows and the Comfy API for AI video/image generation (character swap, restyle, re-shoot, agent director mode) on Comfy Cloud or your own ComfyUI.

## Implementation Check

Main claims are implemented: app/server/pipeline.ts runs the full depth→motion→sheet→prompt→provider chain, providers/seedanceWorkflow.ts builds Seedance graphs in code, genjustsu.ts does SAM 3/vocal preparation with hash-verified review; the repo itself honestly marks several LOCAL workflows 'never run' (workflows/README.md).

## When to Use

Reach for it when you want a guided front end for paid Comfy API video models (Seedance 2.5, MiniMax H3) or a scaffold for your own ComfyUI video workflows. Avoid it as a shared/public service, and treat LOCAL-mode workflows as unproven until first GPU run.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.0/5 |
| usability | 3.0/5 |
| reliability | 3.0/5 |
| security | 3.0/5 |
| integration | 3.5/5 |

## Code Evidence

app/server/pipeline.ts orchestrates depth (depth.ts), motion measurement (motion.ts, real brute-force global-motion over depth-segmented background), reference sheets and per-model prompt packs (seedance.ts, 25KB of second-by-second motion-lock prompt engineering); app/server/engines/comfy.ts binds workflows by node title through @comfyorg/sdk; tests cover graph construction and preparation integrity (app/server/pika.test.ts, preparationStore.test.ts) and CI runs typecheck+tests+build (.github/workflows/ci.yml); workflows/README.md candidly lists which graphs were never executed.

## Issues Found

Server binds all interfaces by default so any LAN device can spend your Comfy credits (disclosed in SECURITY.md; BACKLOT_HOST=127.0.0.1 is opt-in, commented out in app/.env.example). Agent mode ships 'uncensored' local director models as one-click options (app/server/director.ts DIRECTOR_MODELS). Several LOCAL workflows are admitted-untested (workflows/README.md draft status section). Mitigations elsewhere are solid: yt-dlp URL is validated via linkSource and spawned arg-array without a shell (app/server/links.ts), COMFY_API_KEY stays in env and is sent only per-job, private preparation artifacts are gated to five whitelisted files (app/server/index.ts), and per-visitor demo mode isolates libraries and blocks visitors from changing backend/director (app/server/scope.ts).

## Key Risks

Nothing was executed in this review; the repo's own workflows/README.md admits backlot_depth.json, backlot_recast.json, backlot_cast.json and the Pika H3 Flex graphs are schema-checked but never run. API mode needs a paid Comfy account and key; LOCAL mode needs ffmpeg, yt-dlp, Rubber Band, a Python helper and tens of GB of Hugging Face weights. Single contributor, ~2 weeks of history, 40 stars are context only. Note: the code references future-dated model names (Gemma 4, Seedance 2.5) that could not be verified here.

## Reviewed Files

- `README.md`
- `package.json`
- `app/package.json`
- `app/.env.example`
- `.github/workflows/ci.yml`
- `docs/ARCHITECTURE.md`
- `app/server/config.ts`
- `app/server/index.ts`
- `app/server/backend.ts`
- `app/server/pipeline.ts`
- `app/server/seedance.ts`
- `app/server/genjustsu.ts`
- `app/server/motion.ts`
- `app/server/media.ts`
- `app/server/links.ts`
- `app/server/pika.ts`
- `app/server/steps.ts`
- `app/server/scope.ts`
- `app/server/director.ts`
- `app/server/providers/seedanceWorkflow.ts`
- `app/server/engines/comfy.ts`
- `app/server/pika.test.ts`
- `app/server/pipeline.test.ts`
- `app/server/preparationStore.test.ts`
- `app/server/scope.test.ts`
- `workflows/README.md`
- `SECURITY.md`
- `nodes/comfyui-backlot/__init__.py`
