Repository navigation
Show a draft's figures, embeds and videos, and let drafts use them - #312
Merged
Merged
Conversation
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>
egeozin
added a commit
that referenced
this pull request
Oct 5, 2026
# Conflicts: # tests/test_page_assets.py
egeozin
added a commit
that referenced
this pull request
Oct 5, 2026
#311) * 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 (#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>
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 1b: the experience. It builds on #311 (the contract), so merge #311 first. Plan: https://with.md/s/6bxvmfrh
#311 lets an article draft carry figures and embeds and have them approved with the article. This PR shows them to the founder exactly as they'll ship, says what a draft carries in Decisions, and turns the feature on for the two article workflows.
Reader
render_markdown(markdown, asset_folder=…): with an article's assets folder, its blocks render as placeholders the viewer fills in. Every other document renders as before, except that> [!NOTE]quotes now become callouts everywhere.) render without a URL. The viewer loads them with the member's session through the raw file endpoint, and an SVG becomes an inertdata:image, as Files already does.tin-embedfenced block) run in an<iframe sandbox="allow-scripts" srcdoc>with a Content-Security-Policy meta tag injected first:default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; media-src data: blob:. That gives an opaque origin with no Tin cookies, storage or page, and no network. Asrcoutside the folder stays a code block.tin-videofenced block):.mp4,.webm,.m4v,.mov) plays in place withpreload="none", which suits a 97 MB trailer;> [!NOTE],[!TIP],[!IMPORTANT],[!WARNING]and[!CAUTION]become a soft labelled panel, with no colored edge.assets(from the published checkpoint) andasset_notes. The Files document endpoint returns the referenced files that exist at that revision, so the same article reads the same in Files.Decisions
The review explanation says what the draft carries besides its words, e.g. "With 2 figures, 1 interactive piece and 1 video." Diagrams count as figures.
Drafts
page-figuresskill in both packages:Rollout
--check-assetsbefore any model call. The rebuild also activates Finish runs instead of crashing on recoverable checks, and write down how to fail well #298's task-bridge fix.Delivery doesn't carry bundles yet; that's plan PR 2 (content.deliver and website.change map the blocks to the site's components). Until it lands, an approved draft with figures delivers its words, and its figures stay in Tin. So I'd ship plan PR 2 soon after, or hold delivering bundle drafts until then.
No migration and no Temporal change. Runs keep the versions they pinned.
Verification
tests/test_page_assets.py, new here:javascript:URL kept as code, both callout forms, and other documents unchanged.web/page-bundles.browser.test.js, in Chromium:data:image with its caption, and a missing one shows its placeholder.localtimetests fail as on main.lint-importsanddump_catalog.py --checkare clean.A real run comes after the template rebuild: a draft with figures, a diagram, an embed and a video, reviewed in Tin.
🤖 Generated with Claude Code