Skip to content

feat(framework): --serve gates the loop on the app actually running#171

Merged
suleimansh merged 1 commit into
mainfrom
suleimansh/feat/framework-serve-gate
Jul 3, 2026
Merged

feat(framework): --serve gates the loop on the app actually running#171
suleimansh merged 1 commit into
mainfrom
suleimansh/feat/framework-serve-gate

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Follow-up to #166. Makes production-grade mean the generated app really boots and serves, not just that Claude Code said its review passed. This is the on-brand guardrail: gate on the outcome, not the agent's opinion.

How. With --serve <cmd>, the checklist becomes mergeChecklists(driverChecklist, serveCheck) - the agent review AND a real serveCheck that installs, builds, starts, and fetches the app. A boot failure or a 5xx is a blocker the loop hands back to the agent to fix, then re-checks.

Runner-seam gap this exposed. serveCheck needs a RunnerSession bound to the workspace the agent wrote to, but LocalRunner mkdtemps a fresh dir and deletes it on dispose. So this adds LocalRunner.adopt(dir) to @gemstack/ai-autopilot: adopt an existing directory as the workspace, run inside it, and leave it alone on dispose. (Same gap I worked around for deploy with hostExecutor; adopt is the general fix.)

New: LocalRunner.adopt, runFramework({ serve }), and CLI flags --serve / --serve-install / --serve-build / --serve-port / --serve-path. Serve progress streams to the dashboard.

Tests. adopt (survives dispose, seeds files) + framework serve gate (a real seeded server passes; a server that never boots blocks). 36 framework + 259 ai-autopilot green; full-repo typecheck + build clean. Two changesets (both minor). Opt-in: --fake and default runs are unaffected.

Make 'production-grade' mean the generated app really boots and serves, not just
that an agent review passed.

ai-autopilot:
- LocalRunner.adopt(dir): bind an EXISTING directory as the workspace (exec/
  start/preview inside it) and do NOT delete it on dispose. Fills a runner-seam
  gap (verify code another tool wrote); the framework hit it for deploy too.

framework:
- runFramework({ serve }): adopt the agent's cwd, mergeChecklists(driverChecklist,
  serveCheck) so the checklist gates on install/build/start/fetch. Boot failure
  or 5xx -> a blocker the loop hands back to the agent to fix.
- CLI: --serve / --serve-install / --serve-build / --serve-port / --serve-path;
  serve progress streams to the dashboard.

Tests: LocalRunner.adopt (survives dispose, seeds files); framework serve gate
(real seeded server passes; a server that never boots blocks). 36 framework +
259 ai-autopilot tests green, full-repo typecheck + build clean.
@suleimansh suleimansh added enhancement New feature or request priority: medium Worth doing, not urgent labels Jul 3, 2026
@suleimansh suleimansh self-assigned this Jul 3, 2026
@suleimansh suleimansh merged commit d72accd into main Jul 3, 2026
2 checks passed
@suleimansh suleimansh deleted the suleimansh/feat/framework-serve-gate branch July 3, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: medium Worth doing, not urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant