fix: align review contract with BuildShip and harden deploy placement - #54
Conversation
- buildReviewPrompt: request bundleReview {status,score,summary,findings} to
match what the review presentation reads, so the summary section shows a
real score and verdict instead of being empty.
- normalizeArtifact: a missing artifactType no longer silently becomes a
CustomWidget (which misrouted classes/functions into lib/custom_code/widgets);
it now defaults to a standalone code file under lib/custom_code/ and surfaces
a warning. Honor an explicit artifact.deployPath.
- bundleDeployPlanner: honor artifact.deployPath; merge multiple CustomFunction
artifacts into the single shared lib/flutter_flow/custom_functions.dart
(verified as FlutterFlow's real layout) instead of erroring/colliding.
- flutterFlowArtifactValidation: correct TYPE_FILE_HINTS to the real exported
FlutterFlow layout.
Greptile SummaryThis PR aligns the generated review request and presentation with the BuildShip review contract while correcting FlutterFlow deployment paths and shared custom-function planning.
Confidence Score: 4/5The PR does not yet appear safe to merge because combining complete custom-function artifacts can still generate an invalid Dart file when a later artifact contains directives. The shared-file merge copies each complete artifact body in sequence, so imports, library declarations, or part directives from later artifacts remain after earlier function declarations and can make the generated custom_functions.dart fail Dart analysis or compilation. Files Needing Attention: src/bundleDeployPlanner.js, src/bundleDeployPlanner.test.js Important Files Changed
|
| content: functionEntries | ||
| .map(({ entry }) => `// ${entry.artifactId}\n${entry.content}`) | ||
| .join("\n\n"), |
There was a problem hiding this comment.
Merged Dart directives break compilation
When two custom-function artifacts contain complete Dart content and a later artifact includes an import, library, or part directive, this verbatim concatenation places that directive after the first function declaration, causing the generated custom_functions.dart to fail Dart analysis or compilation.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/bundleDeployPlanner.js
Line: 126-128
Comment:
**Merged Dart directives break compilation**
When two custom-function artifacts contain complete Dart content and a later artifact includes an `import`, `library`, or `part` directive, this verbatim concatenation places that directive after the first function declaration, causing the generated `custom_functions.dart` to fail Dart analysis or compilation.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…ummary - buildReviewPrompt: request bundleReview.manualActions alongside status/score/summary/findings. - reviewPresentation: a missing written summary no longer falls back to the bundle description or a useless placeholder. It synthesizes an actionable deploy guide (overall verdict, per-artifact pass/warn/fail counts, the manual steps the user must take in their own FlutterFlow project) and explicitly flags when no numeric 0-100 score was returned so a missing score is never mistaken for a pass.
main landed PR #54, which reworked the same review contract this branch touches. Both sides added manualActions to the review's output requirements, independently. Resolution keeps main's shape and this branch's constraint: - outputRequirements uses main's `bundleReview` key, not this branch's `overall`. It mirrors the object the review stage actually emits, so it is the better name; the auto-merge had also duplicated manualActions in that list, now a single entry. - The manualActions definition/exclude/preferEmpty block is kept. main asks the review FOR manual actions but never bounds them, which is what let the review volunteer work FlutterFlow already does. - Dropped this branch's `assert.doesNotMatch(prompt, /bundleReview/)`. It guarded against leaking system-prompt vocabulary while the key was `overall`; with main's rename bundleReview is the contract's own key, so the assertion is now false by construction. dist/index.html was regenerated rather than hand-merged. Suite 196/196. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fixes two symptoms against the runPipeline backend: an empty review summary, code artifacts landing in the wrong FlutterFlow folder, and makes the review score + deploy guide mandatory on every generation.
Review (must ship every time):
buildReviewPrompt: requestbundleReviewas {status, score, summary, manualActions, findings} so the request matches what the parser reads and what BuildShip's system prompt now requires.reviewPresentation: a missing written summary no longer falls back to the bundle description or a useless placeholder. It synthesizes an actionable deploy guide (verdict, per-artifact pass/warn/fail counts, the manual steps to take in the user's own FlutterFlow project) and explicitly flags when no numeric 0-100 score was returned, so a missing score is never mistaken for a pass.Placement:
normalizeArtifact: a missingartifactTypeno longer silently becomes aCustomWidget(misrouting classes/functions intolib/custom_code/widgets/); it defaults to a standalone code file (lib/custom_code/ root) and surfaces a warning. Honorsartifact.deployPath.bundleDeployPlanner: honorsdeployPath; merges multipleCustomFunctionartifacts into the single sharedlib/flutter_flow/custom_functions.dart(verified as FlutterFlow's real layout) instead of erroring on a duplicate-path collision.flutterFlowArtifactValidation: correctedTYPE_FILE_HINTSto the real exported layout.Pre-existing project state is preserved (not overwritten):
functions_mapand diffs generated function names against the real exportedcustom_functions.dart(functions_to_add= new names only, never delete), so functions already in the user's project stay.resolveProjectPubspecreads the real remote pubspec and only merges in the generated packages; it aborts rather than overwrite if the project pubspec can't be read.Paired with https://github.com/sgardoll/buildship/pull/62. All 159 tests pass.