Spaces:
Sleeping
Sleeping
fix: overlay baked scaffold last so /ui kit is un-clobberable
Browse files
agent/__pycache__/graph.cpython-314.pyc
CHANGED
|
Binary files a/agent/__pycache__/graph.cpython-314.pyc and b/agent/__pycache__/graph.cpython-314.pyc differ
|
|
|
agent/graph.py
CHANGED
|
@@ -345,9 +345,13 @@ def _validate_and_repair(files: dict[str, str], view_specs) -> dict[str, str]:
|
|
| 345 |
def _assemble_node(emitter):
|
| 346 |
def node(state: dict) -> dict:
|
| 347 |
plan: PremiumPlan = state["plan"]
|
| 348 |
-
# ponytail:
|
| 349 |
-
#
|
| 350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
files = normalize_files(merged, "react")
|
| 352 |
files = ensure_dependencies(files) # backfill lucide-react/recharts (idempotent)
|
| 353 |
files = _validate_and_repair(files, state["architecture"].view_specs)
|
|
|
|
| 345 |
def _assemble_node(emitter):
|
| 346 |
def node(state: dict) -> dict:
|
| 347 |
plan: PremiumPlan = state["plan"]
|
| 348 |
+
# ponytail: shell + views FIRST, then the baked scaffold LAST so it ALWAYS wins.
|
| 349 |
+
# The coder is instructed not to re-emit scaffold files, but LLMs sometimes do anyway
|
| 350 |
+
# (e.g. a hand-rolled /ui/index.js that drops the barrel, or a partial /styles.css) —
|
| 351 |
+
# letting the coder win there deletes primitive files the barrel needs and produces
|
| 352 |
+
# "Could not find module './ui'" in the preview. Overlaying PREMIUM_SCAFFOLD_FILES last
|
| 353 |
+
# makes the baked 12-primitive kit + styles + lib un-clobberable, LLM-independently.
|
| 354 |
+
merged = {**state["shell_files"], **state["view_files"], **PREMIUM_SCAFFOLD_FILES}
|
| 355 |
files = normalize_files(merged, "react")
|
| 356 |
files = ensure_dependencies(files) # backfill lucide-react/recharts (idempotent)
|
| 357 |
files = _validate_and_repair(files, state["architecture"].view_specs)
|