Skip to content

Revert guide: agent caret + reviewable agentInsertion highlights (#86 phase 6) #136

Description

@hevayo

Escape-hatch documentation for the agent-caret/highlight/review slice (grilled 2026-07-08), so it can be cleanly reverted if the character-exact application or the review gate causes trouble. Commits on feature-collab-with-agents will be listed here once shipped.

What the change does (and what a revert restores)

Area With this change After revert
Agent md edit application (@aep/collab-doc) y-prosemirror updateYFragment minimal diff; inserted ranges formatted with the agentInsertion mark; caret relative-position returned Whole-fragment reparse (delete-all + markdownToFragment), no marks, no caret — the #128 v1 behavior
Agent presence (services/agents room peer) Publishes awareness cursor at its last insertion (CollaborationCaret renders it) Avatar-only presence, no caret
Committer (services/collab) Interim flushes SKIP md files with pending agentInsertion marks; forced flush on beforeUnloadDocument commits regardless (accept-by-default) Every flush commits all changed files immediately (#133 behavior)
Console (SpecMdEditor) Registers the shared mark + highlight styling; review bar (Accept all / Reject all) + per-range bubble menu Plain editor; unknown-mark content in a live doc would ERROR in the editor schema — see revert order below
Schema (@aep/collab-doc markdown manager) AgentInsertion mark in the shared schema; markdown serializer passes it through (committed md stays clean) Mark absent from schema

Revert procedure

  1. Revert the commits listed below (they will be scoped to this slice; git revert in reverse order).
  2. Ordering caveat: live rooms may still hold docs containing agentInsertion attributes. Reverting the console/schema first would make the editor/serializer meet unknown marks. Safe sequence: restart collab-server AFTER the revert deploy (rooms die, docs reseed from clean git markdown — marks never persist to git by design, so a reseed is always clean).
  3. Nothing to migrate in git history: committed markdown never contains marks; the review gate only delays flushes, so at most one pending session's edits flush late.

Why it might need reverting (watch for)

  • updateYFragment diff pathologies (structure-heavy edits producing bad merges or duplicated nodes).
  • The review hold-out starving commits (a file stuck unreviewed for a whole session while other edits pile up behind the gate).
  • Markdown serializer mishandling the passthrough mark (marks leaking into committed markdown, or serialization errors in the committer).

Related: #86 (design comments: agent-edit application + reviewable additions), #133 (committer semantics this modifies), #130 (chat panel that triggers agent edits).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions