Repository navigation
Conversation
…0xPolygon#154) M10b builds on both: its catch-up reads M10a's decision and task events and M5's suggestions. Both sides kept; M10a's migrations regenerated after M5's (one 0022 migration). The working status M4 replaced with awareness stays removed (M10a's side still carried primer_set_status and the banner), and the comment, suggestion and delete-guard strings from M3 to M5 move to i18n so the M10d lint passes on the combined tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A comment whose sentence was reworded or moved used to stay orphaned until someone quoted the new text exactly. Re-anchoring (primer_reanchor_thread, POST /api/threads/:id/reanchor, and a new Re-anchor button on orphaned threads) now matches exactly first, then the best run of whole words at least 80% alike in the target block, or in the whole tab once that block is gone. It uses the one bounded similarity from the republish merge, with a quote-size cap and a character-pair budget, and refuses a near-tie between two places instead of guessing. Target and quote default to the thread's own, so the button sends nothing. Creating a thread stays exact, nothing re-anchors automatically, and legacy threadCarry is untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People coming back to a document had no way to see what others did while they were away, and AidenHQ had nothing to push to Slack or Telegram. A catch-up is a thin view over what Primer already keeps: the update log (who saved which blocks, which survives compaction) for edits, shown as the blocks read now, and Primer's own lifecycle events (comments, resolved threads, M10a's decision.made/cleared and task.*, suggestion.created and decided, published versions) joined to their rows, grouped per person. The caller's own actions are left out; agents get people's text fenced. - document_views.last_doc_version: opening a document records the visit and returns the previous one as lastView in the same statement, so a refetch never loses "since you last looked". - GET /api/documents/:docId/catchup, GET /api/me/digest and MCP primer_get_digest return the same data; the digest gates every document through the read check again, so a revoked or deleted one never shows. - POST /api/me/digest/email sends a person the digest, laid out as blocks and rendered by exportHtml, the static renderer shares and print use. - A comment mark is an annotation: it is stored as touching no blocks, so delta reads and catch-up don't show commenting as editing. - The version list carries each checkpoint's docVersion, for highlights. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening a live document now shows "Since you last looked": what each person did since the viewer's previous visit (taken once per visit from the document's lastView), with the changed blocks highlighted until it is dismissed. A "Changes since checkpoint" toggle highlights the blocks edited after the latest checkpoint (its docVersion, then a delta read). Highlights are a stylesheet keyed on BlockNote's data-id, never a write to the document, and only plain block ids reach it: ids come from the client-writable Y.Doc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agents and people had no way to tie a claim to its evidence. A citation is a custom inline chip (url or Primer docId + versionNumber, and the supporting quote), numbered in reading order by a CSS counter in the editor, static pages and email. Agents add citations through json block input; applyOps pins a Primer citation to the cited document's latest version, so the claim stays tied to what was read, and refuses a document the agent can't read. GET /api/documents/:docId/citations lists them with what each cites, naming a cited document only after a read check: its id comes from the client-writable Y.Doc. The authoring skill covers citing, re-anchoring and catching up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decisions made in Slack, Telegram or a comment thread had no path into a document. primer_promote_conversation and POST /api/documents/from-conversation turn messages into one quote block each, the author in bold above the text, through the one publish path (a new private document) or, with documentId, through the ops pipeline at the end of a live document, so an agent on someone else's document suggests. Every ASCII punctuation character is escaped and leading spaces dropped, so untrusted message text stays literal and never becomes a heading, link, image, HTML or code block. "Promote to document" on a comment thread does the same for anyone who can read the thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M10b.6 (plan-first for big agent edits) shipped with M4's runs: per-run edit and removal counters, approval_required past the threshold, and approval on the document queue (refused after a cancel). What the plan pins and no test did: splitting a large change into small batches does not avoid approval. Batches of three add up until the edit past the threshold is held. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This tree is the first with both M4's generic ops and M10a's choice blocks. Decisions are made only by a person through the pick route (and proposed through primer_propose_pick), which checks rights and records who decided; an agent's json block input naming decisionId, a decided* render slot or proposedBy is now refused invalid_op, as the M10a follow-up asked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The browser check showed a block highlighted as edited after someone only resolved a thread on it: BlockNote in an open editor rewrites a resolved thread's comment mark, from that person's connection. Tagging the server's annotation writes could not catch that, so persistence now looks at what a transaction did: when it only inserted and removed comment-mark formatting, it touches no block, whoever made it. The pipeline goes back to its plain origin. The scope test lists primer_promote_conversation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… citation chips have height - MCP document reads record last_doc_version with viewed_at, as the REST read does, so the two halves of lastView never disagree. - POST /api/me/digest/email answers 503 when this Primer sends no email, instead of reporting it sent. - The citation chip sat in a sup with zero line height (the reset gives sup line-height 0), so it had no box; it gets its own line height in the editor and in static pages. - The promote route is tested over HTTP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M10b's page-text parts need M6's page fragments. Both sides kept: M6's migrations replace this branch's 0022 and the catch-up column is regenerated after them (0023); M6's i18n keys for the M3–M5 strings win, and this branch's own keys (catch-up, thread actions, checkpoint changes) are added to them. The events line in the skill reference that the M10a merge had duplicated is M6's single line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since M5, a republish by an agent in suggest mode makes no version: the response carries only a reconciliation. The dialog still closed and opened the document as if a version had been added. It now stays open and says what happened (how many blocks were suggested, conflicted or unchanged), with a button to open the document where people decide them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With M6 merged, text people edit inside an HTML page lives in the page's own fragments (page/<blockId>/<pid>), which the update log records by fragment name, not block id. Delta reads, catch-up and the highlights built on them now map a sub-fragment (page text, embed, widget label) to the block it belongs to, so a page whose text changed reads as a changed block instead of nothing (or a deleted id). Fuzzy re-anchoring already searches a sub-fragment whole; a test pins it for a retyped page sentence. 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-m6-pages
branch
from
November 19, 2026 20:55
12f24fa to
f5f1664
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). It also includes, merged in:
Review only the M10b commits: everything after the three merge commits (
ecb9661M10a,0e6fcaaM5's final head,65c159bM6).This is M10b of the collaboration plan (
docs/design/collaboration-plan.mdin #144).Summary
Awareness of change: what happened while you were away, where it happened, and where claims come from.
doc_updates: who saved, which blocks; it survives compaction), shown as the blocks read now throughgetLiveDoc({ since })anddeletedIds.primer, audiencereaders), joined to their rows:comment.created,thread.resolved, M10a'sdecision.made/decision.clearedandtask.*,suggestion.created/suggestion.decided,version.published.document_views.last_doc_version: opening a document records the visit and returns the previous one aslastView, read in the same statement, so a refetch never loses it.GET /api/documents/:docId/catchup?since=&sinceVersion=.GET /api/me/digest?since=and MCPprimer_get_digestreturn the catch-up of every document in the caller's library that changed since (at most 50).primer_list_documentsand tasks treat agents.POST /api/me/digest/email { since }emails a person their digest on request (there is no scheduler and no "last sent" state). The digest is laid out as blocks and rendered byexportHtml, the static renderer that shares and print use. People's text goes in as plain text.Notifier.notifyDigestaddresses and sends it; agents have no mailbox.docVersion; the web readslive?since=with it.data-id, never a document write. Only plain ids reach it, because ids come from the client-writable Y.Doc.findMarkedQuote/findQuotegain an opt-in fuzzy stage, used only byreanchorThread(primer_reanchor_thread, and a new Re-anchor button on orphaned threads).similarity ≥ 0.8in the target block, or in the whole tab once that block is gone.similarityfromlib/similarity.ts(banded, threshold-cut), with a 2,000-character quote cap and a 20M character-pair budget.threadCarry.tsis untouched.citationinline chip{ url?, docId?, versionNumber?, quote }, numbered in reading order by a CSS counter (editor, static pages, email).jsonblock input.applyOpspins a Primer citation to the cited document's latest version and refuses a document the agent can't read.GET /api/documents/:docId/citationslists them and names a cited document only after a read check.primer_promote_conversationandPOST /api/documents/from-conversationcreate one quote block per message, the author in bold above the text.documentIdit goes through the one publish path as a new private document. WithdocumentIdit goes through the ops pipeline at the end of a live document, so it is a suggestion on someone else's document.POST /api/threads/:threadId/promote) does the same for anyone who can read the thread.approval_required, approval on the document queue). This PR adds the test M4 lacked: small batches add up to the threshold.decisionId, adecided*render slot orproposedByis refused withinvalid_op. Picks stay with people, on the pick route.page/<blockId>/<pid>fragments, which the update log records by name. Delta reads, catch-up and highlights map a sub-fragment (page text, embed or widget label) to its block, so a page whose text changed reads as a changed block, not as nothing or as a deleted id.AddVersionResponsewith onlyreconciliation). The "Add version" dialog now stays open, says how many blocks were suggested, conflicted or unchanged, and offers to open the document, instead of navigating as if a version had been added.0022, plus this PR's0023(document_views.last_doc_version). The working status M4 replaced with awareness stays removed; M10a's side still carriedprimer_set_statusand the banner. M3–M5's web strings moved to i18n, so the M10d lint passes on the combined tree.Security
documentId: catch-up's comment, thread and task joins, and citations' cited documents, which also go through the caller's read check. Block ids reach CSS only when they match^[\w-]{1,128}$.fenceUntrusted, withuntrusted: true. Promoted message text is escaped (every ASCII punctuation character, leading spaces dropped), so it can never become a heading, link, image, HTML or code block.Deviations
approval_requiredat 60 edits / 20 removed blocks. The plan namedplan_requiredat 20 / 5. The test is named for M4's numbers.lastViewfrom the document read, taken once per visit, rather than a separate "seen" write.0023.POST /api/me/digest/email), not on a schedule. It answers 503 when this Primer has no mail sender.editscounts saves, not blocks: typing one sentence was 29.Test plan
catch-up lists only changes after my last viewthe digest only includes documents the recipient can still read(REST and email; the MCP tool ran in the browser check)orphaned thread re-anchors to the reworded sentenceblocks edited after the checkpoint are highlightedcitation to a Primer doc pins the cited versiona thread becomes a document with one quote per message, and the REST routeBrowser check
Two people, A and B (an editor), with Chrome against a dev API and web on a throwaway Postgres:
primer_apply_ops.GET …/citationslists it.GET /api/me/digestlists only "Launch plan" and never mentions the other document.primer_get_digestover MCP returns fenced data (untrusted: true).🤖 Generated with Claude Code