mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-11-16 13:10:29 +00:00
- chat.md, overview.md: how a streamed token renders only the live reply (runSummaries, the 32 ms notice gap, LiveThreadRuntime, the bounded highlighter, memoized panels) and that the columns resize. - model-capabilities.md, agent.md, data-model.md, 07-dev-setup.md: the two chat modes, their gates and defaults, where a pick is stored, the 0-id fix, and how to re-run the OpenRouter sweep and regenerate capabilities.json. - RELEASE.md: the steps 2.2.0 was released by, from the bump (with its PowerShell form) to the tag on the merge, the Known issues, an optional update check and publishing with --latest; dry runs are signed. - 06-repo-readme.md, AGENTS.md, README.md's comment: the README's structure, how to change it and its translations, re-checking the format table, and replacing the demo video. - Stale statements fixed (the Apple agreement, opencode never shipped, three languages, Studio's exec(), proposal statuses, the roadmap), and each gap still open after the release in its doc's Known gaps, linked to #2219-#2230.
3.8 KiB
3.8 KiB
ADR 0010: Studio models emit structured content and trusted builders render it, so no model-written code runs
- Status: Accepted; the rule that no model-written code runs is superseded by ADR 0028
- Date: 2026-09-07
- Source: Studio worker plan L8–43, Pivot plan L261, Pivot plan L53, Pivot plan L62–63
Context
The hosted Studio lets the model write code, runs it in a network-denied sandbox, checks the result with a vision model and signs a receipt. The desktop app has no Docker and no sandbox. Generation runs on the user's machine, unsandboxed; that risk was accepted, and sandboxed generation is on the enterprise roadmap. Studio as built is in studio.
Decision
- The generation model emits JSON or markdown in the format's schema, and a committed per-format builder renders it with an ordinary library. Nothing the model wrote executes, which turns the accepted risk from "arbitrary code" into "malformed JSON".
- The Image format is the one exception: its selected image model returns the image bytes itself, through the OpenAI-compatible Images API.
- Interactive HTML is shown in a sandboxed iframe.
- There is no sandbox, no Docker and no receipt. A builder's output is deterministic and always a valid file.
Consequences
- A new format is a builder plus a viewer, and persistence does not branch on the format. In code that is a new folder, one
caseinworker/studio/job_router.py, and its entry inmodules/artifacts/formats.py. - Every artifact lands the same way, as an
ARTIFACTdocument plus its sidecar and files,readyorfailed(ADR 0003). - This is what lets Studio fit an offline app with no Docker that runs on weak local models: the model only has to emit JSON or markdown.
Where the code stands
- PPTX and XLSX do not follow the rule. Their prompts ask the model to "write one standalone Python script", which since #2184 runs in the out-of-process runner of ADR 0039, stopped at its time limit, rather than with
exec()in the worker throughworker/studio/office/runner.py, now deleted. For these two formats the risk is still arbitrary code with the user's privileges, in a process of its own that nothing confines (studio). - DOCX and PDF follow the rule on small models, which write Markdown for committed builders, and run a strong model's script in the out-of-process runner of ADR 0039 (studio).
- The other eight formats (summary, mind map, flashcards, quiz, HTML, podcast, image and infographic) execute nothing the model wrote.
- The HTML viewer renders into
<iframe sandbox="allow-scripts allow-popups">(features/studio/viewers/html-viewer.tsx).