Building Grounded AI Slides with DOM Patches, Geometry Guards, and Headless Chrome A two-person team at SaneDevs built DeckForge, an AI-assisted presentation workspace that edits slides as living DOM documents on a fixed 1920x1080 canvas rather than regenerating full HTML or returning raster images. The system splits new-slide generation into an isolated plain-text layout pipeline with delimiter-based output instead of JSON, and routes edits through a client-side Patch Engine that applies declarative CSS, text, attribute, class, HTML and remove patches behind a three-tier gate validating brand tokens, selectors and a dry-run geometry pass to prevent layout overflow. Most AI presentation tools make the same architectural mistake: they treat slide creation as a full-document replacement problem. When a user asks an LLM to "make this card look cleaner" or "add a four-step process", the model typically regenerates the whole slide HTML or returns an un-editable raster image. If you have spent ten minutes tweaking typography, spacing, and brand colours, watching an AI overwrite your entire canvas is infuriating. The second failure mode is layout drift. LLMs have no spatial awareness. When asked to insert three columns or expand an explanation, they happily output HTML that overflows viewport boundaries, clips underneath headers, or pushes footers off the screen. When we built DeckForge an AI-assisted presentation workspace developed by our two-person team at SaneDevs , we took a different path. We treated presentations as living DOM documents rendered on a fixed 1920x1080 canvas. Instead of letting models regenerate slides from scratch on every prompt, we separated deck creation into two distinct systems: an isolated plain-text layout generator for new slides, and a declarative, client-side Patch Engine for editing. To protect client confidentiality, this portfolio edition runs against a fictional brand kit, sample deck, and local handbook. Here is how the architecture works, how we solved layout collisions and hallucinations, and the code patterns you can use in your own canvas-based AI apps. A deck application cannot afford unpredictable DOM rewrites. If an AI touches elements the user did not ask to change, undo stacks get bloated and manual customizations disappear. We split the AI interaction into two pipelines: draft-