Skip to content

fix(id-web): repair the collab suite's red cluster on main (#5535) - #16952

Closed
developing-today-fleet[bot] wants to merge 1 commit into
mainfrom
felix/5535-collab-red
Closed

developing-today-fleet[bot] wants to merge 1 commit into
mainfrom
felix/5535-collab-red

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Refs #5535 — repairs the id-web collab red cluster that blocks #5535's close-out.

Evidence

#5535's close-out confirmation run 46285580674 executed on main and came back 89 passed, 7 failed (log read firsthand; verdict on the issue, comment 7260850923). All seven failures are in crates/id-web/src/collab.rs / collab_steps.rs. This PR fixes the four distinct causes:

  1. content_between counted an empty range inside a text run as content — a structure replace at a cursor position (from == to inside text) was refused as "would overwrite content". prosemirror-transform's contentBetween holds nothing for an empty range. A text run now counts only when the range covers a non-empty span of it. (Fixes structure_replace_refuses_to_overwrite_content.)
  2. Applied steps left text runs split. Step application cuts text at step boundaries; a mark round-trip (addMark then removeMark over the same range) left one logical run as two tokens, so the model no longer equalled the same document built from JSON. check_steps_in_doc now coalesces adjacent text runs with identical marks after each applied step. (Fixes mark_steps_update_the_model.)
  3. Two apply-gate controls used geometry ProseMirror refuses. The unopenable-depths control inserted an openStart-1 slice at a depth-0 position — the model's own depth test pins that as the refusal case; the heading control inserted a block slice at a text position, refused on content. Both controls now use the shapes clients actually send (the paragraph split inside the paragraph; the heading at the document level). The refusal halves of both tests are unchanged, and no refusal rule is weakened. (Fixes the two test_apply_steps_rejects_* controls.)
  4. Three checkpoint tests counted events from before design(id): note access policies do not replicate — a peer rebuilding from events alone treats scoped notes as public (#3819 follow-on) #16717. Since the policy-replication fix, a policy change is a signed note.set_access event in the log, so set_note_access adds one event the tests didn't count. Their counts now include the policy event, with the composition stated. The contract they pin — a refused publication records nothing — is unchanged. (Fixes the two restart/policy tests and the access-boundary test.)

Verification

  • Verification of record: fleet-command run 46303109535 — cargo test -p id-web --lib (full suite, no filter) on this branch. Do not merge until that run has executed and its log has been read (executed counts, not the conclusion).
  • A local iteration build of the same selection was still compiling at push time; the remote run is the record either way.

After this merges, #5535's close-out re-run (the collab selection on main) can complete lane 0640-AJ's recorded close-out for queue task 18320.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T19:51:16Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "010b47d1c4cecdcd1b7d6ea260b7c9b0a61fb89e"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Seven collab tests failed on main (run 46285580674: 89 passed,
7 failed). Four distinct causes:

- content_between counted an empty range inside a text run as
  content, so a structure replace at a cursor position was
  refused as overwriting. A text run now counts only when the
  range covers a non-empty span of it (prosemirror-transform's
  contentBetween).
- Step application cut text runs at step boundaries and never
  re-merged them, so a mark round-trip left the model holding
  one logical run as two tokens. Applied steps now coalesce
  adjacent text runs with identical marks.
- Two apply-gate controls used step geometry ProseMirror
  refuses (an openStart-1 slice at a depth-0 position; a block
  slice at a text position). The controls now use the shapes
  clients actually send: the paragraph split inside the
  paragraph, and the heading at the document level. The refusal
  halves are unchanged.
- Three checkpoint tests counted log events from before
  #16717 made a policy change a signed event in the log; their
  counts now include the policy event. The refusal contract
  they pin (a refused publication records nothing) is
  unchanged.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 359126de-342a-4cdc-94e0-c0837ab4751d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Closed as superseded by PR #16953 (lane 1337-G, alpha DRIVE, 2026-11-29).

PR #16953 #16953 — the #16947 fix for this same red cluster (run 46285580674) — MERGED at 2026-11-29T19:53:40Z, merge commit 1574115, two minutes after this PR was created (19:51:26Z). I read this PR's full diff against the merged one hunk by hunk; the fixes are substantively identical:

  1. content_between: the same expression — a text run counts only on a positive-length overlap (start.max(from) < at.min(to)).
  2. Text-run coalescing after each applied step: here in the check_steps_in_doc loop, in fix(id-web): collab step-engine normalization + stale test oracles (#16947) #16953 inside apply_step_in_doc (its only caller is check_steps_in_doc — equivalent coverage).
  3. Both apply-gate controls moved to the same positions (depth control to from 1 inside the paragraph; heading control to from 7 at document level). This PR's two-paragraph split slice and fix(id-web): collab step-engine normalization + stale test oracles (#16947) #16953's one-paragraph slice both satisfy the same assertions.
  4. Note-policy event totals updated identically (3 / 4 / 3 / 5 / 6), each including the note.set_access event from design(id): note access policies do not replicate — a peer rebuilding from events alone treats scoped notes as public (#3819 follow-on) #16717.

Nothing in this PR is missing from main, so there is no delta to land; the CONFLICTING state is the overlap itself. The per-test diagnosis is recorded on #16947 (comment 7261581776) and the landed resolution at comment 7261646890 — including the still-owed suite-green confirmation run (dispatch routes were broker-blocked from the authoring seat, #16762), which #5535's close-out also waits on. No reflection on this PR's author lane: the two lanes converged on the same diagnosis independently in the same window. Key: 1337-G

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants