feat(framework): extend an existing project instead of rebuilding it (#185)#217
Merged
Conversation
…185) When the workspace already holds source, driverBuild now frames the wrapped agent to work within the existing codebase (read it, follow its conventions, add what was asked) via a new extendPrompt, instead of the greenfield 'scaffold from scratch' buildPrompt. Detection reuses isWorkspaceEmpty and is gated on verifyWorkspace, so the fake driver stays greenfield and deterministic. Greenfield (empty workspace) behavior is unchanged; improve already framed existing projects correctly. With live preset detection already wired from the real cwd, an existing project now detects its real stack and extends it. New exports: extendPrompt, isWorkspaceEmpty. Part of #110. Closes #185.
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.
Makes the framework usable on projects that already exist, not just from-scratch. Closes #185 (part of #110).
Two things made an existing-project run a poor fit. Part 1 (live preset detection wired to the real workspace) was already fixed by the #190 work (
cli.tsnow readsreadProjectSignals(cwd)for live runs). This PR does part 2: the prompts were greenfield-phrased.driverBuildnow picks framing by whether the workspace already has source:buildPrompt(scaffold from scratch), unchanged.extendPrompt: work within the codebase, read it, follow its conventions, make the smallest coherent change that adds what was asked, do not rebuild or swap the stack.Detection reuses
isWorkspaceEmpty(#182) and is gated onverifyWorkspace, so--fakealways takes the greenfield path and stays deterministic.driverImprovealready framed existing projects correctly (its "smallest changes" prompt), and the empty-workspace scaffold retry can't fire on a non-empty dir, so no change there.New exports:
extendPrompt,isWorkspaceEmpty. 85 tests pass (3 new; the extend path is driven directly via a FakeDriver that captures the exact prompt sent).Note: the architect step still narrates a stack decision the same way for existing projects (it reads the files and reports the real stack, so it's informational, not a rebuild). Tightening that to explicitly "analyze, don't re-pick" is a small possible follow-up if we want it.