Anchor decisions to the prose they produced
A questionnaire asks about something and produces something, and both are passages of the plan rather than the questionnaire. Hovering a question now lights up what it concerns; hovering its answer lights up the prose that answer caused. An anchor is a Yjs relative position and a digest of the block's canonical source, and the two do different jobs. The position survives edits around the block it names. The digest recovers it when the position cannot resolve at all — a move rebuilds the block's collaborative identity, and an epoch rotation throws away the history the position was expressed in — by matching content instead. A digest matching two blocks recovers neither: identical paragraphs give no way to tell which was meant, and pointing a decision at the wrong passage is worse than admitting the link is lost. Rewriting an anchored block is the one case neither layer carries, and the one where recovering would be wrong. Whether the new text still concerns that decision is a judgement, so the relationship is marked pending and the agent is told it owes a review. Pending resolves to nothing on purpose: that is what makes the text inert rather than offering a jump somewhere stale. Highlights are written to the DOM, never the document. A highlight is one reader's pointer, not a fact about the plan; in the document it would travel to everyone else and land in their undo history. Verified against the real agent, which asked a question, recorded the answer, anchored the two blocks it had written and recorded that the question itself related to nothing — the plan having been empty when it asked. A browser-side document then resolved those anchors back to the heading and paragraph.
Parent791a620
15 files changed+940-9
StackedSplit