feat(ai-autopilot): serveCheck — boot-and-serve production-grade check (#140)#141
Merged
Merged
Conversation
…eck (#140) The full-fledged loop gated only on a prompt verdict (loopChecklist asks the model whether the app is production-grade). Now that the runner can start a dev server and reach it (#137), the loop can gate on something concrete: does the app actually boot and serve? Add: - serveCheck(session, { serve, install?, build?, port?, healthPath?, ... }) — a checklist-shaped step that runs inside the build's runner session: install -> (build) -> start the dev server -> preview until reachable -> fetch a health path, turning any failure (install error, server exits on boot, 5xx, unreachable) into a concrete { blockers } verdict the improve loop addresses. Skips (passing, with a note) when the runner can't start/preview. - mergeChecklists(...checks) — union the blockers of several checks, so a pass must BOTH read production-grade AND actually run. Verified: real boot-and-serve success on LocalRunner (clean verdict) plus 5xx, exits-before-serving, install-fail (never starts), incapable-runner-skip, and the merge/dedupe combinator. 220 tests green. MINOR changeset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #140. Puts the #137 runner seam to work in the bootstrap loop.
Why
The full-fledged loop gated only on a prompt verdict —
loopChecklistasks the model whether the app is production-grade. Now that the runner canstarta dev server andpreviewit (#137), the loop can gate on something concrete: does the app actually boot and serve?What's added
serveCheck(session, { serve, install?, build?, port?, healthPath?, ... })— achecklist-shaped step. Inside the build's runner session it: install → (optional build) →startthe dev server →preview({ waitMs })until the port is reachable →fetcha health path. Any failure becomes a concrete{ blockers }verdict the improve loop then fixes:start/preview→ skips (passing, with a note) rather than blocking forevermergeChecklists(...checks)— unions (dedupes) the blockers of several checks, so a pass must BOTH read production-grade AND actually run:Verified
serve-check.test.ts— a real boot-and-serve success onLocalRunner(a Node HTTP server → clean verdict), plus every failure path (5xx, exits-before-serving, install-fail-never-starts, incapable-runner-skip) and the merge/dedupe combinator. 220 tests green, typecheck + build clean. The example README shows how to compose it into the live capstone (left out of the default run because a model-scaffolded app may not boot first try — which is exactly what the loop is for).MINOR changeset.