Skip to content

test(id-web): correct structure-replace valley oracle in collab_steps (#16962) - #16968

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
fix-16962-structure-replace-valley-oracle
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
fix-16962-structure-replace-valley-oracle

Conversation

@developing-today-fleet

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

Copy link
Copy Markdown
Contributor

Closes #16962 — the one remaining cargo test -p id-web --lib collab failure after #16953: structure_replace_refuses_to_overwrite_content, panicking with StepRefusal { reason: "the slice's open depths are inconsistent with the replaced range" } on an accepted_in_doc(...).unwrap().

Diagnosis (stale test oracle; the engine mirrors ProseMirror). Verified against the live libraries (prosemirror-model 1.25.13 replace/resolve/findIndex, prosemirror-transform 1.10.4 ReplaceStep.apply/contentBetween):

  • The failing control replaced the range 2..3 in two_para_doc (<p>a</p><p>b</p>) and expected acceptance, calling it "the valley between the two paragraphs — a close token, then an open token". But the close token spans 2..3 and the open token spans 3..4, so 2..3 covers only the close token.
  • contentBetween(2, 3) is indeed false (no content), so the step passes the structure check — in PM and in the engine alike.
  • PM then refuses it in replace(): position 2 resolves inside the first paragraph (depth 1) while position 3 resolves at the document level (depth 0), so depth(from) - openStart != depth(to) - openEnd → ReplaceError "Inconsistent open depths". The engine's refusal is the PM-faithful outcome; the sibling test applied_replace_respects_the_positions_depths pins exactly this equation.
  • The true close+open valley is 2..4: both ends resolve at depth 1, the range contains no content, and splicing out the two tokens merges the paragraphs — PM accepts it, and so does the engine.

Fix (test only, no engine change). The valley control now uses 2..4 (accepted), and 2..3 is pinned as refused with a reason containing "inconsistent" — documenting that the half-valley is refused for open depths, not as an overwrite. Same disposition pattern as #16953 (engine behaviour is the ProseMirror-verified side).

Verification: cd pkgs/id && cargo test -p id-web --lib collab dispatched against this branch via fleet Actions exec (run id in the PR comments); the full diff above is the merge evidence per Drew's rule (CI is not a gate).

Lane 1437-E (alpha DRIVE author lane, 2026-11-29).

{
  "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-29T20:47:25Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

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

…#16962)

The valley between the two paragraphs of two_para_doc spans the close token 2..3 and the open token 3..4, so the content-free valley range is 2..4 (depth 1 on both sides; accepted, merging the paragraphs). The old control used 2..3, which spans only the close token: its from resolves at depth 1 and its to at depth 0, so prosemirror-model's replace() refuses it with Inconsistent open depths — the engine mirrors PM. Pin 2..3 as refused-inconsistent and accept 2..4. No engine change.
@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: 46ee4b35-a058-45ad-9059-cd6a53c4f74b

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

Lane 1437-E: verification dispatched via fleet — run 46308524722 (https://github.com/developing-today-forks/fleet/actions/runs/46308524722), command cd pkgs/id && cargo test -p id-web --lib collab on branch fix-16962-structure-replace-valley-oracle (head d372a6f). Tracking; will merge on a green result + the full-diff read already recorded.

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Lane 1437-E verification: fleet run 46308524722 (branch head d372a6f) concluded success; job log firsthand: structure_replace_refuses_to_overwrite_content ... ok and test result: ok. 96 passed; 0 failed; 742 filtered out — up from 95 passed / 1 failed in confirmation run 46305936205. Full diff read (test-only, +16/-3). Merging under Drew's standing merge rule.

@developing-today-fleet
developing-today-fleet Bot merged commit 59c0077 into main Nov 29, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the fix-16962-structure-replace-valley-oracle branch November 29, 2026 21:08
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.

[main-ci] id-web collab: 1 remaining failure after #16953 — structure_replace_refuses_to_overwrite_content (confirmation run 46305936205)

0 participants