Repository navigation
Conversation
Live documents need comments that follow the text as people edit. A thread
on a live document is a Postgres row (no version) whose position is
BlockNote's comment mark in the Y.Doc. The server places the mark through
the apply pipeline, over the editor's selection (Yjs relative positions) or
over a quote (agents), so a commenter's read-only socket is never written by
the client and people and agents share one path. Creation places the mark
before writing the row, so no thread exists without its mark.
Threads whose mark leaves reachable content are flagged orphaned ("Text
removed"), stay open with their quote, and can be re-anchored. Reactions are
stored per person per emoji. The three copies of thread loading (threads
routes, comments routes, MCP) become one reader in lib/threadList.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heir fragment A sub-fragment (page text, embed, widget label) has no blockContainer with the target's block id, so a quote there was never found. M6 uses this path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at thread The Y.Doc is client-writable, so a comment mark may carry any thread id. Orphan sync reads only the document's own threads; this pins it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M2b registered the six routes these rows were decided for ahead of time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eads
Live documents get BlockNote's own comments UI (floating composer and
thread, a sidebar with an open/resolved filter, reactions) over a Primer
ThreadStore that reads and writes the thread routes. Creating a thread sends
the selection as Yjs relative positions and the server places the mark, so
BlockNote never sets it client-side on a read-only connection;
addThreadToDocument is a no-op for that reason. Other viewers follow along
through the document's lifecycle events.
Deleting or replacing text an open comment points at is held by a
ProseMirror filter and confirmed in a dialog ("Delete anyway"); changes from
other people are never held.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents need the live content with real block ids and per-block versions (their edit preconditions), and a cheap way to catch up: a read since a docVersion returns only the blocks changed since, plus deleted ids, from doc_updates.touched. Exposed as GET /api/documents/:docId/live and primer_get_doc on both MCP surfaces; the description marks block content and comments as untrusted data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents write by block (add, update, replaceRange, delete, move) with the version they read as precondition; one malformed op rejects the batch with indexed fixes, a stale op becomes a conflict while the others apply, and an op that removes text of an open comment thread is refused unless allowCommentedDelete. Updates from Markdown or HTML are rebased onto the block (fast-diff over text runs, then only the expressible marks), so colours, underline, comment marks and children the agent never saw stay. The pipeline gains what this needs: a build may return a Refusal, which turns only that edit into a conflict (each build runs on its own transform, so a refused edit leaves no half-applied steps); every inverse edit records per-block inverses with the block's prior place, enough to undo deletes, moves, adds and range replacements; a structurally invalid result is a refusal, not an exception. onConflict is passed through unchanged, the seam where suggestions (M5) take over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People ask an agent to work on a live document; the ask becomes a run (queued, running, failed, done, cancelled) with the viewer's context, the same ask while one is active returns that run, and cancel, retry and plan approval are first-class. Every status change is a job on the document's queue and the pipeline guard rechecks the run there, so a cancel or an approval can't race an apply: the apply lands whole first, or is refused run_cancelled. A run's cumulative work is reserved atomically in the guard (one conditional UPDATE): past 60 edits or 20 removed blocks it needs a plan approved by a person (never an agent, which inherits editor) and more ops are refused approval_required. Running agents appear in the document's awareness as a collaboration cursor with a status line, renewed so peers don't drop it after 30 s. Run requests reach agents fenced as untrusted text; ids from requests and the Y.Doc are scoped to their document. Adds agent_runs and run_inverses (one migration for the milestone), run routes, events run.requested/run.updated, and primer_list_runs and primer_update_run on both MCP surfaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run's applied edits store per-block inverses in run_inverses; undo replays them newest first through the pipeline: blocks the run created are removed, removed ones re-inserted at their recorded place, changed ones restored and moved ones moved back. Each block is touched only if it is still as the run left it, so a person's later edit is never overwritten (a conflict now, a restore suggestion once M5 lands; undo already asks for onConflict 'suggest'). It reads only from Postgres, so it works after a restart with no expiry. POST /api/runs/:runId/undo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run can't do what the person who asked couldn't: before a run's ops apply the requester's role is read again, and a requester who can't edit gets requester_cannot_edit (the run may comment). An approval names the plan by its sha256, so a plan replaced after a person read it isn't approved (plan_changed). Retry is a new ask by the retrier with the same checks (access, agent, thread), never by the agent itself. The request (prompt, unsent text) is shown only to the requester, the run's agent and the owner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents lay out a document as pending placeholders (a custom BlockNote block with the section's intent and run), then fill each one with update: the block is replaced in place and keeps its id, so people watch the draft fill section by section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents now show what they are doing through their run's awareness state (status line and cursor, renewed while the run is active), so the TTL working status is gone: setDocumentStatus, activeDocumentStatuses, the /api/documents/:id/status routes and scope rows, primer_set_status on both MCP surfaces, DOCUMENT_STATUS_TTL_MS and the status event and types, and the web's status query and banner. The legacy-document awareness connection is left for the web milestone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r people Undo writes the document, so whoever undoes must be an owner or editor by the role read now (a requester demoted to commenter can't), and only once the run has stopped. Every run returned to a caller now goes through one function that hides the request (prompt, unsent text) from anyone but the requester, the run's agent and the owner, so cancel, approve and retry responses can't leak it either. Only the person who asked retries a run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents editing live documents need the rules in one place: Markdown for prose, one HTML element or BlockNote JSON for what Markdown can't carry, one list item per block, edit by block id with expectVersion, re-read with since, outline-first with pending blocks, how to work a run, and that text written by people is untrusted data. It lives in the plugin as authoring.md (linked from SKILL.md) and both MCP servers serve it as the resource primer://skills/authoring, pointed to by the server instructions; the builds copy it into dist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…equests fenced Undo removes a block the run created together with its children, so its precondition is now the whole subtree's version: a person's later edit to a nested block makes it a conflict instead of being deleted. And every path that hands a run's request to its agent (claim, status, finish, list, the viewer of a read) fences the prompt and unsent text as untrusted data, not only the run list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An agent's run sets its status and cursor in the document's awareness; the editor already draws the cursor (BlockNote collaboration cursors), and this shows each working agent's status line above the editor, replacing the removed TTL working status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Awareness is client-writable, so anyone could publish an agent's status line and cursor. The server now strips agent fields from people's awareness updates, shows each person's cursor under their own name, and drops updates under a running agent's client id; the status line trusts an agent entry only under the client id the server uses for it (agentClientId, now shared in api-types). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…subtrees Security review of M4 found two gaps in agent operations. Run scoping was optional: an agent could leave runId out of apply_ops and so skip its run's requester role cap, cancel and plan approval. Now an agent with a queued or running run (one a person asked for) on the document is refused `run_required` without that runId, and an agent with none writes under a direct run the server opens for the batch (kind 'direct', asked by the agent, finished right after the apply), so inverses, undo, the budget and attribution always exist. People's writes are unchanged. The large-edit budget undercounted: deleting a parent removed all its children but cost one. The guard now gets the live Y.Doc on the document queue and counts every block in the deleted or replaced subtrees from it; add and replaceRange cost one edit per block written, nested ones included. The atomic conditional UPDATE reservation is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…removed The removal budget counts subtrees on the live document before the batch, so a batch could move a large subtree into a range and then replace the range: the moved blocks were gone but uncounted. A moved subtree now counts with the next delete or replaceRange in the batch (an overcount only for batches that move then remove, which agents can split). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The removal counter estimated each op on the live document and carried a moved-subtree accumulator between ops. It could be gamed: the accumulator reset after each removal, and an op that did not resolve cleared it, so a batch could remove more blocks than it was charged for. The guard now runs the batch's own planned-edit builds through the pipeline's prepare (the code path the real apply uses) on scratch copies of the live fragments, and counts by block id: blocks present before and absent after are removals; blocks added, changed or moved are edits. Fail closed: when any op would not apply (a conflict or a throw) while the rest of the batch removes or moves blocks, the batch needs an approved plan whatever the counts. Stale or comment-held ops in batches that remove nothing keep their own refusals. Open threads now load before the dry run, so it refuses what the real apply refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents edit documents they (or their person) own and suggest everywhere else; the owner can set a document's agent mode. The M5.1 spike showed suggest-changes marks don't survive y-prosemirror for block-level changes, so a suggestion is a stored proposal: per-block edits (ProseMirror JSON of the blockContainer, so marks the agent never saw survive) with the base versions they expect. The pipeline turns suggest-mode edits, and with onConflict 'suggest' edits whose target changed, into these rows; accepting replays them as one planned edit with those preconditions, so a stale suggestion is refused and stays open. Only people who own or edit the document accept or reject; an agent may only withdraw its own. Every lookup is scoped by the suggestion's own document, and agents get proposed text fenced. Undo now suggests restoring blocks people changed since, and a run whose requester can't edit gets its edits as suggestions instead of a refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new Markdown or text version of a live document used to be refused (republish_unsupported) because "both changed" needs suggestions. Now it is merged into the live blocks: base is the server-signed sources groups, mine the live blocks, theirs the new file. Groups align by identical slice, then by similarity (same leading token, order kept, >= 0.5), so a reworded paragraph keeps its block, comments and id. Untouched groups take theirs, edited ones keep mine and get theirs as a suggestion, removed ones are deleted unless edited, new ones are inserted in place, all in one plan through the pipeline; "untouched" is decided inside it, against the live document. sources and meta are rewritten in the same transaction, so an untouched republish exports the new file byte for byte. The version keeps the uploaded original, and the response carries the Reconciliation. similarity/normalizeText (lib/similarity.ts) follow M6.4's definition so page pid matching and re-anchoring reuse them. The file is untrusted and edit distance is quadratic, so similarity takes a minimum and bands the distance, slices over 4 KB align by identity only, and a per-republish character-pair budget falls back to identity matching, noted on the affected outcomes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open suggestions on a live document are listed per tab beside the editor, each block's change shown as a diff of its current and proposed text. Owners and editors accept or reject per suggestion; accepting goes through the server's pipeline, which refuses a suggestion whose block changed since. The list follows suggestion events. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People edit an HTML page's text without touching the page's own code: every element whose children are only text and <br> gets a `data-pid`, inserted into the original upload so the rest of the page stays byte for byte. Pids survive agent republishes by matching old and new elements (kept pid, then same path, then same tag, by text similarity), and a match on repeated labels or with a close runner-up is flagged uncertain so people's text on it is never carried silently. Splice-back writes changed text at each pid's source span and leaves untouched pids' bytes alone. One text rule serves seeding, splicing, comparison and the bridge: <br> is a newline and, outside <pre>, source indentation collapses, so editing one word in an indented paragraph never splices line breaks in. Checked on real agent pages up to 120 KB / 1,000 pids: stripping the pids gives the original, and restamping is a no-op. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each pid's text lives in its own fragment `page/<blockId>/<pid>`, written through the one apply pipeline. A text edit replaces only the changed middle, so comment marks on the rest of the text stay. On an agent republish each pid is decided three ways against its last stamped text: untouched text takes the agent's, text only people changed is carried, and when both changed, or the match was uncertain, the agent's text wins and people's text is returned as a suggestion. People's text is read inside the edit on the document queue, so typing that races the republish is never lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents can place <primer-table>, <primer-code>, <primer-mermaid> and <primer-math> in an HTML page. The sanitizer keeps them with their literal `data-embed-id` and `lang`; each becomes the native BlockNote block (table, code, diagram, math) in its own fragment, and an untouched one exports as its original source. A missing, invalid or repeated id is refused at publish with the element's path, since an id set by a script can't anchor state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bridge reports each stamped element's DOM text after the page's scripts ran; a pid whose text no longer equals its source text was drawn by a script (a chart label, a counter) and gets no overlay editor, as do pids a script cloned or the sanitizer dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page's fragments are seeded from its stamped source at publish (each pid with its text, each embed with its native blocks), and its current HTML is rendered on demand by splicing in only the pids and embeds that changed. An embed counts as untouched when its blocks equal the blocks its source gives, recomputed from the stored stamped source, so no editor-writable state can make the export lie about it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page is untrusted input. Matching charged only similarity's character work, so pairs rejected by tag, path or length were free and a page with thousands of elements still did quadratic work. Now every examined pair costs at least 1, candidates come from tag and path indexes, both loops stop once the budget is spent, the pairs kept per stage are capped and only the first 3,000 elements per side are matched; the rest get fresh pids. Stamping and splicing applied each insertion by copying the whole page, also quadratic; both now build the output in one pass. A 20,000-element page of identical labels stamps and matches in well under a second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An HTML publish now makes a live document holding one page block over the stamped upload, like Markdown and text: the stamped source is stored once with the checkpoint that published it (pages/<documentId>/<versionId>.html, purged with the document), each pid's fragment is seeded with its text and each embed's with its blocks, and a legacy document's open threads are anchored where their quote occurs once in the page text. An HTML version of a page document carries people's text over three ways through the pipeline: the publisher's text wins where both changed, and the person who last wrote the lost text gets it back as their suggestion. The page block (packages/blocks) names its fragments: the page's pids and embed ids are props, so reachability, and with it thread orphaning, follows republishes. Its source key is editor-writable, so every read checks it lies in the document's own prefix. Bundles, export and print render a page document as its page with people's text spliced in; its frame is served from GET /api/documents/:docId/pages/:blockId/content with the artifact CSP, and GET /api/documents/:docId/pages/:blockId binds the host to it (policy, each pid's source text, embeds). Page text paragraphs carry the page block's id, so a pid target locates its block like any other: agents edit page text with `update` and a plain-text block under the usual version precondition, and suggestions on page text keep their fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uggest-mode republish) A page republish follows the same rule as Markdown: when nothing applied, no original is stored and no checkpoint written. An agent that may only suggest on a legacy document can't make it live (there is nothing to suggest against). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its HTML republish proposes new text for the page's existing elements as suggestions; the page's source, elements and embeds change only by someone who may edit, so the stored source is discarded and no version is made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y document HTML publishes are live pages now, so the thread carry across HTML versions (lib/threadCarry.ts) has no caller and goes, with its tests. Tests of legacy behaviour create a legacy document directly (testing/legacy.ts); content assertions expect the stamped pids. Republishes of one document run one at a time, so two publishes on the same base can't both win. New tests pin a page document end to end: the upload becomes one page block; its frame is served with the artifact CSP; export splices people's text into the original; an agent's republish keeps text only people changed and returns both-changed text to its writer as a suggestion; a removed element's thread is orphaned, not lost; an agent edits a pid with ops and the comment on it stays; a suggest-mode agent only suggests and can't make a legacy document live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
primer_get_doc lists a page document's pages: each page block's source as
published (with its data-pid attributes, to republish with them intact) and
each pid's current text, fenced as untrusted with the shared random-tag
fence, with the version an update expects. An `update` op on
{ tabId, blockId, pid } takes plain text. The authoring skill's HTML pages
section explains stamping, keeping pids on republish, carry-over and
suggestions, script-drawn text and the <primer-*> blocks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oint Page block props are editor-writable, so any editor could point a page at a missing source and make loadStamped throw for every reader. Loading a source now returns null (logged) on any storage error; an agent's read lists such a page as unavailable (`source: null`) and still returns the rest, loads each source once, and lists at most 20 pages and 5,000 pids. Export and checkpoints render the first page block whose source loads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature `page-text`: after the page's load handlers ran, the bridge reports each stamped element's DOM text and rect (page_elements), then rects again on scroll and resize (page_rects), and clicks (pid_clicked). set_page_texts sets only text on elements carrying that data-pid, outside Primer blocks, with `\n` as <br>: nothing the host sends is parsed as markup. Feature `embeds`: <primer-*> blocks report rects and clicks (embed_clicked) and show the static HTML the host renders (set_embeds), Mermaid rendered in place. The host parses every message strictly (ids as the server stamps them, finite rects, bounded sizes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page block renders its page in the sandboxed frame (ArtifactIframe, which now grants a live page the page-text and embeds features and hands it their messages) and pushes people's current text and each Primer block's text-only HTML into it, again on every change of those fragments. Clicking an element opens the one host overlay (live/Overlay.tsx, C9): a BlockNote editor in Primer's window drawn over the element, bound to its sub-fragment, so keystrokes never reach the page. Page text gets BlockNote's comments, anchored in its fragment (the thread store can be scoped to one pid); a Primer block gets the full block editor. Text a script drew is read-only and opens no editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xt alone Found in the browser check: the host pushed people's text into every pid, so a pid a script redraws (a computed total) showed its source text again; now only editable pids get text pushed. The overlay follows the frame when the host scrolls, opens with the cursor at the end of the text, and drops BlockNote's side padding so it lines up with the element. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maxsam4
force-pushed
the
stack/collab-m10a-decisions
branch
4 times, most recently
from
November 19, 2026 20:17
b81925f to
ac4762a
Compare
maxsam4
force-pushed
the
stack/collab-m10a-decisions
branch
3 times, most recently
from
November 19, 2026 20:32
05b9dd5 to
599ddb5
Compare
maxsam4
force-pushed
the
stack/collab-m10a-decisions
branch
3 times, most recently
from
November 19, 2026 20:56
5b0eef7 to
a1751eb
Compare
This was referenced Nov 19, 2026
Author
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.
Stacked on #154 (M5, suggestions) → #152 (M4) → #151 (M3) → #149 (M2c) → #148 (M2b) → #146 (M2a), and includes #153 (M10a, merged in with #147 records and #150 chrome). Review only the commits after
collab-m5-suggestions-rebasedandcollab-m10a-decisions(from2e012caon, plus two merge commits). This is M6 of the collaboration plan, with M7's<primer-*>blocks folded in.Summary
HTML uploads become live page documents: the page renders as uploaded in its sandboxed frame, people edit its text in place, and agent republishes carry their text over.
Auto-stamping held; no fallback to agent-authored ids. At publish, every element whose children are only text and
<br>gets adata-pid. It is inserted into the original upload (parse5 with source offsets), so the rest of the page stays byte for byte.<br>is\n, and outside<pre>source whitespace collapses. Editing one word of an indented paragraph never splices line breaks in.Matching across republishes (
page/match.ts), in order:Repeated labels and close runner-ups are
uncertainand never carried silently. Matching uses the shared boundedlib/similarity.tswith a total budget. Every examined pair costs work, candidates come from tag and path indexes, pairs are capped, and only the first 3,000 elements per side are matched. Stamping and splicing are linear: a 20,000-element page of identical labels stamps and matches in about 0.2 s.State. Each pid's text lives in
page/<blockId>/<pid>, one paragraph whose block id is the page block's. A pid target{ tabId, blockId, pid }therefore locates its block like any other, so preconditions, suggestions and comment marks work unchanged.<primer-*>embeds live inembed/<blockId>/<embedId>as native blocks: table, code, diagram and math.pageblock (packages/blocks) carriessourceKey,title,pidsandembeds.reachableFragmentsfollows them, so a removed element's thread orphans instead of disappearing.Publish (
page/publish.ts,lib/publish.ts).pages/<docId>/<versionId>.html) and purged with the document.lib/threadCarry.tsare removed (one way).Republish: three-way carry-over through
applyPlan(page/carry.ts).doc_updates.touched) gets it back as an ordinary stored suggestion.mineis read inside the build on the document queue, so typing that races a republish is never lost.forbidden, with a fix).Splice-back on demand. Export, checkpoints (
static.html,export.html) and print splice changed pids and edited embeds into the stamped source. An embed counts as untouched when its blocks equal those re-derived from the stored source, so no editor-writable state can make an export lie.Agents.
primer_get_doclistspages: each page's source with its pids, and each pid's text (fenced withfenceUntrusted) and version.updateop on{ tabId, blockId, pid }takes plain text.Bridge (
v1.js, featurespage-textandembeds).set_page_textssets text only (\n→<br>), only on elements carrying that pid, never inside embeds.set_embedsfills<primer-*>elements with text-only HTML the host builds from the block state, and Mermaid renders in place.protocol.tsparses every message strictly.Host.
PageViewrenders the frame (GET /api/documents/:docId/pages/:blockId/content, artifact CSP, sandbox unchanged) and binds it viaGET …/pages/:blockId. It pushes current text to editable pids only, and pushes again on every fragment change.live/Overlay.tsx(C9) draws a BlockNote editor in Primer's window over the element, bound to its sub-fragment. Page text gets BlockNote comments through a pid-scopedPrimerThreadStore; embeds get the full block editor.Security
connect-src 'none'are unchanged. The overlay and every editing control live in the host. The page receives only text, set withtextContentand<br>.sourceKeyis honoured only insidepages/<documentId>/.Test evidence
codegen-drift-check,db:migrate:test,typecheck,pnpm -r build,pnpm test(api 1003 passed, web 364, mcp 125, blocks 3) andpnpm audit --audit-level=high. All pass.pnpm --filter @primer/api test:browser: 11 passed.data-pidattributes; script, style and nested-markup elements are not stamped;brbecomes a newline; an existingdata-pidis kept; offsets on a BOM, CRLF and astral characters;sourceKeydoesn't break the read;<primer-*>tags survive sanitize with literal ids; a missing embed id is refused; untouched embeds export verbatim;page_elementsand rejects malformed rects;set_page_textsonly touches stamped nodes (the realv1.jsin jsdom); a script-drawn pid is read-only;set_embedscontent is text only.pnpm dev, two people in separate browser contexts): an agent published a page with a script-drawn chart and total and a<primer-table>.<primer-table>was edited in the overlay, and both people's frames showed it.Deviations
script_text_read_only: only the browser can tell that text was drawn by a script. The server treats every pid as text, and the host makes script-drawn pids read-only.pages/<blockId>.html: the stamped source is stored once, immutably, with the checkpoint that published it, and each bundle'sstate.ydocnames it.🤖 Generated with Claude Code