Agentic Site Building
Build editing systems that can prove a requested change happened without rewriting unrelated work or claiming success on a no-op.
Workflow
- Map the editable artifact, source of truth, preview boundary, model providers, persistence, and rollback path.
- Compile each request into an explicit contract: mode, target surface, allowed change radius, acceptance criteria, and risk.
- Prefer a structured patch for an existing artifact. Require exact, unique anchors and a bounded change budget.
- Apply patches locally, then validate syntax, structure, requested-surface change, and collateral-change limits.
- If validation fails, give the verifier evidence to one bounded repair attempt. Escalate to a full rewrite only when scope requires it or patching is unsafe.
- For redesigns, reject the current composition deliberately while preserving factual content and product constraints.
- Render generated code in an isolated preview. Keep authentication, storage, parent DOM, and privileged network access outside the generated runtime.
- Save only accepted outputs. Keep restorable revisions with prompt, mode, verifier result, and prompt/model version.
- Expose honest progress and failure states. Never label an unchanged or unverified preview as updated.
- Measure patch success, no-op rate, repair rate, latency, token cost, rollback rate, and user acceptance.
Decision Rules
- Deterministic code owns safety and common runtime contracts; the model owns interpretation and creative composition.
- A small edit should not receive the full site unless the patch path fails safely.
- Verification must inspect the requested surface, not only whole-file similarity.
- Retries must use new evidence and stop after a fixed budget.
- Provider fallback handles availability; it must not silently weaken required structured-output or context capabilities.
- Keep generated code facts grounded in user data. Do not invent projects, metrics, employers, or media.
Delivery Contract
Provide or implement:
- Execution contract - modes, scope, acceptance criteria, and escalation rules.
- Orchestration path - plan, patch or build, validate, repair, persist, preview, rollback.
- Verifier design - deterministic checks and evidence returned to repair attempts.
- Safety boundary - generated-code sandbox and authorization limits.
- Efficiency budget - context selection, model routing, retries, and stopping conditions.
- Operational proof - tests for no-op, collateral edit, failed patch, retry, rollback, and preview isolation.
Reference
Read references/orchestration-contract.md when defining schemas, retry policy, or production metrics.