Repository navigation
Let article drafts carry figures and embeds, approved with the article - #311
Merged
Merged
Conversation
Page bundles, part 1a (the contract). An article draft whose definition declares output.assets may write SVG figures and self-contained HTML embeds into its assets folder (<article>.assets/) and refer to them from the Markdown. - The article declares its assets: Tin keeps exactly the files it refers to, records their checksums with the checkpoint and publishes them with the article. A missing, oversized or unsafe file (an SVG with script, event handlers or outside references) is left out with its reason; it never fails the run. Files nothing refers to are never published. - The sandbox runner allows files directly in the folder, discards anything else there, applies runaway limits and the identity/card leak scan, and commits them; --check-assets lets the host refuse an old image before any model call. - The review token binds the asset list with the article; approved-page consumers re-check each file; a revision copies the files it keeps into its own folder; compare lists each version's assets. - The delivery wording check skips embed, video and diagram blocks. No workflow turns this on yet: definitions without assets keep their exact contract and tokens. The sandbox templates need a rebuild before part 1b enables it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 5, 2026
) Page bundles, part 1b (the experience), on top of #311's contract. - Reader: render_markdown takes the article's assets folder. Figures render without a URL and load with the member's session (SVG as an inert data: image, as in Files); tin-embed blocks run in an allow-scripts-only sandboxed frame with an injected policy that blocks the network; tin-video blocks play YouTube (privacy mode), Vimeo, Loom or Mux, a video file loads only on play, and anything else stays a link; `> [!NOTE]`-style quotes become callouts. A note under the title names any file Tin left out and why. - The run and Files document endpoints return the kept assets; the app passes a session-bound loader to the viewer. - Decisions: the explanation says what the draft carries ("With 2 figures and 1 interactive piece."). - Drafts: content.public_article 1.9.0 and content.generate 1.10.0 (articles only) declare an assets folder and use a new page-figures skill: figures only where they show what words can't, Mermaid for diagrams, self-contained embeds with no network, existing videos only, and kept figures from an existing page. Co-authored-by: egeozin <ege@emotionmachine.ai> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
egeozin
added a commit
that referenced
this pull request
Oct 5, 2026
# Conflicts: # src/tin_lite/content_repository_delivery.py # tests/test_page_assets.py
egeozin
added a commit
that referenced
this pull request
Oct 5, 2026
* Let article drafts carry figures and embeds, approved with the article Page bundles, part 1a (the contract). An article draft whose definition declares output.assets may write SVG figures and self-contained HTML embeds into its assets folder (<article>.assets/) and refer to them from the Markdown. - The article declares its assets: Tin keeps exactly the files it refers to, records their checksums with the checkpoint and publishes them with the article. A missing, oversized or unsafe file (an SVG with script, event handlers or outside references) is left out with its reason; it never fails the run. Files nothing refers to are never published. - The sandbox runner allows files directly in the folder, discards anything else there, applies runaway limits and the identity/card leak scan, and commits them; --check-assets lets the host refuse an old image before any model call. - The review token binds the asset list with the article; approved-page consumers re-check each file; a revision copies the files it keeps into its own folder; compare lists each version's assets. - The delivery wording check skips embed, video and diagram blocks. No workflow turns this on yet: definitions without assets keep their exact contract and tokens. The sandbox templates need a rebuild before part 1b enables it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Show a draft's figures, embeds and videos, and let drafts use them Page bundles, part 1b (the experience), on top of #311's contract. - Reader: render_markdown takes the article's assets folder. Figures render without a URL and load with the member's session (SVG as an inert data: image, as in Files); tin-embed blocks run in an allow-scripts-only sandboxed frame with an injected policy that blocks the network; tin-video blocks play YouTube (privacy mode), Vimeo, Loom or Mux, a video file loads only on play, and anything else stays a link; `> [!NOTE]`-style quotes become callouts. A note under the title names any file Tin left out and why. - The run and Files document endpoints return the kept assets; the app passes a session-bound loader to the viewer. - Decisions: the explanation says what the draft carries ("With 2 figures and 1 interactive piece."). - Drafts: content.public_article 1.9.0 and content.generate 1.10.0 (articles only) declare an assets folder and use a new page-figures skill: figures only where they show what words can't, Mermaid for diagrams, self-contained embeds with no network, existing videos only, and kept figures from an existing page. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Deliver a page's figures, embeds, diagrams and videos to the site Page bundles, part 2, on top of #312. - content.deliver 1.7.0 and website.change 1.6.0 copy each approved asset from the project checkout, now pinned to the approved revision when a page has assets, and show it the way the site shows media; Mermaid blocks become SVG with the sandbox's offline renderer unless the site has its own diagram support; videos and callouts use the site's own components. - figure_check beside copy_check: approved files byte for byte, videos by address or ID, diagrams as new SVG or the site's Mermaid support. Unconfirmed holds only Tin's own merge; the PR still opens. - Limits: one pull request or commit may hold 30 files and 2 MB (it held 10 files and 512 KB, which also refused technical batches the procedure allowed at 20 files); a saved patch reads back up to 4 MB. Procedures that declare nothing keep their 512 KB contract. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Show a draft's figures, embeds and videos, and let drafts use them (#312) Page bundles, part 1b (the experience), on top of #311's contract. - Reader: render_markdown takes the article's assets folder. Figures render without a URL and load with the member's session (SVG as an inert data: image, as in Files); tin-embed blocks run in an allow-scripts-only sandboxed frame with an injected policy that blocks the network; tin-video blocks play YouTube (privacy mode), Vimeo, Loom or Mux, a video file loads only on play, and anything else stays a link; `> [!NOTE]`-style quotes become callouts. A note under the title names any file Tin left out and why. - The run and Files document endpoints return the kept assets; the app passes a session-bound loader to the viewer. - Decisions: the explanation says what the draft carries ("With 2 figures and 1 interactive piece."). - Drafts: content.public_article 1.9.0 and content.generate 1.10.0 (articles only) declare an assets folder and use a new page-figures skill: figures only where they show what words can't, Mermaid for diagrams, self-contained embeds with no network, existing videos only, and kept figures from an existing page. Co-authored-by: egeozin <ege@emotionmachine.ai> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: egeozin <ege@emotionmachine.ai> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Page bundles, part 1a: the contract. Plan: https://with.md/s/6bxvmfrh
Today a Tin draft is exactly one Markdown file, and every step after it assumes that: the sandbox runner, publication, the approval token, revisions and delivery. On sheepdogs.io, the report's 14 diagrams and its interactive canvas were dropped at the draft step for that reason.
This PR lets an article draft carry its figures and embeds and have them approved with the article. No workflow turns it on yet. Part 1b enables it for content.public_article and content.generate, together with the reader, the Decisions card and the prompts.
The bundle
A draft whose definition declares
output.assetsmay write files into an assets folder next to the article and refer to them from the Markdown:dropped_assetson the persist receipt. An unsafe file is an SVG with script, event handlers,foreignObjector outside references. A left-out file never fails the run.What changed
page_assets.py(new): the folder rule, reference parsing, types, the SVG safety rule, the definition policy, and the approval binding helpers.procedures.py:output.assetsis accepted only for article drafts (the content draft and public article validators) and is pinned with the definition. The sandbox context carries the folder and limits.sandbox/run_procedure.shandprocedure_app_server.py:--check-assetslets the host refuse an old image before any model call.publication.pyandcode_storage.py:assetsas checksummed files; validation keeps them in the article's folder, at the same revision, with matching types.fileslist.activities.py: collects the assets at persist, on both the fresh and the recovered path, and rechecks them at publication.approved_articleandapproved_documentcarry the verified asset list to delivery, and their guards rebuild the same record.source.assetslists the saved copy's files, and the revision instruction says to copy the ones it keeps into the run's own folder.comparelists each version's assets.tin-embed,tin-videoandmermaidblocks, which are figures rather than prose.docs/content-review.md.Rollout
output.assetsyet, and drafts keep their exact contract and tokens.--check-assetsbefore buying a model call.No migration and no Temporal change.
Verification
tests/test_page_assets.py:--check-assetsfails before any model call.localtimetests fail as on main. ruff, format,lint-importsanddump_catalog.py --checkare clean.🤖 Generated with Claude Code